|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ChromatticSession
| Method Summary | ||
|---|---|---|
void |
addEventListener(EventListener listener)
|
|
void |
close()
|
|
|
create(Class<O> clazz)
Creates a transient instance of the specified object. |
|
|
create(Class<O> clazz,
String name)
Creates a transient instance of the specified object. |
|
|
createQueryBuilder(Class<O> fromClass)
Create a query builder. |
|
|
findById(Class<O> clazz,
String id)
Finds an object from its identifier or return null if no such object can be found. |
|
|
findByNode(Class<O> clazz,
javax.jcr.Node node)
Finds an object mapped to the provided node. |
|
|
findByPath(Class<O> clazz,
String relPath)
Finds an object with a path relative to a chromattic root object. |
|
|
findByPath(Object origin,
Class<O> clazz,
String relPath)
Finds an object with a path relative to a specified origin object. |
|
|
getEmbedded(Object o,
Class<E> embeddedType)
Returns a specified embedded object. |
|
String |
getId(Object o)
Returns the id of a specified entity. |
|
javax.jcr.Session |
getJCRSession()
|
|
String |
getName(Object o)
Returns the name of a specified entity. |
|
String |
getPath(Object o)
Returns the path of a specified entity. |
|
Status |
getStatus(Object o)
Returns the status of a specified entity. |
|
|
insert(Class<O> clazz,
String name)
Creates a persistent instance of the specified object. |
|
|
insert(Object parent,
Class<O> clazz,
String name)
Creates a persistent instance of the specified object. |
|
String |
persist(Object o)
Persists a transient object relative to the root node. |
|
String |
persist(Object parent,
Object child)
Persists a transient object. |
|
String |
persist(Object parent,
Object o,
String name)
Persists a transient object. |
|
String |
persist(Object o,
String name)
Persists a transient object. |
|
void |
remove(Object o)
Removes a specified entity. |
|
void |
save()
|
|
|
setEmbedded(Object o,
Class<E> embeddedType,
E embedded)
Attach the specified embedded object on the specified object when the embedded argument. |
|
| Method Detail |
|---|
<O> O create(Class<O> clazz)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
clazz - the object class
NullPointerException - if the specified clazz is null
IllegalArgumentException - if the specified class is not a chromattic class
ChromatticException - any chromattic exception
<O> O create(Class<O> clazz,
String name)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
O - the object class parameterclazz - the object classname - the node name
NullPointerException - if the clazz argument is null
IllegalArgumentException - if the name format is not valid or the class is not a chromattic class
ChromatticException - any chromattic exception
<O> O insert(Class<O> clazz,
String name)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
O - the object class parameterclazz - the object classname - the name under root node
NullPointerException - if any argument is null
IllegalArgumentException - if the name is not valid or the class is not a chromattic class
ChromatticException - any chromattic exception
<O> O insert(Object parent,
Class<O> clazz,
String name)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
O - the object class parameterparent - the parent objectclazz - the object classname - the object name
NullPointerException - if any argument is null
IllegalArgumentException - if the name is not valid or the class is not a chromattic class or the parent is
not a persistent object
ChromatticException - any chromattic exception
String persist(Object o,
String name)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the object to persistname - the object relative path to the root
NullPointerException - if any argument is null
IllegalArgumentException - if the name is not valid or the object is not a chromattic transient object
ChromatticException - any chromattic exception
String persist(Object parent,
Object child)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
parent - the parent objectchild - the object to persist
NullPointerException - if any argument is not valid
IllegalArgumentException - if the parent is not a persistent object or the object is not a chromattic transient object
ChromatticException - any chromattic exception
String persist(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the object to persist
NullPointerException - if any argument is not valid
IllegalArgumentException - if the object is not a chromattic transient object
ChromatticException - any chromattic exception
String persist(Object parent,
Object o,
String name)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
parent - the parent objecto - the object to persistname - the object relative name to the parent
NullPointerException - if the parent or object argument is null
IllegalArgumentException - if the parent is not a persistent object or the name is not valid or the object
is not a chromattic transient object
ChromatticException - any chromattic exception
<O> O findByPath(Object origin,
Class<O> clazz,
String relPath)
throws NullPointerException,
IllegalArgumentException,
ClassCastException,
ChromatticException
O - the object typeorigin - the origin objectclazz - the expected classrelPath - the path relative to the origin
NullPointerException - if any argument is null
IllegalArgumentException - if the origin object is not a chromattic object
ClassCastException - if the object cannot be cast to the specified class
ChromatticException - any chromattic exception
<O> O findByPath(Class<O> clazz,
String relPath)
throws NullPointerException,
ClassCastException,
ChromatticException
O - the object typeclazz - the expected classrelPath - the path relative to the chromattic root
NullPointerException - if any argument is null
ClassCastException - if the object cannot be cast to the specified class
ChromatticException - any chromattic exception
<O> O findByNode(Class<O> clazz,
javax.jcr.Node node)
throws NullPointerException,
ClassCastException,
ChromatticException
O - the object typeclazz - the expected classnode - the node
NullPointerException - if any argument is null
ClassCastException - if the mapped object cannot be cast to the specified class
ChromatticException - any chromattic exception
<O> O findById(Class<O> clazz,
String id)
throws NullPointerException,
ClassCastException,
ChromatticException
O - the object typeclazz - the expected classid - the id
NullPointerException - if any argument is null
ClassCastException - if the mapped object cannot be cast to the specified class
ChromatticException - any chromattic exception
<O> QueryBuilder<O> createQueryBuilder(Class<O> fromClass)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
O - the object type parameterfromClass - the node type of the from clause
NullPointerException - if the argument is null
IllegalArgumentException - if the from class cannot be mapped to a node type
ChromatticException - any chromattic exception
void remove(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the entity to remove
ChromatticException - any chromattic exception
NullPointerException - if the specified object is null
IllegalArgumentException - if the specified object is not a chromattic object
Status getStatus(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the entity to get the status
ChromatticException - any chromattic exception
NullPointerException - if the specified object is null
IllegalArgumentException - if the specified object is not a chromattic object
String getId(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the entity to get the id
ChromatticException - any chromattic exception
NullPointerException - if the specified object is null
IllegalArgumentException - if the specified object is not a chromattic object
String getName(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the entity to get the name
ChromatticException - any chromattic exception
NullPointerException - if the specified object is null
IllegalArgumentException - if the specified object is not a chromattic object
String getPath(Object o)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
o - the entity to get the path
ChromatticException - any chromattic exception
NullPointerException - if the specified object is null
IllegalArgumentException - if the specified object is not a chromattic object
<E> E getEmbedded(Object o,
Class<E> embeddedType)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
E - the embedded typeo - the object to get the embedded fromembeddedType - the embedded type class
NullPointerException - if any argument is null
IllegalArgumentException - if the specified object is not a chromattic object
ChromatticException - any chromattic exception
<E> void setEmbedded(Object o,
Class<E> embeddedType,
E embedded)
throws NullPointerException,
IllegalArgumentException,
ChromatticException
E - the embedded typeo - the objectembeddedType - the embedded type classembedded - the embedded
NullPointerException - if any argument is null
IllegalArgumentException - if the object or the embedded are not chromattic objects
ChromatticException - any chromattic exceptionvoid addEventListener(EventListener listener)
void save()
throws ChromatticException
ChromatticExceptionvoid close()
javax.jcr.Session getJCRSession()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||