|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
it.openutils.dao.hibernate.HibernateDAOImpl<T,K>
T
- Persistence classK
- Object Keypublic abstract class HibernateDAOImpl<T,K extends java.io.Serializable>
Base Hibernate DAO.
Field Summary |
---|
Fields inherited from class org.springframework.dao.support.DaoSupport |
---|
logger |
Constructor Summary | |
---|---|
HibernateDAOImpl()
Instantiates a new DAO instance |
|
HibernateDAOImpl(java.lang.Class referenceClass)
Sets the class of the persistent bean managed by this DAO |
Method Summary | |
---|---|
boolean |
delete(K key)
Used by the base DAO classes but here for your modification. |
void |
evict(T obj)
Remove the given object from the Session cache. |
java.util.List<T> |
find(java.lang.String query)
Execute a query. |
java.util.List<T> |
find(java.lang.String query,
java.lang.Object[] obj,
org.hibernate.type.Type[] type)
Execute a query. |
java.util.List<T> |
find(java.lang.String query,
java.lang.Object obj,
org.hibernate.type.Type type)
Execute a query. |
java.util.List<T> |
findAll()
Return all objects related to the implementation of this DAO with no filter. |
java.util.List<T> |
findAll(org.hibernate.criterion.Order[] orderProperties)
Return all objects related to the implementation of this DAO with no filter. |
java.util.List<T> |
findAll(org.hibernate.criterion.Order[] orderProperties,
java.util.List<org.hibernate.criterion.Criterion> criteria)
Return all objects related to the implementation of this DAO with no filter. |
protected java.util.List<?> |
findByNamedQuery(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> params,
java.lang.Integer maxResults)
Obtain an instance of Query for a named query string defined in the mapping file. |
protected java.util.List<?> |
findByNamedQuery(java.lang.String name,
java.io.Serializable[] params,
java.lang.Integer maxResults)
Obtain an instance of Query for a named query string defined in the mapping file. |
java.util.List<T> |
findFiltered(T filter)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
int maxResults,
int page)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
java.util.Map<java.lang.String,FilterMetadata> metadata)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
java.util.Map<java.lang.String,FilterMetadata> metadata,
int maxResults,
int page)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
org.hibernate.criterion.Order[] orderProperties)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
org.hibernate.criterion.Order[] customOrder,
java.util.Map<java.lang.String,FilterMetadata> metadata,
int maxResults,
int page)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<T> |
findFiltered(T filter,
org.hibernate.criterion.Order[] customOrder,
java.util.Map<java.lang.String,FilterMetadata> metadata,
int maxResults,
int page,
java.util.List<org.hibernate.criterion.Criterion> additionalCriteria)
Return all objects related to the implementation of this DAO filtered using properties of the provided instance. |
T |
findFilteredFirst(T filter)
Return the first object related to the implementation of this DAO filtered using properties of the provided instance. |
T |
findFilteredFirst(T filter,
java.util.List<org.hibernate.criterion.Criterion> criteria)
Return the first object related to the implementation of this DAO filtered using properties of the provided instance. |
T |
findFilteredFirst(T filter,
org.hibernate.criterion.Order[] order)
Return the first object related to the implementation of this DAO filtered using properties of the provided instance. |
java.util.List<?> |
findFilteredProperties(T filter,
org.hibernate.criterion.Order[] customOrder,
java.util.Map<java.lang.String,FilterMetadata> metadata,
int maxResults,
int page,
java.util.List<org.hibernate.criterion.Criterion> additionalCriteria,
java.util.List<java.lang.String> properties)
Return properties from all objects related to the implementation of this DAO filtered using properties of the provided instance. |
T |
get(K key)
Load object matching the given key and return it. |
protected java.util.Map<java.lang.String,FilterMetadata> |
getDefaultFilterMetadata()
Returns the default set of FilterMetadata that will be applied to any query. |
protected org.hibernate.criterion.Order[] |
getDefaultOrder()
Return a list of Order object to be used for the default ordering of the collection. |
protected java.util.List<?> |
getNamedQuery(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> params,
int maxResults)
Deprecated. use the better named findByNamedQuery method |
protected java.util.List<?> |
getNamedQuery(java.lang.String name,
java.io.Serializable[] params,
int maxResults)
Deprecated. use the better named findByNamedQuery method |
protected java.lang.Class<T> |
getReferenceClass()
Return the specific Object class that will be used for class-specific implementation of this DAO. |
T |
load(K key)
Load object matching the given key and return it. |
T |
loadIfAvailable(K key)
Load object matching the given key and return it. |
T |
merge(T obj)
Copy the state of the given object onto the persistent object with the same identifier. |
void |
refresh(T obj)
Re-read the state of the given instance from the underlying database. |
K |
save(T obj)
Persist the given transient instance, first assigning a generated identifier. |
void |
saveOrUpdate(T obj)
Used by the base DAO classes but here for your modification Either save() or update() the given instance, depending upon the value of its identifier property. |
void |
setAopenabled(boolean aopenabled)
Sets the aopenabled. |
protected void |
setParameterValue(org.hibernate.Query query,
java.lang.String key,
java.lang.Object value)
Convenience method to set paramers in the query given based on the actual object type in passed in as the value. |
void |
setReferenceClass(java.lang.Class<T> referenceClass)
|
void |
update(T obj)
Used by the base DAO classes but here for your modification Update the persistent state associated with the given identifier. |
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
---|
afterPropertiesSet, initDao |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HibernateDAOImpl()
public HibernateDAOImpl(java.lang.Class referenceClass)
referenceClass
- the class for the bean managed by this DAOMethod Detail |
---|
public java.util.List<T> find(java.lang.String query)
find
in interface HibernateDAO<T,K extends java.io.Serializable>
query
- a query expressed in Hibernate's query language
public java.util.List<T> findAll()
findAll
in interface HibernateDAO<T,K extends java.io.Serializable>
public java.util.List<T> findAll(org.hibernate.criterion.Order[] orderProperties)
findAll
in interface HibernateDAO<T,K extends java.io.Serializable>
orderProperties
- desc
or asc
public java.util.List<T> findAll(org.hibernate.criterion.Order[] orderProperties, java.util.List<org.hibernate.criterion.Criterion> criteria)
findAll
in interface HibernateDAO<T,K extends java.io.Serializable>
orderProperties
- desc
or asc
criteria
- Additional Criterion conditions
public java.util.List<T> find(java.lang.String query, java.lang.Object obj, org.hibernate.type.Type type)
find
in interface HibernateDAO<T,K extends java.io.Serializable>
query
- a query expressed in Hibernate's query languageobj
- filter valuetype
- filter type
public java.util.List<T> find(java.lang.String query, java.lang.Object[] obj, org.hibernate.type.Type[] type)
find
in interface HibernateDAO<T,K extends java.io.Serializable>
query
- a query expressed in Hibernate's query languageobj
- filter valuestype
- filter types
public T load(K key)
load
in interface HibernateDAO<T,K extends java.io.Serializable>
key
- serializable key
public T loadIfAvailable(K key)
loadIfAvailable
in interface HibernateDAO<T,K extends java.io.Serializable>
key
- serializable key
public T get(K key)
get
in interface HibernateDAO<T,K extends java.io.Serializable>
key
- serializable key
public void saveOrUpdate(T obj)
saveOrUpdate
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- Objectpublic void update(T obj)
update
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- a transient instance containing updated statepublic boolean delete(K key)
delete
in interface HibernateDAO<T,K extends java.io.Serializable>
key
- key
public void refresh(T obj)
refresh
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- Objectpublic void evict(T obj)
evict
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- Objectpublic T merge(T obj)
merge
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- a detached instance with state to be copied
public K save(T obj)
save
in interface HibernateDAO<T,K extends java.io.Serializable>
obj
- Object
public T findFilteredFirst(T filter)
findFilteredFirst
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.
public T findFilteredFirst(T filter, org.hibernate.criterion.Order[] order)
findFilteredFirst
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.
public T findFilteredFirst(T filter, java.util.List<org.hibernate.criterion.Criterion> criteria)
findFilteredFirst
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.criteria
- additional criterion
public java.util.List<T> findFiltered(T filter)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.
public java.util.List<T> findFiltered(T filter, org.hibernate.criterion.Order[] orderProperties)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.orderProperties
- the name of the property used for ordering
public java.util.List<T> findFiltered(T filter, java.util.Map<java.lang.String,FilterMetadata> metadata)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.metadata
- filter metadata
public java.util.List<T> findFiltered(T filter, int maxResults, int page)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.maxResults
- maximum number of resultspage
- result page (first result is maxResults * page)
public java.util.List<T> findFiltered(T filter, java.util.Map<java.lang.String,FilterMetadata> metadata, int maxResults, int page)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.metadata
- filter metadatamaxResults
- maximum number of resultspage
- result page (first result is maxResults * page)
public java.util.List<T> findFiltered(T filter, org.hibernate.criterion.Order[] customOrder, java.util.Map<java.lang.String,FilterMetadata> metadata, int maxResults, int page)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.customOrder
- order criteriasmetadata
- filter metadatamaxResults
- maximum number of resultspage
- result page (first result is maxResults * page)
public java.util.List<T> findFiltered(T filter, org.hibernate.criterion.Order[] customOrder, java.util.Map<java.lang.String,FilterMetadata> metadata, int maxResults, int page, java.util.List<org.hibernate.criterion.Criterion> additionalCriteria)
findFiltered
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.customOrder
- order criteriasmetadata
- filter metadatamaxResults
- maximum number of resultspage
- result page (first result is maxResults * page)additionalCriteria
- additional criteria
public java.util.List<?> findFilteredProperties(T filter, org.hibernate.criterion.Order[] customOrder, java.util.Map<java.lang.String,FilterMetadata> metadata, int maxResults, int page, java.util.List<org.hibernate.criterion.Criterion> additionalCriteria, java.util.List<java.lang.String> properties)
findFilteredProperties
in interface HibernateDAO<T,K extends java.io.Serializable>
filter
- an instance of the object with the properties you wish to filter on.customOrder
- order criteriasmetadata
- filter metadatamaxResults
- maximum number of resultspage
- result page (first result is maxResults * page)additionalCriteria
- additional criteriaproperties
- properties to be returned
protected java.lang.Class<T> getReferenceClass()
public void setReferenceClass(java.lang.Class<T> referenceClass)
protected org.hibernate.criterion.Order[] getDefaultOrder()
Order
object to be used for the default ordering of the collection.
protected java.util.List<?> findByNamedQuery(java.lang.String name, java.io.Serializable[] params, java.lang.Integer maxResults)
name
- the name of a query defined externallyparams
- the parameter arraymaxResults
- max number of results
protected java.util.List<?> findByNamedQuery(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Integer maxResults)
name
- the name of a query defined externallyparams
- the parameter MapmaxResults
- max number of results
@Deprecated protected java.util.List<?> getNamedQuery(java.lang.String name, java.io.Serializable[] params, int maxResults)
findByNamedQuery
method
name
- the name of a query defined externallyparams
- the parameter arraymaxResults
- max number of results
@Deprecated protected java.util.List<?> getNamedQuery(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> params, int maxResults)
findByNamedQuery
method
name
- the name of a query defined externallyparams
- the parameter MapmaxResults
- max number of results
protected void setParameterValue(org.hibernate.Query query, java.lang.String key, java.lang.Object value)
query
- the Query to setkey
- the key namevalue
- the object to set as the parameterprotected java.util.Map<java.lang.String,FilterMetadata> getDefaultFilterMetadata()
public void setAopenabled(boolean aopenabled)
aopenabled
- the aopenabled to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |