eu.scape_project.watch.dao
Class EntityDAO

java.lang.Object
  extended by eu.scape_project.watch.dao.AbstractDO<Entity>
      extended by eu.scape_project.watch.dao.EntityDAO

public final class EntityDAO
extends AbstractDO<Entity>

Entity data access object.

Author:
Luis Faria

Method Summary
 int count(String bindings)
          Count the results of a query for Entity.
 Entity findById(String entityName)
          Find Entity by id.
static String getEntityRDFId(String entityName)
          Get Entity RDF ID.
static EntityDAO getInstance()
          Get singleton instance.
 Collection<Entity> listWithType(String type, int start, int max)
          List Entity that have the defined type.
 List<Entity> query(String bindings, int start, int max)
          Query for Entity.
 
Methods inherited from class eu.scape_project.watch.dao.AbstractDO
addDOListener, count, delete, delete, findById, fireOnRemoved, fireOnUpdated, query, removeDOListener, save, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEntityRDFId

public static String getEntityRDFId(String entityName)
Get Entity RDF ID.

Parameters:
entityName - The entity name that uniquely identifies this entity.
Returns:
Get the RDF ID.

getInstance

public static EntityDAO getInstance()
Get singleton instance.

Returns:
The singleton instance

findById

public Entity findById(String entityName)
Find Entity by id.

Parameters:
entityName - the entity name
Returns:
the Entity or null if not found

query

public List<Entity> query(String bindings,
                          int start,
                          int max)
Query for Entity.

Parameters:
bindings - The query bindings, see AbstractDO.query(Class, String, int, int)
start - The index of the first item to retrieve
max - The maximum number of items to retrieve
Returns:
A list of Entity filtered by the above constraints
See Also:
AbstractDO.query(Class, String, int, int)

count

public int count(String bindings)
Count the results of a query for Entity.

Parameters:
bindings - The query bindings, see AbstractDO.count(Class, String)
Returns:
The number of results expected for the query

listWithType

public Collection<Entity> listWithType(String type,
                                       int start,
                                       int max)
List Entity that have the defined type.

Parameters:
type - the EntityType related to the Entity
start - the index of the first item to return
max - the maximum number of items to return
Returns:
a list of Entity filtered by the defined constraints


Copyright © 2012. All Rights Reserved.