|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.scape_project.watch.dao.AbstractDO<T>
T
- Type of the data object.public abstract class AbstractDO<T extends thewebsemantic.binding.RdfBean<T>>
Abstract class to base Data Object classes creation.
Constructor Summary | |
---|---|
AbstractDO()
|
Method Summary | |
---|---|
void |
addDOListener(DOListener<T> listener)
Add a listeners to data object events. |
protected int |
count(Class<T> typeClass,
String bindings)
Count the number of results that a query will produce. |
void |
delete(T... objects)
Delete several objects at the same time, calling delete(RdfBean)
on each. |
T |
delete(T object)
Delete object (not cascading) and fire removed event. |
protected T |
findById(String id,
Class<T> typeClass)
Find a resource by its Id. |
void |
fireOnRemoved(T object)
Fire an on remove event. |
void |
fireOnUpdated(T object)
Fire an on create or update event. |
protected List<T> |
query(Class<T> typeClass,
String bindings,
int start,
int max)
Generic method to query the KB. |
void |
removeDOListener(DOListener<T> listener)
Remove existing listener of data object events. |
void |
save(T... objects)
Save several objects at the same time, calling save(RdfBean) on
each. |
T |
save(T object)
Save object (not deeply) and fire on update event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractDO()
Method Detail |
---|
protected T findById(String id, Class<T> typeClass)
id
- The id of the resourcetypeClass
- The class of the resource we want to find
null
if not foundprotected List<T> query(Class<T> typeClass, String bindings, int start, int max)
typeClass
- The class of the return type we want to bind width.bindings
- The bindings to use, to be injected into SELECT ?s WHERE {?s
type-of \start
- The index of the first item to returnmax
- The maximum number of item to return
protected int count(Class<T> typeClass, String bindings)
typeClass
- The class of the return type we want to bind width.bindings
- The bindings to use, to be injected into SELECT ?s WHERE {?s
type-of \public void addDOListener(DOListener<T> listener)
listener
- The listener handler.public void removeDOListener(DOListener<T> listener)
listener
- The listener to removepublic void fireOnUpdated(T object)
object
- The created or updated object.public void fireOnRemoved(T object)
object
- The removed object.public T save(T object)
object
- The object to create or update.
public void save(T... objects)
save(RdfBean)
on
each.
objects
- The objects to savepublic T delete(T object)
object
- The deleted object.
public void delete(T... objects)
delete(RdfBean)
on each.
objects
- The objects to delete
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |