|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.geekologue.md4j.dao.AbstractDAO
public abstract class AbstractDAO
An abstract DAO class to be subclassed by other DAO implementations.
| Field Summary | |
|---|---|
protected java.lang.Class |
daoClass
The class object that the implementing subclass is responsible for its database operations. |
protected java.lang.String |
identifierName
|
| Constructor Summary | |
|---|---|
protected |
AbstractDAO(java.lang.Class clazz,
java.lang.String identifierName)
Subclasses must call this constructor |
| Method Summary | |
|---|---|
abstract void |
delete(java.io.Serializable identifier)
Delete the object coresponding to the given identifier |
abstract java.lang.Object |
get(java.io.Serializable identifier)
Retreive the object matching the class handled by this DAO and the given identifier or null if no match is found. |
abstract java.util.Set |
getBrokenUConstraints(java.util.Map params,
java.io.Serializable id)
Get unique constraint violations before persisting new objects |
protected java.lang.Object |
getDaoClassInstance()
Get a new instance of the Class associated with this DAO (e.g. |
abstract Page |
getPage(java.util.Map params,
Order order,
int pageNumber,
int pageSize)
Get a page of results. |
abstract Page |
getPage(java.util.Set projectionProps,
java.util.Map params,
Order order,
int pageNumber,
int pageSize)
Get a page of results. |
abstract java.util.Map |
getParentOptions()
Get data to populate drop downs refering to parent objects by many-to-one relationships. |
abstract java.lang.Object |
load(java.io.Serializable identifier)
Retreive the object matching the class handled by this DAO and the given identifier. |
abstract java.io.Serializable |
save(java.lang.Object pojo)
Save the given object |
abstract void |
update(java.util.Map map)
Update the object matching the given identifier according to the property value pairs in the given map. |
abstract void |
update(java.lang.Object pojo)
Persist any changes to the given POJO |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Class daoClass
protected java.lang.String identifierName
| Constructor Detail |
|---|
protected AbstractDAO(java.lang.Class clazz,
java.lang.String identifierName)
clazz - | Method Detail |
|---|
protected java.lang.Object getDaoClassInstance()
public abstract java.lang.Object load(java.io.Serializable identifier)
identifier -
DataAccessExceptionpublic abstract java.lang.Object get(java.io.Serializable identifier)
identifier -
null otherwise
DataAccessExceptionpublic abstract void update(java.util.Map map)
null
map - the map with the property value pairs to update
DataAccessExceptionpublic abstract void update(java.lang.Object pojo)
pojo - the POJO to update
DataAccessException
public abstract Page getPage(java.util.Set projectionProps,
java.util.Map params,
Order order,
int pageNumber,
int pageSize)
projectionProps - the names of the property values to returnparams - the attribute-value pairs the results have to matchpageNumber - the number of the pagepageSize - the number of results in the page
public abstract Page getPage(java.util.Map params,
Order order,
int pageNumber,
int pageSize)
params - the attribute-value pairs the results have to matchpageNumber - the number of the pagepageSize - the number of results in the page
public abstract java.io.Serializable save(java.lang.Object pojo)
pojo - the POJO to save
DataAccessExceptionpublic abstract void delete(java.io.Serializable identifier)
pojo - the object to delete.
DataAccessException
public abstract java.util.Set getBrokenUConstraints(java.util.Map params,
java.io.Serializable id)
params - the property value pairs to check
public abstract java.util.Map getParentOptions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||