K - type of primary keyT - type of Transfer ObjectB - type of Business Object ImplementationC - type of Business Object Interfacepublic abstract class AbstractDAO<K extends Serializable,T extends GeneralDTO<K>,B extends AbstractBO<K,T>,C extends GeneralBO<K>> extends AbstractGeneralDAO<K,B,C> implements GeneralDAO<K,C>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractDAO.BusinessIterator
Wrapping all DTOs into BOs when returning.
|
log| Constructor and Description |
|---|
AbstractDAO()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_create(B object)
Creates the object.
|
protected abstract void |
_create(T object)
Creates the object.
|
protected void |
_delete(B object)
Deletes the object.
|
protected abstract void |
_delete(T object)
Deletes the object.
|
protected abstract int |
_deleteAll()
Deletes all objects.
|
protected abstract int |
_deleteDefaultAll()
Deletes all objects.
|
protected abstract List<T> |
_findAll(int firstResult,
int maxResults)
Returns a subset of all objects.
|
protected abstract T |
_findById(K id)
Find the object in underlying store.
|
protected abstract List<T> |
_findDefaultAll(int firstResult,
int maxResults)
Returns a subset of domain objects with default criteria.
|
protected abstract Iterator<T> |
_iterateAll(int firstResult,
int maxResults)
Returns a subset of all objects
|
protected abstract Iterator<T> |
_iterateDefaultAll(int firstResult,
int maxResults)
Returns a subset of domain objects with default criteria.
|
protected void |
_save(B object)
Saves the object.
|
protected abstract void |
_save(T object)
Saves the object.
|
int |
deleteAll()
Deletes all objects.
|
int |
deleteDefaultAll()
Deletes all objects.
|
List<C> |
findAll(int firstResult,
int maxResults)
Returns a subset of all objects.
|
C |
findById(K id)
Find the given object in model.
|
List<C> |
findDefaultAll(int firstResult,
int maxResults)
Returns domain objects with default criteria.
|
C |
getBusinessObject(T object)
Returns the business objects for the transfer object.
|
protected CID |
getCID(T object)
Returns the CID for this object.
|
protected Class<T> |
getTransferClass()
Returns the dtoInterfaceClass.
|
protected void |
init()
Initializes / called from constructor.
|
DaoIterator<C> |
iterateAll(int firstResult,
int maxResults)
Returns a subset of all objects
|
DaoIterator<C> |
iterateDefaultAll(int firstResult,
int maxResults)
Returns a subset of domain objects with default criteria.
|
protected void |
wrap(Collection<C> rc,
Collection<T> collection)
Wraps the collection into business objects.
|
protected DaoIterator<C> |
wrap(Iterator<T> i)
Returns the wrapper for DTO iterators.
|
addCached, addDaoListener, afterConfiguration, afterCreate, afterDelete, afterNewInstance, afterSave, beforeConfiguration, beforeCreate, beforeDelete, beforeSave, configure, create, create, createObject, createObject, delete, deleteObject, findAll, findDefaultAll, fireAllDefaultDeleted, fireAllDeleted, fireDaoEvent, fireObjectCreated, fireObjectDeleted, fireObjectUpdated, getBoImplementationClass, getBoInterfaceClass, getCached, getDaoMaster, getFactory, getKeyClass, getLog, iterateAll, iterateDefaultAll, newInstance, removeDaoListener, save, save, saveObject, saveObject, setDaoMaster, setFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDaoListener, create, create, createObject, createObject, delete, deleteObject, findAll, findDefaultAll, getDaoMaster, getDefaultObjectCount, getFactory, getObjectCount, iterateAll, iterateDefaultAll, newInstance, removeDaoListener, save, save, saveObject, saveObject, setDaoMaster, setFactoryprotected void init()
init in class AbstractGeneralDAO<K extends Serializable,B extends AbstractBO<K,T>,C extends GeneralBO<K>>protected Class<T> getTransferClass()
public C getBusinessObject(T object)
protected CID getCID(T object)
object - objectprotected void wrap(Collection<C> rc, Collection<T> collection)
rc - the collection where to store the BO.collection - collection of DTO to be wrapped.protected DaoIterator<C> wrap(Iterator<T> i)
i - DTO iterator to be wrappedprotected void _create(B object)
_create in class AbstractGeneralDAO<K extends Serializable,B extends AbstractBO<K,T>,C extends GeneralBO<K>>object - BO to be savedAbstractGeneralDAO.createObject(Object)protected abstract void _create(T object)
object - DTO to be savedAbstractGeneralDAO.create(GeneralBO, boolean)public C findById(K id)
findById in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>id - id of objectprotected abstract T _findById(K id)
id - id of objectpublic List<C> findAll(int firstResult, int maxResults)
findAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>firstResult - index of first resultmaxResults - maximum number of results to returnprotected abstract List<T> _findAll(int firstResult, int maxResults)
firstResult - index of first resultmaxResults - maximum number of results to returnpublic List<C> findDefaultAll(int firstResult, int maxResults)
findDefaultAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>protected abstract List<T> _findDefaultAll(int firstResult, int maxResults)
firstResult - index of first resultmaxResults - maximum number of results to returnpublic DaoIterator<C> iterateAll(int firstResult, int maxResults)
iterateAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>firstResult - index of first resultmaxResults - maximum number of results to returnprotected abstract Iterator<T> _iterateAll(int firstResult, int maxResults)
firstResult - index of first resultmaxResults - maximum number of results to returnpublic DaoIterator<C> iterateDefaultAll(int firstResult, int maxResults)
iterateDefaultAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>firstResult - index of first resultmaxResults - maximum number of results to returnprotected abstract Iterator<T> _iterateDefaultAll(int firstResult, int maxResults)
firstResult - index of first resultmaxResults - maximum number of results to returnprotected void _save(B object)
_save in class AbstractGeneralDAO<K extends Serializable,B extends AbstractBO<K,T>,C extends GeneralBO<K>>object - BO to be savedAbstractGeneralDAO.create(GeneralBO, boolean)protected abstract void _save(T object)
object - DTO to be savedAbstractGeneralDAO.save(GeneralBO, boolean)protected void _delete(B object)
_delete in class AbstractGeneralDAO<K extends Serializable,B extends AbstractBO<K,T>,C extends GeneralBO<K>>object - DTO to be deleted.protected abstract void _delete(T object)
object - DTO to be deleted.public int deleteAll()
deleteAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>protected abstract int _deleteAll()
public int deleteDefaultAll()
deleteDefaultAll in interface GeneralDAO<K extends Serializable,C extends GeneralBO<K>>protected abstract int _deleteDefaultAll()
Copyright © 2013. All Rights Reserved.