|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DIOEntityManager
DIOEntityManager manages the lifecycle of all DigitalObjects. All DigitalObject
types are injected with reference to entityManager an implementation of
DIOEntityManager.
DIOEntityManager is similar to javax.persistence.EntityManager, except that this is
designed to handle persistence for entities of DigitalObject kind.
An EntityManager instance is associated with a persistence context. A persistence context is a set of entity
instances in which for any persistent entity identity there is a unique entity instance.
| Method Summary | |
|---|---|
void |
beginTx()
|
void |
clear()
|
void |
close()
|
void |
commitTx()
|
Query |
createNamedQuery(String qlString)
em.createQuery(Photo.class,"SELECT c FROM Photo c WHERE c.name LIKE :photoName").setParameter("photoName", name) .getResultList(); Named parameters are parameters in a query that are prefixed with a colon (:). |
Query |
createNativeQuery(String queryNative)
|
Query |
createNativeQuery(String queryNative,
Class resultClass)
|
Query |
createQuery(String queryInEJBQL)
|
Object |
find(Class entityClass,
Object primaryKey)
Find an entity by primary key. |
Page |
findAllDigitalObjectsHavingTags(int maximumResultSetSize,
int pageNumber,
int totalTags,
String applicationId,
LocalUser owner,
String[] tags)
Returns the page Object with all matching digitalobects. |
List |
findAllDioCollections(String applicationId,
int maxResults)
|
List |
findAllDioCollections(String applicationId,
LocalUser owner,
int maxResults)
|
List |
findBuddiesByDigitalObject(DigitalObject digitalObject,
LocalUser localUser)
gets List of buddies who got the digital Object shared to |
DigitalObject |
findById(Object primaryKey)
Find by primary key. |
List |
findByName(String name,
Class dioClazz)
|
List |
findByProperty(Class entityClass,
String propertyName,
String propertyValue)
Find specific digitalObjects with specified property name-value combination |
List |
findByProperty(Class entityClass,
String propertyName,
String propertyValue,
DigitalObjectFilter filter)
Find specific digitalObjects with specified property name-value combination and whose owner is the passed in parameter owner or null. |
List |
findByProperty(String propertyName,
String propertyValue)
Find all digitalObjects that are tagged with given property name and value. |
Set |
findByTag(String tagName,
String applicationId)
|
Set |
findByTag(String tag,
String applicationId,
LocalUser owner)
|
List |
findDigitalObjectsAddedBetweenTwoDates(Class dioExtendingClass,
Date begin,
Date end)
|
LocalUser |
findLocalUserByName(String localuserName)
|
void |
flush()
|
Object |
getReference(Class entityClass,
Object primaryKey)
|
boolean |
isActive()
|
boolean |
isOpen()
|
void |
merge(Object entity)
|
Page |
paginate(Query queryToPaginate,
int totalResultCount,
int index,
int pageSize,
Map mapOfParameterObject,
Class cls)
|
Page |
paginate(Query getObjectsQuery,
Query countQuery,
int startIndex,
int pageSize,
Map mapOfParameterObject,
Class dioClass)
Gets the Page Page with the given criteria countQuery is executed when the totalDios supplied is 0. |
void |
persist(Object entity)
Makes a DigitalObject instance mangaged and persistent. |
void |
refresh(Object entity)
Refreshes the state of the instance from the database, overwriting changes made to the entity, if any. |
void |
remove(Object digitalObject)
Removes the DigitalObject from database. |
void |
rollbackTx()
|
| Method Detail |
|---|
void persist(Object entity)
entity - void merge(Object entity)
void refresh(Object entity)
entity - void remove(Object digitalObject)
DigitalObject from database.
digitalObject -
Object find(Class entityClass,
Object primaryKey)
entityClass - primaryKey -
Object getReference(Class entityClass,
Object primaryKey)
DigitalObject findById(Object primaryKey)
primaryKey -
digitalObjectClass
List findByName(String name,
Class dioClazz)
List findAllDioCollections(String applicationId,
int maxResults)
applicationId - this is httpServletRequest.getContextPath() for web applications.maxResults -
List findAllDioCollections(String applicationId,
LocalUser owner,
int maxResults)
applicationId - this is httpServletRequest.getContextPath() for web applications.owner - owner of the digital objectmaxResults -
LocalUser findLocalUserByName(String localuserName)
Page findAllDigitalObjectsHavingTags(int maximumResultSetSize,
int pageNumber,
int totalTags,
String applicationId,
LocalUser owner,
String[] tags)
maximumResultSetSize - - maximum result-set "-1" indicates allpageNumber - - get the parameters from indextotalTags - - total number of tagsapplicationId - owner - tags - - array of tags to search on @return - List of matching digitalObjects @return
pageObject with the given parameters @return Page Page
List findBuddiesByDigitalObject(DigitalObject digitalObject,
LocalUser localUser)
digitalObject - - DigitalObjectlocalUser -
Page paginate(Query getObjectsQuery,
Query countQuery,
int startIndex,
int pageSize,
Map mapOfParameterObject,
Class dioClass)
Page with the given criteria
getObjectsQuery - - the query to be executed to get the list of entitiescountQuery - - the query to get the total countstartIndex - - index from where the results should start (starts from 0)pageSize - - number of entities to include in a pagemapOfParameterObject - - the object to be used with querydioClass - - class of DigitalObject
Page
IllegalStateException - getObjectQuery.getResultList throws
if called for a Java Persistence query language UPDATE or DELETE statement
PersistenceException - propagate the exception thrown when executing countQuery
Page paginate(Query queryToPaginate,
int totalResultCount,
int index,
int pageSize,
Map mapOfParameterObject,
Class cls)
Set findByTag(String tagName,
String applicationId)
Set findByTag(String tag,
String applicationId,
LocalUser owner)
List findByProperty(String propertyName,
String propertyValue)
propertyName - propertyValue -
List findByProperty(Class entityClass,
String propertyName,
String propertyValue)
entityClass - class object that extends DigitalObjectpropertyName - propertyValue -
List findByProperty(Class entityClass,
String propertyName,
String propertyValue,
DigitalObjectFilter filter)
entityClass - class object that extends DigitalObjectpropertyName - propertyValue - filter -
List findDigitalObjectsAddedBetweenTwoDates(Class dioExtendingClass,
Date begin,
Date end)
Query createNamedQuery(String qlString)
IllegalArgumentException - - if query string is not validQuery createQuery(String queryInEJBQL)
Query createNativeQuery(String queryNative)
Query createNativeQuery(String queryNative,
Class resultClass)
void flush()
void clear()
void beginTx()
void commitTx()
void rollbackTx()
boolean isOpen()
boolean isActive()
void close()
|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
© 2009 Pramati Technologies - Dekoh - Portal for Developers