public interface GenericDao extends GenericDao
Modifier and Type | Method and Description |
---|---|
void |
attachObject(Object obj)
If the underlying ORM supports object caching, this method makes sure this object is cached and associated with
the current session.
|
void |
clearObjectCache()
If the underlying ORM supports object caching, this method clears that cache, forcing any future object retrieval
to come fresh from the database.
|
int |
count(Class<? extends DomainObjectBase> cls,
Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions)
Counts the number of results, given the restrictions, in an efficient manner.
|
void |
detatchObject(Object obj)
If the underlying ORM supports object caching, this method makes sure this object isn't cached, and therefore
isn't returned by any service methods without retrieving from the database fresh.
|
String |
doNotFlushTemporarily()
Sets up the current session to never flush unless explicitly asked via
flush() . |
void |
doWork(org.hibernate.jdbc.Work work) |
void |
flush()
Makes sure that any pending changes or commands to be applied to the database are run or executed.
|
<T extends DomainObjectBase> |
getAllObjects(Class<T> cls)
Gets the entire list of objects of the given class
|
<T extends DomainObjectBase> |
getObject(Class<T> cls,
Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions) |
List<DomainObjectBase> |
getObjectListByScopeRef(Integer scope,
List<Integer> refIds) |
<T extends DomainObjectBase> |
getObjects(Class<T> cls,
Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions)
Gets all the objects of the given type/class that match the given reastrictions
|
<T extends DomainObjectBase> |
getObjects(Class<T> cls,
Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions,
Integer firstResult,
Integer maxResults,
SorterInfo sortInfo)
Gets a
List of objects of type T. |
<T extends ScopedObject> |
getScopedObjects(Class<T> cls,
Integer scopeId,
Integer refId) |
void |
initialize(Object proxy)
Force initialization of a proxy object.
|
void |
makeReadOnly(Object obj,
boolean readonly)
If readOnly is true, makes the object read only from the view of the underlying ORM.
|
Object |
mergeObject(Object obj) |
<T extends DomainObjectBase> |
objectExists(Class<T> cls,
Serializable id)
Returns whether or not an object exists.
|
void |
quickFlush()
Performs a quick session flush to persist items in database.
|
void |
resumeNormalFlushOperation(String flushMode)
Expected parameter is that which is returned from
doNotFlushTemporarily() . |
void |
saveOrUpdateObject(Object object) |
void |
updateObjectRefForScope(Integer scope,
Integer oldRefId,
Integer newRefId,
boolean flush)
Performs an update for all scope/ref combinations pointing to the oldRefId to point
to the newRefId
|
deleteAll, getIdsOfReferencesToScope, getObject, getObjectByScopeRef, getObjectsByIds, remove
void quickFlush()
flush()
because it does not flush to
indexes.void flush()
String doNotFlushTemporarily()
flush()
.resumeNormalFlushOperation(String)
when done with manual flush modevoid resumeNormalFlushOperation(String flushMode)
doNotFlushTemporarily()
. This will revert the current
session back to the flush mode that was set before that call was made.flushMode
- The flush mode returned from doNotFlushTemporarily()
void detatchObject(Object obj)
obj
- The object that should not be cached.void attachObject(Object obj)
obj
- The object that should be associated with the current sessionvoid makeReadOnly(Object obj, boolean readonly)
obj
- An object to make read only or notreadonly
- Whether the object should be readonly or notvoid clearObjectCache()
int count(Class<? extends DomainObjectBase> cls, Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions)
getObjects(Class, java.util.Collection, Integer, Integer, SorterInfo)
when paging information isn't applied, with the same
class and collection of restrictions.cls
- The mapping class that the restrictions apply torestrictions
- The collection of Restriction
s, or nullgetObjects(Class, java.util.Collection, Integer, Integer, SorterInfo)
<T extends DomainObjectBase> T getObject(Class<T> cls, Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions)
<T extends ScopedObject> List<T> getScopedObjects(Class<T> cls, Integer scopeId, Integer refId)
List<DomainObjectBase> getObjectListByScopeRef(Integer scope, List<Integer> refIds)
void updateObjectRefForScope(Integer scope, Integer oldRefId, Integer newRefId, boolean flush)
scope
- A scopeoldRefId
- A refId to update fromnewRefId
- A refId to update toflush
- Whether to flush after update statements are performed. This is recommended, as the
update statements don't bring objects in memory, so one could get stale data if later querying
for data that these updates affected.<T extends DomainObjectBase> boolean objectExists(Class<T> cls, Serializable id)
T
- The type of the objectcls
- The class of persisted objectid
- The id<T extends DomainObjectBase> List<? extends T> getObjects(Class<T> cls, Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions, Integer firstResult, Integer maxResults, SorterInfo sortInfo)
List
of objects of type T.T
- The type of objects being returnedcls
- The mapping class for the object typerestrictions
- The collection of Restriction
s, or nullfirstResult
- The index of the first result to return (null returns beginning of list)maxResults
- The maximum number of results to return (null for all results)sortInfo
- The sorting information, if applicable<T extends DomainObjectBase> List<? extends T> getAllObjects(Class<T> cls)
T
- The type of objectscls
- The mapping class<T extends DomainObjectBase> List<? extends T> getObjects(Class<T> cls, Collection<com.jamasoftware.contour.data.service.restriction.Restriction> restrictions)
T
- The typecls
- The mapping classrestrictions
- The restrictions to applyvoid saveOrUpdateObject(Object object)
void doWork(org.hibernate.jdbc.Work work)
void initialize(Object proxy)
proxy
- Copyright (c) 2013-2014 Jama Software, Inc. All Rights Reserved.