Package org.apache.empire.db.list
Class DBBeanListFactoryImpl<T>
java.lang.Object
org.apache.empire.db.list.DBBeanListFactoryImpl<T>
- All Implemented Interfaces:
DBBeanListFactory<T>
DBRecordListFactoryImpl
Implements the DBRecordListFactory interface
- Author:
- rainer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Constructor<T>protected final List<? extends DBColumnExpr>protected final Class<?>[]protected final List<? extends DBColumnExpr> -
Constructor Summary
ConstructorsModifierConstructorDescriptionDBBeanListFactoryImpl(Class<T> beanType, List<? extends DBColumnExpr> selectColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord classprotectedDBBeanListFactoryImpl(Class<T> beanType, List<? extends DBColumnExpr> keyColumns, List<? extends DBColumnExpr> selectColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord classDBBeanListFactoryImpl(Class<T> beanType, Column[] keyColumns, List<? extends DBColumnExpr> selectColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord classDBBeanListFactoryImpl(Constructor<T> constructor, List<? extends DBColumnExpr> constructorParams, List<? extends DBColumnExpr> setterColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteQuery(List<T> list) protected static <T> Constructor<T>findBeanConstructor(Class<T> beanType) protected static <T> Constructor<T>findBeanConstructor(Class<T> beanType, List<? extends DBColumnExpr> params) Finds a suitable constructor for the beanClassClass<?>protected static Class<?>[]getParameterTypes(Constructor<?> constructor) newItem(int rownum, DBRecordData recData) newList(int capacity) voidprepareQuery(DBCommandExpr cmd, DBContext context)
-
Field Details
-
constructor
-
parameterTypes
-
constructorParams
-
setterColumns
-
-
Constructor Details
-
DBBeanListFactoryImpl
public DBBeanListFactoryImpl(Constructor<T> constructor, List<? extends DBColumnExpr> constructorParams, List<? extends DBColumnExpr> setterColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord constructor- Parameters:
constructor- the constructor to be used to create the beanconstructorParams- (optional) the columns to be used for the constructor. Must match the constructor!setterColumns- (optional) the columns to be set through setter methods. List may include constructorParams
-
DBBeanListFactoryImpl
Constructs a DBRecordListFactoryImpl based on an DBRecord class- Parameters:
beanType- the bean type to be instantiatedselectColumns- (optional) the columns to be selected
-
DBBeanListFactoryImpl
protected DBBeanListFactoryImpl(Class<T> beanType, List<? extends DBColumnExpr> keyColumns, List<? extends DBColumnExpr> selectColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord class- Parameters:
beanType- the bean type to be instantiatedkeyColumns- (optional) the columns to be used for the constructorselectColumns- (optional) the columns to be set through setter methods. List may include constructorParams
-
DBBeanListFactoryImpl
public DBBeanListFactoryImpl(Class<T> beanType, Column[] keyColumns, List<? extends DBColumnExpr> selectColumns) Constructs a DBRecordListFactoryImpl based on an DBRecord class- Parameters:
beanType- the bean type to be instantiatedkeyColumns- (optional) the columns to be used for the constructor. Important: Must be a DBColumn array!selectColumns- (optional) the columns to be set through setter methods. List may include constructorParams
-
-
Method Details
-
findBeanConstructor
protected static <T> Constructor<T> findBeanConstructor(Class<T> beanType, List<? extends DBColumnExpr> params) Finds a suitable constructor for the beanClass- Parameters:
beanType- the bean class to instantiateparams- the constructor params- Returns:
- the constructor
-
findBeanConstructor
-
getParameterTypes
-
getBeanType
- Specified by:
getBeanTypein interfaceDBBeanListFactory<T>
-
prepareQuery
- Specified by:
prepareQueryin interfaceDBBeanListFactory<T>
-
newList
- Specified by:
newListin interfaceDBBeanListFactory<T>
-
newItem
- Specified by:
newItemin interfaceDBBeanListFactory<T>
-
completeQuery
- Specified by:
completeQueryin interfaceDBBeanListFactory<T>
-