- All Implemented Interfaces:
DAO<R,P, T>
DAO.
Unlike many other elements in the jOOQ API, DAO may be used in
the context of Spring, CDI, or EJB lifecycle management. This means that no
methods in the DAO type hierarchy must be made final. See also
https://github.com/jOOQ/
jOOQ/issues/4696 for more details.
- Author:
- Lukas Eder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TcompositeKeyRecord(Object... values) Expose the configuration in whose context thisDAOis operating.longcount()Count all records of the underlying table.ctx()voiddelete(Collection<P> objects) Performs aDELETEstatement for a given set of POJOs.voidPerforms aDELETEstatement for a POJOvoidPerforms aDELETEstatement for a given set of POJOs.voiddeleteById(Collection<T> ids) Performs aDELETEstatement for a given set of IDs.voiddeleteById(T ids) Performs aDELETEstatement for a given set of IDs.voiddeleteById(T... ids) Performs aDELETEstatement for a given set of IDs.dialect()TheSQLDialectwrapped by this context.booleanChecks if a given POJO exists.booleanexistsById(T id) Checks if a given ID exists.family()TheSQLDialect.family()wrapped by this context.fetch(Field<Z> field, Collection<? extends Z> values) Find records by a given field and a set of values.Find records by a given field and a set of values.<Z> PFind a unique record by a given field and a value.fetchOptional(Field<Z> field, Z value) Find a unique record by a given field and a value.fetchRange(Field<Z> field, Z lowerInclusive, Z upperInclusive) Find records by a given field and a range of values.findAll()Find all records of the underlying table.Find a record of the underlying table by ID.findOptionalById(T id) Find a record of the underlying table by ID.getTable()Get the underlying table.getType()Get the underlying POJO type.voidinsert(Collection<P> objects) Performs a batchINSERTstatement for a given set of POJOs.voidPerforms anINSERTstatement for a given POJO.voidPerforms a batchINSERTstatement for a given set of POJOs.mapper()Expose theRecordMapperthat is used internally by thisDAOto map from records of typeRto POJOs of typeP.voidmerge(Collection<P> objects) Performs a batchMERGEstatement for a given set of POJOs.voidPerforms anMERGEstatement for a given POJO.voidPerforms a batchMERGEstatement for a given set of POJOs.voidsetConfiguration(Configuration configuration) Inject a configuration.settings()The settings wrapped by this context.voidupdate(Collection<P> objects) Performs a batchUPDATEstatement for a given set of POJOs.voidPerforms anUPDATEstatement for a given POJO.voidPerforms a batchUPDATEstatement for a given set of POJOs.
-
Constructor Details
-
DAOImpl
-
DAOImpl
-
-
Method Details
-
setConfiguration
Inject a configuration.This method is maintained to be able to configure a
DAOusing Spring. It is not exposed in the public API. -
ctx
-
configuration
Description copied from interface:DAOExpose the configuration in whose context thisDAOis operating.- Specified by:
configurationin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Returns:
- the
DAO's underlyingConfiguration
-
settings
Description copied from interface:DAOThe settings wrapped by this context.This method is a convenient way of accessing
configuration().settings(). -
dialect
Description copied from interface:DAOTheSQLDialectwrapped by this context.This method is a convenient way of accessing
configuration().dialect(). -
family
Description copied from interface:DAOTheSQLDialect.family()wrapped by this context.This method is a convenient way of accessing
configuration().family(). -
mapper
Expose theRecordMapperthat is used internally by thisDAOto map from records of typeRto POJOs of typeP.Subclasses may override this method to provide custom implementations.
-
insert
Description copied from interface:DAOPerforms anINSERTstatement for a given POJO.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call. -
insert
Description copied from interface:DAOPerforms a batchINSERTstatement for a given set of POJOs.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call. -
insert
Description copied from interface:DAOPerforms a batchINSERTstatement for a given set of POJOs.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call. -
update
Description copied from interface:DAOPerforms anUPDATEstatement for a given POJO.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call, ifUPDATE … RETURNINGis supported by the dialect. -
update
Description copied from interface:DAOPerforms a batchUPDATEstatement for a given set of POJOs.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call, ifUPDATE … RETURNINGis supported by the dialect. -
update
Description copied from interface:DAOPerforms a batchUPDATEstatement for a given set of POJOs.Depending on various settings, like
Settings.isReturnRecordToPojo(),Settings.isReturnIdentityOnUpdatableRecord(),Settings.isReturnAllOnUpdatableRecord(), and others, the argument POJO, if mutable, will receive any server side generated values using aRecord.into(Object)call, ifUPDATE … RETURNINGis supported by the dialect. -
merge
Description copied from interface:DAOPerforms anMERGEstatement for a given POJO. -
merge
Description copied from interface:DAOPerforms a batchMERGEstatement for a given set of POJOs. -
merge
Description copied from interface:DAOPerforms a batchMERGEstatement for a given set of POJOs. -
delete
Description copied from interface:DAOPerforms aDELETEstatement for a POJO -
delete
Description copied from interface:DAOPerforms aDELETEstatement for a given set of POJOs. -
delete
Description copied from interface:DAOPerforms aDELETEstatement for a given set of POJOs. -
deleteById
Description copied from interface:DAOPerforms aDELETEstatement for a given set of IDs.- Specified by:
deleteByIdin interfaceDAO<R extends UpdatableRecord<R>,P, T> - See Also:
-
deleteById
Description copied from interface:DAOPerforms aDELETEstatement for a given set of IDs.- Specified by:
deleteByIdin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
ids- The IDs to be deleted- See Also:
-
deleteById
Description copied from interface:DAOPerforms aDELETEstatement for a given set of IDs.- Specified by:
deleteByIdin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
ids- The IDs to be deleted- See Also:
-
exists
Description copied from interface:DAOChecks if a given POJO exists. -
existsById
Description copied from interface:DAOChecks if a given ID exists.- Specified by:
existsByIdin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
id- The ID whose existence is checked- Returns:
- Whether the ID already exists
-
count
public long count()Description copied from interface:DAOCount all records of the underlying table. -
findAll
Description copied from interface:DAOFind all records of the underlying table. -
findById
Description copied from interface:DAOFind a record of the underlying table by ID. -
findOptionalById
Description copied from interface:DAOFind a record of the underlying table by ID.- Specified by:
findOptionalByIdin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
id- The ID of a record in the underlying table- Returns:
- A record of the underlying table given its ID.
-
fetchRange
Description copied from interface:DAOFind records by a given field and a range of values.- Specified by:
fetchRangein interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
field- The field to compare values againstlowerInclusive- The range's lower bound (inclusive), or unbounded ifnull.upperInclusive- The range's upper bound (inclusive), or unbounded ifnull.- Returns:
- A list of records fulfilling
field BETWEEN lowerInclusive AND upperInclusive
-
fetch
Description copied from interface:DAOFind records by a given field and a set of values. -
fetch
Description copied from interface:DAOFind records by a given field and a set of values. -
fetchOne
Description copied from interface:DAOFind a unique record by a given field and a value. -
fetchOptional
Description copied from interface:DAOFind a unique record by a given field and a value.- Specified by:
fetchOptionalin interfaceDAO<R extends UpdatableRecord<R>,P, T> - Parameters:
field- The field to compare value againstvalue- The accepted value- Returns:
- A record fulfilling
field = value
-
getTable
Description copied from interface:DAOGet the underlying table. -
getType
Description copied from interface:DAOGet the underlying POJO type. -
compositeKeyRecord
-