- java.lang.Object
- 
- org.jooq.impl.DAOImpl<R,P,T>
 
- 
- All Implemented Interfaces:
- DAO<R,P,T>
 
 public abstract class DAOImpl<R extends UpdatableRecord<R>,P,T> extends Object implements DAO<R,P,T> A common base implementation for generatedDAO.Unlike many other elements in the jOOQ API, DAOmay be used in the context of Spring, CDI, or EJB lifecycle management. This means that no methods in theDAOtype hierarchy must be made final. See also https://github.com/jOOQ/ jOOQ/issues/4696 for more details.- Author:
- Lukas Eder
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TcompositeKeyRecord(Object... values)Configurationconfiguration()Expose the configuration in whose context thisDAOis operating.longcount()Count all records of the underlying table.DSLContextctx()voiddelete(Collection<P> objects)Performs aDELETEstatement for a given set of POJOsvoiddelete(P object)Performs aDELETEstatement for a POJOvoiddelete(P... objects)Performs aDELETEstatement for a given set of POJOsvoiddeleteById(Collection<T> ids)Performs aDELETEstatement for a given set of IDsvoiddeleteById(T... ids)Performs aDELETEstatement for a given set of IDsSQLDialectdialect()TheSQLDialectwrapped by this context.booleanexists(P object)Checks if a given POJO existsbooleanexistsById(T id)Checks if a given ID existsSQLDialectfamily()TheSQLDialect.family()wrapped by this context.<Z> List<P>fetch(Field<Z> field, Z... values)Find records by a given field and a set of values.<Z> PfetchOne(Field<Z> field, Z value)Find a unique record by a given field and a value.<Z> Optional<P>fetchOptional(Field<Z> field, Z value)Find a unique record by a given field and a value.<Z> List<P>fetchRange(Field<Z> field, Z lowerInclusive, Z upperInclusive)Find records by a given field and a range of values.List<P>findAll()Find all records of the underlying table.PfindById(T id)Find a record of the underlying table by ID.Table<R>getTable()Get the underlying table.Class<P>getType()Get the underlying POJO type.voidinsert(Collection<P> objects)Performs a batchINSERTstatement for a given set of POJOsvoidinsert(P object)Performs anINSERTstatement for a given POJOvoidinsert(P... objects)Performs a batchINSERTstatement for a given set of POJOsRecordMapper<R,P>mapper()Expose theRecordMapperthat is used internally by thisDAOto map from records of typeRto POJOs of typeP.voidsetConfiguration(Configuration configuration)Inject a configuration.Settingssettings()The settings wrapped by this context.voidupdate(Collection<P> objects)Performs a batchUPDATEstatement for a given set of POJOsvoidupdate(P object)Performs anUPDATEstatement for a given POJOvoidupdate(P... objects)Performs a batchUPDATEstatement for a given set of POJOs
 
- 
- 
- 
Method Detail- 
setConfigurationpublic void setConfiguration(Configuration configuration) Inject a configuration.This method is maintained to be able to configure a DAOusing Spring. It is not exposed in the public API.
 - 
ctxpublic final DSLContext ctx() 
 - 
configurationpublic Configuration configuration() Description copied from interface:DAOExpose the configuration in whose context thisDAOis operating.- Specified by:
- configurationin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Returns:
- the DAO's underlyingConfiguration
 
 - 
settingspublic Settings settings() Description copied from interface:DAOThe settings wrapped by this context.This method is a convenient way of accessing configuration().settings().
 - 
dialectpublic SQLDialect dialect() Description copied from interface:DAOTheSQLDialectwrapped by this context.This method is a convenient way of accessing configuration().dialect().
 - 
familypublic SQLDialect family() Description copied from interface:DAOTheSQLDialect.family()wrapped by this context.This method is a convenient way of accessing configuration().family().
 - 
mapperpublic RecordMapper<R,P> 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. 
 - 
insertpublic void insert(P object) Description copied from interface:DAOPerforms anINSERTstatement for a given POJO
 - 
insertpublic void insert(P... objects) Description copied from interface:DAOPerforms a batchINSERTstatement for a given set of POJOs- Specified by:
- insertin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be inserted
- See Also:
- DAO.insert(Collection)
 
 - 
