|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
R
- The record typepublic interface TableRecord<R extends TableRecord<R>>
A record originating from a single table
Method Summary | |
---|---|
int |
deleteUsing(TableField<R,?>... keys)
Deletes this record from the database, based on the value of the provided keys. |
Table<R> |
getTable()
The table from which this record was read |
void |
refreshUsing(TableField<R,?>... keys)
Refresh this record from the database, based on the value of the provided keys. |
int |
storeUsing(TableField<R,?>... keys)
Store this record back to the database. |
Methods inherited from interface org.jooq.FieldProvider |
---|
getField, getField, getField, getFields, getIndex |
Methods inherited from interface org.jooq.Attachable |
---|
attach |
Methods inherited from interface org.jooq.Adapter |
---|
internalAPI |
Method Detail |
---|
Table<R> getTable()
int storeUsing(TableField<R,?>... keys) throws DataAccessException
Depending on the state of the provided keys' value, an
INSERT
or an UPDATE
statement is executed.
INSERT
statement is executedINSERT
statement is executed. jOOQ expects that
primary key values will never change due to the principle of
normalisation in RDBMS. So if client code changes primary key values,
this is interpreted by jOOQ as client code wanting to duplicate this
record.UPDATE
statement is executed.
In either statement, only those fields are inserted/updated, which had
been explicitly set by client code, in order to allow for
DEFAULT
values to be applied by the underlying RDBMS. If no
fields were modified, neither an UPDATE
nor an
INSERT
will be executed.
Possible statements are
INSERT INTO [table] ([modified fields, including keys])
VALUES ([modified values, including keys])
UPDATE [table]
SET [modified fields = modified values, excluding keys]
WHERE [key fields = key values]
keys
- The key fields used for deciding whether to execute an
INSERT
or UPDATE
statement. If an
UPDATE
statement is executed, they are also the
key fields for the UPDATE
statement's
WHERE
clause.
DataAccessException
- if something went wrong executing the queryint deleteUsing(TableField<R,?>... keys) throws DataAccessException
The executed statement is
DELETE FROM [table]
WHERE [key fields = key values]
keys
- The key fields for the DELETE
statement's
WHERE
clause.
DataAccessException
- if something went wrong executing the queryvoid refreshUsing(TableField<R,?>... keys) throws DataAccessException
The executed statement is
SELECT * FROM [table]
WHERE [key fields = key values]
keys
- The key fields for the SELECT
statement's
WHERE
clause.
DataAccessException
- This exception is thrown if
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |