|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.api.db.hibernate.HibernateSerializedObjectDAO
public class HibernateSerializedObjectDAO
Hibernate specific database access methods for serialized objects
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
|
| Method Summary | ||
|---|---|---|
|
convertSerializedObject(java.lang.Class<T> clazz,
SerializedObject serializedObject)
Converts a raw SerializedObject to an OpenmrsObject, using the appropriate Serializer |
|
|
getAllObjects(java.lang.Class<T> type)
Retrieves all non-retired objects of the passed type from the database that have been saved through serialization |
|
|
getAllObjects(java.lang.Class<T> type,
boolean includeRetired)
Retrieves all objects from the database that match the passed type that have been saved through serialization Returns voided / retired Objects only if includeRetired parameter is true |
|
|
getAllObjectsByName(java.lang.Class<T> type,
java.lang.String name,
boolean exactMatchOnly)
Retrieves all objects from the database that match the passed type and name that have been saved through serialization |
|
java.util.List<SerializedObject> |
getAllSerializedObjects(java.lang.Class<?> type,
boolean includeRetired)
Retrieves all raw Serialized Object from the database that match the passed type and includeRetired flag |
|
java.util.List<SerializedObject> |
getAllSerializedObjectsByName(java.lang.Class<?> type,
java.lang.String name,
boolean exactMatchOnly)
Retrieves all raw Serialized Objects from the database that match the passed type and name |
|
static HibernateSerializedObjectDAO |
getInstance()
Singleton Factory method |
|
|
getObject(java.lang.Class<T> baseClass,
java.lang.Integer id)
Retrieves the saved object of the passed type from the database by it's id |
|
|
getObjectByUuid(java.lang.Class<T> baseClass,
java.lang.String uuid)
Retrieves the saved object of the passed type from the database by it's uuid |
|
java.lang.Class<? extends OpenmrsObject> |
getRegisteredTypeForObject(OpenmrsObject object)
Returns the registered class for the passed object, or null if none found For example, if the supportedTypes property contains the CohortDefinition.class interface, and a particular implementation of that interface is passed in, then this method would return CohortDefinition.class. |
|
SerializedObject |
getSerializedObject(java.lang.Integer id)
Retrieves the raw SerializedObject from the database by id |
|
SerializedObject |
getSerializedObjectByUuid(java.lang.String uuid)
Retrieves the raw Serialized Object from the database by uuid |
|
java.util.List<java.lang.Class<? extends OpenmrsObject>> |
getSupportedTypes()
|
|
void |
purgeObject(java.lang.Integer id)
Deletes the item from the database with the given primary key id |
|
void |
registerSupportedType(java.lang.Class<? extends OpenmrsObject> clazz)
Registers a class as one that should be supported |
|
|
saveObject(T object)
Saves an object to the database in serialized form |
|
|
saveObject(T object,
OpenmrsSerializer serializer)
Saves an object to the database, in serialized form, using the specified OpenmrsSerializer |
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory |
|
void |
setSupportedTypes(java.util.List<java.lang.Class<? extends OpenmrsObject>> supportedTypes)
|
|
void |
unregisterSupportedType(java.lang.Class<? extends OpenmrsObject> clazz)
Removes this class as one that should be supported |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
| Method Detail |
|---|
public static HibernateSerializedObjectDAO getInstance()
public SerializedObject getSerializedObject(java.lang.Integer id)
throws DAOException
SerializedObjectDAO
getSerializedObject in interface SerializedObjectDAOid - the id to lookup
DAOExceptionSerializedObjectDAO.getSerializedObject(Integer)
public <T extends OpenmrsObject> T getObject(java.lang.Class<T> baseClass,
java.lang.Integer id)
throws DAOException
SerializedObjectDAO
getObject in interface SerializedObjectDAObaseClass - The class of the object to retrieveid - The primary key id of the object to retrieve
DAOExceptionSerializedObjectDAO.getObject(Class, Integer)
public SerializedObject getSerializedObjectByUuid(java.lang.String uuid)
throws DAOException
SerializedObjectDAO
getSerializedObjectByUuid in interface SerializedObjectDAOuuid - The UUID of the object to retrieve
DAOExceptionSerializedObjectDAO.getSerializedObjectByUuid(String)
public <T extends OpenmrsObject> T getObjectByUuid(java.lang.Class<T> baseClass,
java.lang.String uuid)
throws DAOException
SerializedObjectDAO
getObjectByUuid in interface SerializedObjectDAObaseClass - The class of the object to retrieveuuid - The UUID of the object to retrieve
DAOExceptionSerializedObjectDAO.getObjectByUuid(Class, String)
public java.util.List<SerializedObject> getAllSerializedObjectsByName(java.lang.Class<?> type,
java.lang.String name,
boolean exactMatchOnly)
throws DAOException
SerializedObjectDAO
getAllSerializedObjectsByName in interface SerializedObjectDAOtype - The class of the object to retrievename - the name of the item to retrieveexactMatchOnly - if true will only return exact matches
DAOExceptionSerializedObjectDAO#getAllObjectsByName(Class, String)
public <T extends OpenmrsMetadata> java.util.List<T> getAllObjectsByName(java.lang.Class<T> type,
java.lang.String name,
boolean exactMatchOnly)
throws DAOException
SerializedObjectDAO
getAllObjectsByName in interface SerializedObjectDAOtype - The class of the object to retrievename - the name of the item to retrieveexactMatchOnly - if true will only return exact matches
DAOExceptionSerializedObjectDAO#getAllObjectsByName(Class, String)
public java.util.List<SerializedObject> getAllSerializedObjects(java.lang.Class<?> type,
boolean includeRetired)
throws DAOException
SerializedObjectDAO
getAllSerializedObjects in interface SerializedObjectDAOtype - The class of the object to retrieveincludeRetired - if true includes retired/voided objects, otherwise does not
DAOExceptionSerializedObjectDAO.getAllObjects(Class, boolean)
public <T extends OpenmrsObject> java.util.List<T> getAllObjects(java.lang.Class<T> type,
boolean includeRetired)
throws DAOException
SerializedObjectDAO
getAllObjects in interface SerializedObjectDAOtype - The class of the object to retrieveincludeRetired - includeRetired If true, returns voided/retired objects as well
DAOExceptionSerializedObjectDAO.getAllObjects(Class, boolean)
public <T extends OpenmrsObject> java.util.List<T> getAllObjects(java.lang.Class<T> type)
throws DAOException
SerializedObjectDAO
getAllObjects in interface SerializedObjectDAOtype - The class of the object to retrieve
DAOExceptionSerializedObjectDAO.getAllObjects(Class)
public <T extends OpenmrsObject> T saveObject(T object)
throws DAOException
SerializedObjectDAO
saveObject in interface SerializedObjectDAOobject - The object to save
DAOExceptionSerializedObjectDAO.saveObject(OpenmrsObject)
public <T extends OpenmrsObject> T saveObject(T object,
OpenmrsSerializer serializer)
throws DAOException
SerializedObjectDAOOpenmrsSerializer
saveObject in interface SerializedObjectDAOobject - The object to saveserializer - The OpenmrsSerializer to use
DAOExceptionSerializedObjectDAO.saveObject(OpenmrsObject, OpenmrsSerializer)
public void purgeObject(java.lang.Integer id)
throws DAOException
SerializedObjectDAO
purgeObject in interface SerializedObjectDAOid - The id of the item to delete from the database
DAOExceptionSerializedObjectDAO.purgeObject(Integer)
public void registerSupportedType(java.lang.Class<? extends OpenmrsObject> clazz)
throws DAOException
SerializedObjectDAO
registerSupportedType in interface SerializedObjectDAOclazz - The class to register
DAOExceptionSerializedObjectDAO.registerSupportedType(Class)
public void unregisterSupportedType(java.lang.Class<? extends OpenmrsObject> clazz)
throws DAOException
SerializedObjectDAO
unregisterSupportedType in interface SerializedObjectDAOclazz - The class to un-register
DAOExceptionSerializedObjectDAO.unregisterSupportedType(Class)public java.lang.Class<? extends OpenmrsObject> getRegisteredTypeForObject(OpenmrsObject object)
SerializedObjectDAO
getRegisteredTypeForObject in interface SerializedObjectDAOobject - The object to check for the registered type
SerializedObjectDAO.getRegisteredTypeForObject(OpenmrsObject)
public <T extends OpenmrsObject> T convertSerializedObject(java.lang.Class<T> clazz,
SerializedObject serializedObject)
throws DAOException
SerializedObjectDAO
convertSerializedObject in interface SerializedObjectDAOclazz - the OpenmrsObject class to retrieveserializedObject - the raw SerializedObject to deserialize into an OpenmrsObject
DAOExceptionSerializedObjectDAO.convertSerializedObject(Class, SerializedObject)public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - public java.util.List<java.lang.Class<? extends OpenmrsObject>> getSupportedTypes()
getSupportedTypes in interface SerializedObjectDAOpublic void setSupportedTypes(java.util.List<java.lang.Class<? extends OpenmrsObject>> supportedTypes)
supportedTypes - the supportedTypes to set
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||