ENTITY
- The type whose persistence is managed by this Dao
.PARENT
- The type of the parent (if any) of type ENTITY
.BUILDER
- The type of object that can build an ENTITY
instance.PARENTBUILDER
- The type of the object that can build a PARENT
instance.public class DaoImpl<ENTITY,PARENT,BUILDER,PARENTBUILDER> extends AbstractDao<ENTITY,BUILDER> implements Dao<ENTITY>, DaoDescriptor<ENTITY,BUILDER>
Dao
implementation.
There is no good reason to directly construct this class yourself.
Use a DaoBuilder
or IndirectDaoBuilder
.
connection, sqlBuilder, sqlRunner
Constructor and Description |
---|
DaoImpl(Connection connection,
DaoDescriptor<ENTITY,BUILDER> daoDescriptor) |
Modifier and Type | Method and Description |
---|---|
void |
atomicDelete(ENTITY item)
Run a delete statement in the database within a transaction.
|
void |
atomicUpdate(ENTITY item)
Run an update statement to change the values in the database associated
with an existing record.
|
List<ChildrenDescriptor<ENTITY,?,BUILDER,?>> |
childrenDescriptors()
The definitions of any entities that are owned by type
ENTITY |
ChildSelectStrategy |
childSelectStrategy() |
void |
delete(ENTITY item)
Run a delete statement in the database.
|
Long |
insert(ENTITY item)
Insert a record into the database.
|
ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER> |
parentColumn()
The parent column, if there is one, of the
ENTITY . |
Queries |
queries()
Access the
SQL this Dao is using. |
List<ENTITY> |
select(List<Long> ids)
Read several records from the database by their primary keys.
|
ENTITY |
selectOne(long id)
Read a record from the database by its primary key.
|
void |
update(ENTITY item)
Run an update statement to change the values in the database associated
with an existing record.
|
atomicInsert, buildFunction, foldingSelect, fromSingletonList, getColumnCollection, runBigDecimalFunction, runLongFunction, select, select, select, select, select, select, selectDistinct, selectDistinct, selectDistinct, selectOne, selectOne, supplier, tableName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
atomicInsert, foldingSelect, runBigDecimalFunction, runLongFunction, select, select, select, select, select, select, selectDistinct, selectDistinct, selectDistinct, selectOne, selectOne
hasParent, parentColumnName, primaryKey, validateConsistencyOfJoinedSelectStrategies
allColumns, buildFunction, dataColumns, getColumnCollection, joinColumns, joinedSelectStrategies, nonJoinColumns, select, supplier, tableName
public DaoImpl(Connection connection, DaoDescriptor<ENTITY,BUILDER> daoDescriptor)
public ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER> parentColumn()
DaoDescriptor
ENTITY
.parentColumn
in interface DaoDescriptor<ENTITY,BUILDER>
public List<ChildrenDescriptor<ENTITY,?,BUILDER,?>> childrenDescriptors()
DaoDescriptor
ENTITY
childrenDescriptors
in interface DaoDescriptor<ENTITY,BUILDER>
childrenDescriptors
in class AbstractDao<ENTITY,BUILDER>
public Long insert(ENTITY item)
KeylessDao
Depending on how the Dao was constucted (whether from a regular
DaoBuilder
or an IndirectDaoBuilder
)
a particular instance of this class may or may not attempt
to mutate the state of the passed item by setting its primary
key.
insert
in interface KeylessDao<ENTITY>
insert
in class AbstractDao<ENTITY,BUILDER>
item
- The instance to be inserted.public void update(ENTITY item)
Dao
public void delete(ENTITY item)
Dao
public ENTITY selectOne(long id)
Dao
public List<ENTITY> select(List<Long> ids)
Dao
public void atomicUpdate(ENTITY item)
Dao
Connection
when complete.atomicUpdate
in interface Dao<ENTITY>
item
- An instance of the class with a populated primary key field
and updated field values.public void atomicDelete(ENTITY item)
Dao
Connection
when complete.atomicDelete
in interface Dao<ENTITY>
item
- An instance of type ENTITY with a populated primary key.public Queries queries()
Dao
SQL
this Dao
is using.
The SQL
provided is suitable for being passed to a
PreparedStatement
.
public ChildSelectStrategy childSelectStrategy()
childSelectStrategy
in interface DaoDescriptor<ENTITY,BUILDER>
Copyright © 2019. All rights reserved.