|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jooq.impl.DAOImpl<R,P,T>
public abstract class DAOImpl<R extends UpdatableRecord<R>,P,T>
A common base implementation for generated DAO's
Constructor Summary | |
---|---|
protected |
DAOImpl(Table<R> table,
Class<P> type)
|
protected |
DAOImpl(Table<R> table,
Class<P> type,
Factory create)
|
Method Summary | ||
---|---|---|
long |
count()
Count all records of the underlying table. |
|
void |
delete(Collection<P> objects)
Performs a DELETE statement for a given set of POJOs |
|
void |
delete(P... objects)
Performs a DELETE statement for a given set of POJOs |
|
void |
deleteById(Collection<T> ids)
Performs a DELETE statement for a given set of IDs |
|
void |
deleteById(T... ids)
Performs a DELETE statement for a given set of IDs |
|
boolean |
exists(P object)
Checks if a given POJO exists |
|
boolean |
existsById(T id)
Checks if a given ID exists |
|
|
fetch(Field<Z> field,
Z... values)
Find records by a given field and a set of values. |
|
|
fetchOne(Field<Z> field,
Z value)
Find a unique record by a given field and a value. |
|
List<P> |
findAll()
Find all records of the underlying table. |
|
P |
findById(T id)
Find a record of the underlying table by ID. |
|
protected abstract T |
getId(P object)
|
|
Table<R> |
getTable()
Get the underlying table |
|
Class<P> |
getType()
Get the underlying POJO type |
|
void |
insert(Collection<P> objects)
Performs a batch INSERT statement for a given set of POJOs |
|
void |
insert(P... objects)
Performs a batch INSERT statement for a given set of POJOs |
|
void |
insert(P object)
Performs an INSERT statement for a given POJO |
|
void |
setFactory(Factory create)
Inject an attached factory |
|
void |
update(Collection<P> objects)
Performs a batch UPDATE statement for a given set of POJOs |
|
void |
update(P... objects)
Performs a batch UPDATE statement for a given set of POJOs |
|
void |
update(P object)
Performs an UPDATE statement for a given POJO |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DAOImpl(Table<R> table, Class<P> type)
protected DAOImpl(Table<R> table, Class<P> type, Factory create)
Method Detail |
---|
public final void setFactory(Factory create)
public final void insert(P object)
DAO
INSERT
statement for a given POJO
insert
in interface DAO<R extends UpdatableRecord<R>,P,T>
object
- The POJO to be insertedpublic final void insert(P... objects)
DAO
INSERT
statement for a given set of POJOs
insert
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be insertedDAO.insert(Collection)
public final void insert(Collection<P> objects)
DAO
INSERT
statement for a given set of POJOs
insert
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be insertedDAO.insert(Object...)
public final void update(P object)
DAO
UPDATE
statement for a given POJO
update
in interface DAO<R extends UpdatableRecord<R>,P,T>
object
- The POJO to be updatedpublic final void update(P... objects)
DAO
UPDATE
statement for a given set of POJOs
update
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be updatedDAO.update(Collection)
public final void update(Collection<P> objects)
DAO
UPDATE
statement for a given set of POJOs
update
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be updatedDAO.update(Object...)
public final void delete(P... objects)
DAO
DELETE
statement for a given set of POJOs
delete
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be deletedDAO.delete(Collection)
public final void delete(Collection<P> objects)
DAO
DELETE
statement for a given set of POJOs
delete
in interface DAO<R extends UpdatableRecord<R>,P,T>
objects
- The POJOs to be deletedDAO.delete(Object...)
public final void deleteById(T... ids)
DAO
DELETE
statement for a given set of IDs
deleteById
in interface DAO<R extends UpdatableRecord<R>,P,T>
ids
- The IDs to be deletedDAO.delete(Collection)
public final void deleteById(Collection<T> ids)
DAO
DELETE
statement for a given set of IDs
deleteById
in interface DAO<R extends UpdatableRecord<R>,P,T>
ids
- The IDs to be deletedDAO.delete(Object...)
public final boolean exists(P object)
DAO
exists
in interface DAO<R extends UpdatableRecord<R>,P,T>
object
- The POJO whose existence is checked
public final boolean existsById(T id)
DAO
existsById
in interface DAO<R extends UpdatableRecord<R>,P,T>
id
- The ID whose existence is checked
public final long count()
DAO
count
in interface DAO<R extends UpdatableRecord<R>,P,T>
public final List<P> findAll()
DAO
findAll
in interface DAO<R extends UpdatableRecord<R>,P,T>
public final P findById(T id)
DAO
findById
in interface DAO<R extends UpdatableRecord<R>,P,T>
id
- The ID of a record in the underlying table
null
if no record was found.public final <Z> List<P> fetch(Field<Z> field, Z... values)
DAO
fetch
in interface DAO<R extends UpdatableRecord<R>,P,T>
field
- The field to compare values againstvalues
- The accepted values
field IN (values)
public final <Z> P fetchOne(Field<Z> field, Z value)
DAO
fetchOne
in interface DAO<R extends UpdatableRecord<R>,P,T>
field
- The field to compare value againstvalue
- The accepted value
field = value
, or
null
public final Table<R> getTable()
DAO
getTable
in interface DAO<R extends UpdatableRecord<R>,P,T>
public final Class<P> getType()
DAO
getType
in interface DAO<R extends UpdatableRecord<R>,P,T>
protected abstract T getId(P object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |