|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.uwyn.rife.database.DbQueryManager
com.uwyn.rife.database.querymanagers.generic.AbstractGenericQueryManager<BeanType>
public abstract class AbstractGenericQueryManager<BeanType>
Field Summary | |
---|---|
protected Class<BeanType> |
mBaseClass
|
protected Method |
mGetPrimaryKeyMethod
|
protected List<GenericQueryManagerListener> |
mListeners
|
protected String |
mPrimaryKey
|
protected Method |
mSetPrimaryKeyMethod
|
protected boolean |
mSparseIdentifier
|
Constructor Summary | |
---|---|
AbstractGenericQueryManager(Datasource datasource,
Class<BeanType> beanClass,
String primaryKey)
|
Method Summary | ||
---|---|---|
protected int |
_count(Select count)
|
|
protected boolean |
_delete(Delete delete)
|
|
protected boolean |
_delete(Delete delete,
int objectId)
|
|
protected int |
_insert(SequenceValue nextId,
Insert save,
BeanType bean)
|
|
protected int |
_insertWithoutCallbacks(SequenceValue nextId,
Insert save,
BeanType bean)
|
|
protected void |
_install(CreateSequence createSequence,
CreateTable createTable)
|
|
protected void |
_remove(DropSequence dropSequence,
DropTable dropTable)
|
|
protected List<BeanType> |
_restore(Select restore)
|
|
protected boolean |
_restore(Select restore,
DbRowProcessor rowProcessor)
|
|
protected BeanType |
_restore(Select restore,
int objectId)
|
|
protected BeanType |
_restoreFirst(Select restore)
|
|
protected int |
_save(SequenceValue nextId,
Insert save,
Update saveUpdate,
BeanType bean)
|
|
protected int |
_update(Update saveUpdate,
BeanType bean)
|
|
protected int |
_updateWithoutCallbacks(Update saveUpdate,
BeanType bean)
|
|
protected void |
_validateWithoutCallbacks(Validated validated)
|
|
void |
addListener(GenericQueryManagerListener listener)
Add the listener to the manager to get notifications when actions were successful. |
|
|
createNewManager(Class<OtherBeanType> beanClass)
Create a new generic query manager of the same kind but for another bean class. |
|
protected void |
deleteManyToMany(int objectId)
|
|
protected void |
deleteManyToOne(int objectId)
|
|
protected void |
fireDeleted(int objectId)
|
|
protected void |
fireInserted(BeanType bean)
|
|
protected void |
fireInstalled()
|
|
protected void |
fireRemoved()
|
|
protected void |
fireRestored(BeanType bean)
|
|
protected void |
fireUpdated(BeanType bean)
|
|
Class |
getBaseClass()
Get the handled class |
|
protected Callbacks |
getCallbacks(BeanType bean)
|
|
String |
getIdentifierName()
Get the name of the property defined as the identifier. |
|
int |
getIdentifierValue(BeanType bean)
Get the value of the property defined as the identifier. |
|
protected void |
installManyToMany()
|
|
boolean |
isIdentifierSparse()
|
|
void |
removeListeners()
Remove all the listeners that are registered to the manager. |
|
protected void |
removeManyToMany()
|
|
protected void |
restoreManyToMany(BeanType bean,
int objectId)
|
|
protected void |
restoreManyToOne(BeanType bean)
|
|
protected void |
restoreManyToOneAssociations(BeanType bean,
int objectId)
|
|
protected void |
setManyToOneJoinParameters(DbPreparedStatement statement,
BeanType bean)
|
|
protected void |
storeManyToMany(BeanType bean,
int objectId)
|
|
protected void |
storeManyToOne(BeanType bean)
|
|
protected void |
storeManyToOneAssociations(BeanType bean,
int objectId)
|
|
void |
validate(Validated validated)
Validates a Validated in this context. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.uwyn.rife.database.querymanagers.generic.GenericQueryManager |
---|
count, count, delete, delete, getCountQuery, getDeleteQuery, getDeleteQuery, getInstallTableQuery, getRestoreQuery, getRestoreQuery, getTable, insert, install, install, remove, restore, restore, restore, restore, restore, restoreFirst, save, update |
Field Detail |
---|
protected Class<BeanType> mBaseClass
protected String mPrimaryKey
protected Method mGetPrimaryKeyMethod
protected Method mSetPrimaryKeyMethod
protected boolean mSparseIdentifier
protected List<GenericQueryManagerListener> mListeners
Constructor Detail |
---|
public AbstractGenericQueryManager(Datasource datasource, Class<BeanType> beanClass, String primaryKey) throws DatabaseException
DatabaseException
Method Detail |
---|
public Class getBaseClass()
GenericQueryManager
getBaseClass
in interface GenericQueryManager<BeanType>
public String getIdentifierName()
GenericQueryManager
Defaults to "id".
getIdentifierName
in interface GenericQueryManager<BeanType>
public int getIdentifierValue(BeanType bean) throws DatabaseException
GenericQueryManager
The property defaults to "id".
getIdentifierValue
in interface GenericQueryManager<BeanType>
bean
- the bean to retrieve the identifier value for
DatabaseException
public boolean isIdentifierSparse()
public void validate(Validated validated)
ValidationContext
Validated
in this context.
This method is not suppossed to reset the validation errors or to start the validation from scratch, but it's intended to add additional errors to an existing collection.
validate
in interface ValidationContext
validated
- the Validated
instance that will be validatedprotected void _validateWithoutCallbacks(Validated validated)
protected Callbacks getCallbacks(BeanType bean)
protected int _update(Update saveUpdate, BeanType bean)
protected int _updateWithoutCallbacks(Update saveUpdate, BeanType bean)
protected int _insert(SequenceValue nextId, Insert save, BeanType bean)
protected int _insertWithoutCallbacks(SequenceValue nextId, Insert save, BeanType bean)
protected void setManyToOneJoinParameters(DbPreparedStatement statement, BeanType bean)
protected void storeManyToOne(BeanType bean)
protected void storeManyToOneAssociations(BeanType bean, int objectId)
protected void storeManyToMany(BeanType bean, int objectId)
protected int _save(SequenceValue nextId, Insert save, Update saveUpdate, BeanType bean) throws DatabaseException
DatabaseException
protected boolean _delete(Delete delete) throws DatabaseException
DatabaseException
protected boolean _delete(Delete delete, int objectId) throws DatabaseException
DatabaseException
protected void deleteManyToOne(int objectId)
protected void deleteManyToMany(int objectId)
protected BeanType _restore(Select restore, int objectId) throws DatabaseException
DatabaseException
protected BeanType _restoreFirst(Select restore) throws DatabaseException
DatabaseException
protected List<BeanType> _restore(Select restore) throws DatabaseException
DatabaseException
protected boolean _restore(Select restore, DbRowProcessor rowProcessor) throws DatabaseException
DatabaseException
protected void restoreManyToMany(BeanType bean, int objectId)
protected void restoreManyToOne(BeanType bean)
protected void restoreManyToOneAssociations(BeanType bean, int objectId)
protected int _count(Select count) throws DatabaseException
DatabaseException
protected void _install(CreateSequence createSequence, CreateTable createTable) throws DatabaseException
DatabaseException
protected void installManyToMany()
protected void _remove(DropSequence dropSequence, DropTable dropTable) throws DatabaseException
DatabaseException
protected void removeManyToMany()
public void addListener(GenericQueryManagerListener listener)
GenericQueryManager
addListener
in interface GenericQueryManager<BeanType>
listener
- the listener that has to be addedpublic void removeListeners()
GenericQueryManager
removeListeners
in interface GenericQueryManager<BeanType>
public <OtherBeanType> GenericQueryManager<OtherBeanType> createNewManager(Class<OtherBeanType> beanClass)
GenericQueryManager
createNewManager
in interface GenericQueryManager<BeanType>
beanClass
- the class of the bean for which the new generic query
manager has to be created
protected void fireInstalled()
protected void fireRemoved()
protected void fireInserted(BeanType bean)
protected void fireUpdated(BeanType bean)
protected void fireRestored(BeanType bean)
protected void fireDeleted(int objectId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |