ENTITY
- The type of the class that the Dao
will support.BUILDER
- The type of the class that can be used to construct new ENTITY
instances and accept individual data elements.public class IndirectDaoBuilder<ENTITY,BUILDER> extends AbstractDaoBuilder<ENTITY,BUILDER,IndirectDaoBuilder<ENTITY,BUILDER>> implements SchemaDescriptor<ENTITY,BUILDER>
IndirectDaoBuilder
is used for times when the class representing
the persisted entity is immutable. It allows the relationships between the database
table, the entity class, and the entity's builder class to be defined.
Also see DaoBuilder
and IndirectKeylessDaoBuilder
.
childrenDescriptors, columnCollection, daoBuilderHelper
Constructor and Description |
---|
IndirectDaoBuilder(String tableName,
Supplier<BUILDER> supplier,
Function<BUILDER,ENTITY> buildFunction)
Create a new
IndirectDaoBuilder instance. |
Modifier and Type | Method and Description |
---|---|
IndirectDaoBuilder<ENTITY,BUILDER> |
withPrimaryKey(String columnName,
String sequenceName,
Function<ENTITY,Long> getter,
BiConsumer<BUILDER,Long> setter)
Set data about the primary key of the table for this type.
|
buildDao, buildQueries, childrenDescriptors, childSelectStrategy, notNull, parentColumn, setSqlTypeName, uniquenessConstraints, withChildren, withChildSelectStrategy, withParentColumn, withParentColumn, withUniqueConstraint
buildFunction, getColumnCollection, supplier, tableName, withBigDecimalColumn, withBooleanColumn, withConvertedGenericColumn, withConvertingStringColumn, withGenericColumn, withInstantColumn, withIntegerBooleanColumn, withJoinColumn, withLongColumn, withStringBooleanColumn, withStringColumn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildQueries, uniquenessConstraints
childrenDescriptors, childSelectStrategy, hasParent, parentColumn, parentColumnName, primaryKey, validateConsistencyOfJoinedSelectStrategies
allColumns, buildFunction, dataColumns, getColumnCollection, joinColumns, joinedSelectStrategies, nonJoinColumns, select, supplier, tableName
public IndirectDaoBuilder(String tableName, Supplier<BUILDER> supplier, Function<BUILDER,ENTITY> buildFunction)
IndirectDaoBuilder
instance.tableName
- The name of the table in the database.supplier
- A mechanism (generally a constructor) for creating a new instance.buildFunction
- How to create an instance of the entity class from its builder.public IndirectDaoBuilder<ENTITY,BUILDER> withPrimaryKey(String columnName, String sequenceName, Function<ENTITY,Long> getter, BiConsumer<BUILDER,Long> setter)
columnName
- The name of the column in the table that holds the primary key.sequenceName
- The name of the sequence that will provide new keys.getter
- The function to call to get the primary key value from an object instance.setter
- The function to call to set the primary key value to an object instance.Copyright © 2019. All rights reserved.