|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.archiviststoolkit.mydomain.DomainAccessObjectImpl
public class DomainAccessObjectImpl
Default implementation of a DomainAccessObject specific to hibernate version 2.
Constructor Summary | |
---|---|
DomainAccessObjectImpl(java.lang.Class clazz)
Constructor which builds a DAO for this class. |
Method Summary | |
---|---|
void |
add(DomainObject domainObject)
Add an instance to this DAO. |
void |
addGroup(java.util.Collection collection,
java.awt.Component parent)
Add a group of instances. |
void |
addListener(DomainAccessListener listener)
Add a listener for this DAO. |
void |
closeLongSession()
|
void |
closeLongSessionRollback()
|
void |
delete(DomainObject domainObject)
Delete this object from the data store. |
void |
deleteById(java.lang.Long identifier)
Delete this object from the data store. |
void |
deleteGroup(java.util.Collection collection)
Delete these objects from the data store. |
void |
deleteLongSession(DomainObject domainObject)
|
void |
deleteLongSession(DomainObject domainObject,
boolean closeSession)
|
void |
domainChanged(DomainAccessEvent event)
Called to notify the listener that an event has occurred. |
java.util.Collection |
findAll(org.hibernate.LockMode lockmode,
java.lang.String... sortFields)
Get a collection of all objects under the control of this domain access object. |
java.util.Collection |
findAll(java.lang.String... sortFields)
Return a collection with everything in this DAO. |
java.util.Collection |
findAllLongSession(java.lang.Boolean alwaysApplyFilters,
java.lang.String... sortFields)
|
java.util.Collection |
findAllLongSession(java.lang.String... sortFields)
Get a collection of all objects under the control of this domain access object. |
java.util.Collection |
findByExample(java.lang.Object instance)
Find a collection of domain objects by example. |
java.util.Collection |
findByNamedQuery(java.lang.String queryName)
Return a collection which conforms to the named query. |
java.util.Collection |
findByNamedQuery(java.lang.String queryName,
java.lang.Object propertyObject)
Return a collection which conforms to the named query. |
DomainObject |
findByPrimaryKey(java.lang.Long identifier)
Find an instance by its identifier. |
DomainObject |
findByPrimaryKeyLongSession(java.lang.Long identifier)
Find an instance by its identifier. |
DomainObject |
findByPrimaryKeyLongSessionForPrinting(java.lang.Long identifier)
Find an instance by its identifier. |
java.util.Collection |
findByPropertyValue(java.lang.String propertyName,
java.lang.Object value)
Find instances through a named query without parameters. |
java.util.Collection |
findByPropertyValues(java.lang.String propertyName,
java.lang.Object[] values)
Find instances through a named query without parameters. |
java.util.Collection |
findByPropertyValuesLongSession(java.lang.String propertyName,
java.lang.Object[] values)
Find instances through a named query without parameters. |
java.util.Collection |
findByQuery(java.lang.String queryString)
Find a collection of domain objects by direct hql query. |
java.util.Collection |
findByQueryEditor(QueryEditor editor,
InfiniteProgressPanel progressPanel)
Find a collection of domain objects by direct hql query. |
java.util.Collection |
findByQueryEditorLongSession(QueryEditor editor,
InfiniteProgressPanel progressPanel)
Method to search by query editory using long session |
DomainObject |
findByUniquePropertyValue(java.lang.String propertyName,
java.lang.Object value)
Find instances through a named query without parameters. |
DomainObject |
findByUniquePropertyValueLongSession(java.lang.String propertyName,
java.lang.Object value)
Find instances through a named query without parameters. |
java.lang.Integer |
getCountBasedOnPropertyValue(java.lang.String propertyName,
java.lang.Object value)
|
java.lang.String |
getHumanReadableSearchString()
|
org.hibernate.Session |
getLongSession()
|
protected java.lang.Class |
getPersistentClass()
|
int |
merge(java.util.Collection<DomainObject> mergeFrom,
DomainObject mergeTo,
InfiniteProgressPanel progressPanel)
|
void |
notifyListeners(DomainAccessEvent event)
Notify all the listeners of an event. |
void |
removeListener(DomainAccessListener listener)
Remove a listener from this DAO. |
void |
setHumanReadableSearchString(java.lang.String humanReadableSearchString)
|
void |
update(DomainObject domainObject)
Update the instance within this DAO. |
void |
updateLongSession(DomainObject domainObject)
Update the instance within this DAO. |
void |
updateLongSession(DomainObject domainObject,
boolean closeSession)
Update the instance within this DAO. |
int |
updateTextField(java.lang.String propertyName,
java.lang.String oldValue,
java.lang.String newValue,
InfiniteProgressPanel progressPanel)
Find instances through a named query without parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomainAccessObjectImpl(java.lang.Class clazz)
clazz
- the class to build toMethod Detail |
---|
public final void addListener(DomainAccessListener listener)
addListener
in interface DomainAccessObject
listener
- the listener to addpublic final void removeListener(DomainAccessListener listener)
removeListener
in interface DomainAccessObject
listener
- the listener to removepublic final void notifyListeners(DomainAccessEvent event)
event
- the event which should be sent to all listenerspublic final void add(DomainObject domainObject) throws PersistenceException
add
in interface DomainAccessObject
domainObject
- the object to add
PersistenceException
- fails if we cannot persist the instancepublic final void addGroup(java.util.Collection collection, java.awt.Component parent) throws PersistenceException
addGroup
in interface DomainAccessObject
collection
- the objects to add
PersistenceException
- fails if we cannot persist the instancepublic final void update(DomainObject domainObject) throws PersistenceException
update
in interface DomainAccessObject
domainObject
- the instance to update
PersistenceException
- fails if we cannot update the instancepublic final void updateLongSession(DomainObject domainObject) throws PersistenceException
updateLongSession
in interface DomainAccessObject
domainObject
- the instance to update
PersistenceException
- fails if we cannot update the instancepublic final void updateLongSession(DomainObject domainObject, boolean closeSession) throws PersistenceException
updateLongSession
in interface DomainAccessObject
domainObject
- the instance to update
PersistenceException
- fails if we cannot update the instancepublic void deleteGroup(java.util.Collection collection) throws PersistenceException
deleteGroup
in interface DomainAccessObject
collection
- the object to delete
PersistenceException
- fails if we cannot delete the instancepublic void delete(DomainObject domainObject) throws DeleteException
delete
in interface DomainAccessObject
domainObject
- the object to delete
DeleteException
- fails if we cannot delete the instancepublic final void deleteLongSession(DomainObject domainObject) throws DeleteException
deleteLongSession
in interface DomainAccessObject
DeleteException
public final void deleteLongSession(DomainObject domainObject, boolean closeSession) throws DeleteException
deleteLongSession
in interface DomainAccessObject
DeleteException
public final void deleteById(java.lang.Long identifier) throws DeleteException
identifier
- the id of the object to delete
DeleteException
- fails if we cannot delete the instancepublic final DomainObject findByPrimaryKey(java.lang.Long identifier) throws LookupException
findByPrimaryKey
in interface DomainAccessObject
identifier
- the identifier we are looking for
LookupException
- fails if we cannot execute the lookuppublic final DomainObject findByPrimaryKeyLongSession(java.lang.Long identifier) throws LookupException
findByPrimaryKeyLongSession
in interface DomainAccessObject
identifier
- the identifier we are looking for
LookupException
- fails if we cannot execute the lookuppublic final DomainObject findByPrimaryKeyLongSessionForPrinting(java.lang.Long identifier) throws LookupException
findByPrimaryKeyLongSessionForPrinting
in interface DomainAccessObject
identifier
- the identifier we are looking for
LookupException
- fails if we cannot execute the lookuppublic void closeLongSession() throws java.sql.SQLException
closeLongSession
in interface DomainAccessObject
java.sql.SQLException
public void closeLongSessionRollback() throws java.sql.SQLException
closeLongSessionRollback
in interface DomainAccessObject
java.sql.SQLException
public org.hibernate.Session getLongSession()
getLongSession
in interface DomainAccessObject
public java.util.Collection findAll(java.lang.String... sortFields) throws LookupException
findAll
in interface DomainAccessObject
LookupException
- fails if we cannot execute the lookuppublic java.util.Collection findAll(org.hibernate.LockMode lockmode, java.lang.String... sortFields) throws LookupException
DomainAccessObject
findAll
in interface DomainAccessObject
LookupException
- if we failed to execute the lookuppublic java.util.Collection findAllLongSession(java.lang.String... sortFields) throws LookupException
DomainAccessObject
findAllLongSession
in interface DomainAccessObject
LookupException
- if we failed to execute the lookuppublic java.util.Collection findAllLongSession(java.lang.Boolean alwaysApplyFilters, java.lang.String... sortFields) throws LookupException
findAllLongSession
in interface DomainAccessObject
LookupException
public final java.util.Collection findByQuery(java.lang.String queryString) throws LookupException
findByQuery
in interface DomainAccessObject
queryString
- the hql statement
LookupException
- if we failed to find the objects.public final java.util.Collection findByQueryEditorLongSession(QueryEditor editor, InfiniteProgressPanel progressPanel)
findByQueryEditorLongSession
in interface DomainAccessObject
editor
- The quesry editorprogressPanel
- The progress panel
public final java.util.Collection findByQueryEditor(QueryEditor editor, InfiniteProgressPanel progressPanel)
findByQueryEditor
in interface DomainAccessObject
editor
- an AT query editor
public final java.util.Collection findByExample(java.lang.Object instance) throws LookupException
findByExample
in interface DomainAccessObject
instance
- the example object
LookupException
- if we failed to find the objects.public java.util.Collection findByPropertyValue(java.lang.String propertyName, java.lang.Object value) throws LookupException
findByPropertyValue
in interface DomainAccessObject
propertyName
- the name of the propertyvalue
- the value of the property
LookupException
- if we failed to execute the querypublic java.util.Collection findByPropertyValues(java.lang.String propertyName, java.lang.Object[] values) throws LookupException
findByPropertyValues
in interface DomainAccessObject
propertyName
- the name of the propertyvalues
- the value of the property
LookupException
- if we failed to execute the querypublic java.util.Collection findByPropertyValuesLongSession(java.lang.String propertyName, java.lang.Object[] values) throws LookupException
findByPropertyValuesLongSession
in interface DomainAccessObject
propertyName
- the name of the propertyvalues
- the value of the property
LookupException
- if we failed to execute the querypublic DomainObject findByUniquePropertyValue(java.lang.String propertyName, java.lang.Object value) throws LookupException
findByUniquePropertyValue
in interface DomainAccessObject
propertyName
- the name of the propertyvalue
- the value of the property
LookupException
- if we failed to execute the querypublic DomainObject findByUniquePropertyValueLongSession(java.lang.String propertyName, java.lang.Object value) throws LookupException
findByUniquePropertyValueLongSession
in interface DomainAccessObject
propertyName
- the name of the propertyvalue
- the value of the property
LookupException
- if we failed to execute the querypublic int updateTextField(java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue, InfiniteProgressPanel progressPanel) throws LookupException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, ValidationException
updateTextField
in interface DomainAccessObject
propertyName
- the name of the propertyoldValue
- the old value of the propertynewValue
- the new value of the property
LookupException
- if we failed to execute the query
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
ValidationException
public java.lang.Integer getCountBasedOnPropertyValue(java.lang.String propertyName, java.lang.Object value)
getCountBasedOnPropertyValue
in interface DomainAccessObject
public int merge(java.util.Collection<DomainObject> mergeFrom, DomainObject mergeTo, InfiniteProgressPanel progressPanel) throws MergeException
merge
in interface DomainAccessObject
MergeException
public final java.util.Collection findByNamedQuery(java.lang.String queryName, java.lang.Object propertyObject) throws LookupException
findByNamedQuery
in interface DomainAccessObject
queryName
- the name of the querypropertyObject
- the bean which is used to pass properties to the query
LookupException
- fails if we cannot execute the named querypublic final java.util.Collection findByNamedQuery(java.lang.String queryName) throws LookupException
findByNamedQuery
in interface DomainAccessObject
queryName
- the name of the query
LookupException
- fails if we cannot execute the querypublic final void domainChanged(DomainAccessEvent event)
domainChanged
in interface DomainAccessListener
event
- denotes that a domainobject has changed.protected java.lang.Class getPersistentClass()
public java.lang.String getHumanReadableSearchString()
getHumanReadableSearchString
in interface DomainAccessObject
public void setHumanReadableSearchString(java.lang.String humanReadableSearchString)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |