org.archiviststoolkit.mydomain
Interface DomainAccessObject

All Known Implementing Classes:
AccessionsDAO, ArchDescriptionAnalogInstancesDAO, ArchDescriptionRepeatingDataDAO, DatabaseTablesDAO, DigitalObjectDAO, DomainAccessObjectImpl, LookupListsDAO, NamesDAO, RepositoriesDAO, ResourcesComponentsDAO, ResourcesDAO, SubjectsDAO

public interface DomainAccessObject

Implemented by all DomainAccess patterned classes.


Method Summary
 void add(DomainObject obj)
          Add a new instance to this domain access object.
 void addGroup(java.util.Collection collection, java.awt.Component parent)
          Allows the mass deletion of domain objects.
 void addListener(DomainAccessListener listener)
          Add a listener to this domain access object.
 void closeLongSession()
           
 void closeLongSessionRollback()
           
 void delete(DomainObject obj)
          Remove an instance from the control of the domain access object.
 void deleteGroup(java.util.Collection collection)
          How does this differ from delete group.
 void deleteLongSession(DomainObject obj)
           
 void deleteLongSession(DomainObject obj, boolean closeSession)
           
 java.util.Collection findAll(org.hibernate.LockMode lockmode, java.lang.String... sortField)
          Get a collection of all objects under the control of this domain access object.
 java.util.Collection findAll(java.lang.String... sortField)
          Get a collection of all objects under the control of this domain access object.
 java.util.Collection findAllLongSession(java.lang.Boolean alwaysApplyFilters, java.lang.String... sortField)
           
 java.util.Collection findAllLongSession(java.lang.String... sortField)
          Get a collection of all objects under the control of this domain access object.
 java.util.Collection findByExample(java.lang.Object instance)
          Find instances through a named query without parameters.
 java.util.Collection findByNamedQuery(java.lang.String namedQuery)
          Find instances through a named query without parameters.
 java.util.Collection findByNamedQuery(java.lang.String namedQuery, java.lang.Object propertyObject)
          Find instances through a named query with parameters.
 DomainObject findByPrimaryKey(java.lang.Long id)
          Find an object instance by its identifier.
 DomainObject findByPrimaryKeyLongSession(java.lang.Long id)
          Find an object instance by its identifier.
 DomainObject findByPrimaryKeyLongSessionForPrinting(java.lang.Long id)
          Find an object 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 objects by a query string.
 java.util.Collection findByQueryEditor(QueryEditor editor, InfiniteProgressPanel progressPanel)
          Find a collection of objects by a query string.
 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()
           
 int merge(java.util.Collection<DomainObject> mergeFrom, DomainObject mergeTo, InfiniteProgressPanel progressPanel)
           
 void removeListener(DomainAccessListener listener)
          Remove a listener from this domain access object.
 void update(DomainObject obj)
          Update an instance within this domain access object.
 void updateLongSession(DomainObject obj)
          Update an instance within this domain access object.
 void updateLongSession(DomainObject obj, boolean closeSession)
          Update an instance within this domain access object.
 int updateTextField(java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue, InfiniteProgressPanel progressPanel)
          Find instances through a named query without parameters.
 

Method Detail

addListener

void addListener(DomainAccessListener listener)
Add a listener to this domain access object.

Parameters:
listener - the listener to add

removeListener

void removeListener(DomainAccessListener listener)
Remove a listener from this domain access object.

Parameters:
listener - the listener to remove

add

void add(DomainObject obj)
         throws PersistenceException
Add a new instance to this domain access object.

Parameters:
obj - the object to add
Throws:
PersistenceException - we could not persist this object

addGroup

void addGroup(java.util.Collection collection,
              java.awt.Component parent)
              throws PersistenceException
Allows the mass deletion of domain objects.

Parameters:
collection - the collection to delete
Throws:
PersistenceException - we could not persist the changes.

update

void update(DomainObject obj)
            throws PersistenceException
Update an instance within this domain access object.

Parameters:
obj - the object to update
Throws:
PersistenceException - fails if we could not persist the changes

updateLongSession

void updateLongSession(DomainObject obj)
                       throws PersistenceException
Update an instance within this domain access object.

Parameters:
obj - the object to update
Throws:
PersistenceException - fails if we could not persist the changes

updateLongSession

void updateLongSession(DomainObject obj,
                       boolean closeSession)
                       throws PersistenceException
Update an instance within this domain access object.

Parameters:
obj - the object to update
Throws:
PersistenceException - fails if we could not persist the changes

deleteGroup

void deleteGroup(java.util.Collection collection)
                 throws PersistenceException,
                        LookupException
How does this differ from delete group.

Parameters:
collection - the collection to delete.
Throws:
PersistenceException - we could not persist the changes.
LookupException - we could not lookup the reference instances.

delete

void delete(DomainObject obj)
            throws PersistenceException,
                   DeleteException
Remove an instance from the control of the domain access object.

Parameters:
obj - the object to remove
Throws:
PersistenceException - fails if we could not persist the removal
DeleteException

deleteLongSession

void deleteLongSession(DomainObject obj)
                       throws PersistenceException,
                              DeleteException