insertpublic void insert(Collection<P> objects) Description copied from interface:DAOPerforms a batchINSERTstatement for a given set of POJOs- Specified by:
- insertin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be inserted
- See Also:
- DAO.insert(Object...)
 
 - 
updatepublic void update(P object) Description copied from interface:DAOPerforms anUPDATEstatement for a given POJO
 - 
updatepublic void update(P... objects) Description copied from interface:DAOPerforms a batchUPDATEstatement for a given set of POJOs- Specified by:
- updatein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be updated
- See Also:
- DAO.update(Collection)
 
 - 
updatepublic void update(Collection<P> objects) Description copied from interface:DAOPerforms a batchUPDATEstatement for a given set of POJOs- Specified by:
- updatein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be updated
- See Also:
- DAO.update(Object...)
 
 - 
deletepublic void delete(P object) Description copied from interface:DAOPerforms aDELETEstatement for a POJO- Specified by:
- deletein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- object- The POJO to be deleted
- See Also:
- DAO.delete(Collection)
 
 - 
deletepublic void delete(P... objects) Description copied from interface:DAOPerforms aDELETEstatement for a given set of POJOs- Specified by:
- deletein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be deleted
- See Also:
- DAO.delete(Collection)
 
 - 
deletepublic void delete(Collection<P> objects) Description copied from interface:DAOPerforms aDELETEstatement for a given set of POJOs- Specified by:
- deletein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- objects- The POJOs to be deleted
- See Also:
- DAO.delete(Object...)
 
 - 
deleteByIdpublic void deleteById(T... ids) Description copied from interface:DAOPerforms aDELETEstatement for a given set of IDs- Specified by:
- deleteByIdin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- ids- The IDs to be deleted
- See Also:
- DAO.delete(Collection)
 
 - 
deleteByIdpublic void deleteById(Collection<T> ids) Description copied from interface:DAOPerforms aDELETEstatement for a given set of IDs- Specified by:
- deleteByIdin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- ids- The IDs to be deleted
- See Also:
- DAO.delete(Object...)
 
 - 
existspublic boolean exists(P object) Description copied from interface:DAOChecks if a given POJO exists
 - 
existsByIdpublic boolean existsById(T id) Description copied from interface:DAOChecks if a given ID exists- Specified by:
- existsByIdin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- id- The ID whose existence is checked
- Returns:
- Whether the ID already exists
 
 - 
countpublic long count() Description copied from interface:DAOCount all records of the underlying table.
 - 
findAllpublic List<P> findAll() Description copied from interface:DAOFind all records of the underlying table.
 - 
findByIdpublic P findById(T id) Description copied from interface:DAOFind a record of the underlying table by ID.
 - 
fetchRangepublic <Z> List<P> fetchRange(Field<Z> field, Z lowerInclusive, Z upperInclusive) Description copied from interface:DAOFind records by a given field and a range of values.- Specified by:
- fetchRangein interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- field- The field to compare values against
- lowerInclusive- The range's lower bound (inclusive), or unbounded if- null.
- upperInclusive- The range's upper bound (inclusive), or unbounded if- null.
- Returns:
- A list of records fulfilling
         field BETWEEN lowerInclusive AND upperInclusive
 
 - 
fetchpublic <Z> List<P> fetch(Field<Z> field, Z... values) Description copied from interface:DAOFind records by a given field and a set of values.
 - 
fetchOnepublic <Z> P fetchOne(Field<Z> field, Z value) Description copied from interface:DAOFind a unique record by a given field and a value.
 - 
fetchOptionalpublic <Z> Optional<P> fetchOptional(Field<Z> field, Z value) Description copied from interface:DAOFind a unique record by a given field and a value.- Specified by:
- fetchOptionalin interface- DAO<R extends UpdatableRecord<R>,P,T>
- Parameters:
- field- The field to compare value against
- value- The accepted value
- Returns:
- A record fulfilling field = value
 
 - 
getTablepublic Table<R> getTable() Description copied from interface:DAOGet the underlying table.
 - 
getTypepublic Class<P> getType() Description copied from interface:DAOGet the underlying POJO type.
 
- 
 
-