Throws:
PersistenceException
DeleteException

deleteLongSession

void deleteLongSession(DomainObject obj,
                       boolean closeSession)
                       throws PersistenceException,
                              DeleteException
Throws:
PersistenceException
DeleteException

findByPrimaryKey

DomainObject findByPrimaryKey(java.lang.Long id)
                              throws LookupException
Find an object instance by its identifier.

Parameters:
id - the identifier with which to find it
Returns:
the object
Throws:
LookupException - if we failed to execute the lookup

findByPrimaryKeyLongSession

DomainObject findByPrimaryKeyLongSession(java.lang.Long id)
                                         throws LookupException
Find an object instance by its identifier.

Parameters:
id - the identifier with which to find it
Returns:
the object
Throws:
LookupException - if we failed to execute the lookup

findByPrimaryKeyLongSessionForPrinting

DomainObject findByPrimaryKeyLongSessionForPrinting(java.lang.Long id)
                                                    throws LookupException
Find an object instance by its identifier.

Parameters:
id - the identifier with which to find it
Returns:
the object
Throws:
LookupException - if we failed to execute the lookup

closeLongSession

void closeLongSession()
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

closeLongSessionRollback

void closeLongSessionRollback()
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

getLongSession

org.hibernate.Session getLongSession()

findAll

java.util.Collection findAll(java.lang.String... sortField)
                             throws LookupException
Get a collection of all objects under the control of this domain access object.

Returns:
the collection of all instances
Throws:
LookupException - if we failed to execute the lookup

findAll

java.util.Collection findAll(org.hibernate.LockMode lockmode,
                             java.lang.String... sortField)
                             throws LookupException
Get a collection of all objects under the control of this domain access object.

Returns:
the collection of all instances
Throws:
LookupException - if we failed to execute the lookup

findAllLongSession

java.util.Collection findAllLongSession(java.lang.String... sortField)
                                        throws LookupException
Get a collection of all objects under the control of this domain access object.

Returns:
the collection of all instances
Throws:
LookupException - if we failed to execute the lookup

findAllLongSession

java.util.Collection findAllLongSession(java.lang.Boolean alwaysApplyFilters,
                                        java.lang.String... sortField)
                                        throws LookupException
Throws:
LookupException

findByQuery

java.util.Collection findByQuery(java.lang.String queryString)
                                 throws LookupException
Find a collection of objects by a query string.

Parameters:
queryString - the hql.
Returns:
a collection of domain objects.
Throws:
LookupException - we couldnt find what you were looking for.

findByQueryEditor

java.util.Collection findByQueryEditor(QueryEditor editor,
                                       InfiniteProgressPanel progressPanel)
                                       throws LookupException
Find a collection of objects by a query string.

Parameters:
editor - an AT query editor.
Returns:
a collection of domain objects.
Throws:
LookupException - we couldnt find what you were looking for.

findByNamedQuery

java.util.Collection findByNamedQuery(java.lang.String namedQuery,
                                      java.lang.Object propertyObject)
                                      throws LookupException
Find instances through a named query with parameters.

Parameters:
namedQuery - the query to use
propertyObject - the bean to use to provide properties to the query
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByNamedQuery

java.util.Collection findByNamedQuery(java.lang.String namedQuery)
                                      throws LookupException
Find instances through a named query without parameters.

Parameters:
namedQuery - the query to use
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByExample

java.util.Collection findByExample(java.lang.Object instance)
                                   throws LookupException
Find instances through a named query without parameters.

Parameters:
instance - the instance to use as an example
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByPropertyValue

java.util.Collection findByPropertyValue(java.lang.String propertyName,
                                         java.lang.Object value)
                                         throws LookupException
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
value - the value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByPropertyValues

java.util.Collection findByPropertyValues(java.lang.String propertyName,
                                          java.lang.Object[] values)
                                          throws LookupException
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
values - the value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByPropertyValuesLongSession

java.util.Collection findByPropertyValuesLongSession(java.lang.String propertyName,
                                                     java.lang.Object[] values)
                                                     throws LookupException
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
values - the value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByUniquePropertyValue

DomainObject findByUniquePropertyValue(java.lang.String propertyName,
                                       java.lang.Object value)
                                       throws LookupException
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
value - the value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

findByUniquePropertyValueLongSession

DomainObject findByUniquePropertyValueLongSession(java.lang.String propertyName,
                                                  java.lang.Object value)
                                                  throws LookupException
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
value - the value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query

updateTextField

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
Find instances through a named query without parameters.

Parameters:
propertyName - the name of the property
oldValue - the old value of the property
newValue - the new value of the property
Returns:
the collection of instances
Throws:
LookupException - if we failed to execute the query
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
ValidationException

getCountBasedOnPropertyValue

java.lang.Integer getCountBasedOnPropertyValue(java.lang.String propertyName,
                                               java.lang.Object value)

merge

int merge(java.util.Collection<DomainObject> mergeFrom,
          DomainObject mergeTo,
          InfiniteProgressPanel progressPanel)
          throws MergeException
Throws:
MergeException

getHumanReadableSearchString

java.lang.String getHumanReadableSearchString()