R
- The record typepublic interface TableRecord<R extends TableRecord<R>> extends Record
Modifier and Type | Method and Description |
---|---|
<O extends UpdatableRecord<O>> |
fetchParent(ForeignKey<R,O> key)
Fetch a parent record of this record, given a foreign key
This returns a parent record referenced by this record through a given
foreign key.
|
Table<R> |
getTable()
The table from which this record was read
|
int |
insert()
Store this record to the database using an
INSERT
statement. |
int |
insert(Field<?>... fields)
Store parts of this record to the database using an
INSERT
statement. |
R |
original()
Get this record containing the original values as fetched from the
database.
|
changed, changed, changed, changed, changed, changed, changed, changed, compareTo, equals, field, field, field, fields, fields, fields, fields, fieldsRow, from, from, from, from, fromArray, fromArray, fromArray, fromArray, fromMap, fromMap, fromMap, fromMap, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, hashCode, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, intoArray, intoList, intoMap, intoResultSet, map, original, original, original, reset, reset, reset, reset, setValue, setValue, size, valuesRow
attach, detach
R original()
Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns a new record containing those original values.
original
in interface Record
Record.original(Field)
,
Record.original(int)
,
Record.original(String)
int insert() throws DataAccessException
INSERT
statement.
If you want to enforce statement execution, regardless if the values in
this record were changed, you can explicitly set the changed flags for
all values with Record.changed(boolean)
or for single values with
Record.changed(Field, boolean)
, prior to insertion.
1
if the record was stored to the database. 0
if storing was not necessary.DataAccessException
- if something went wrong executing the queryint insert(Field<?>... fields) throws DataAccessException
INSERT
statement.1
if the record was stored to the database. 0
if storing was not necessary.DataAccessException
- if something went wrong executing the queryinsert()
<O extends UpdatableRecord<O>> O fetchParent(ForeignKey<R,O> key) throws DataAccessException
This returns a parent record referenced by this record through a given
foreign key. If no parent record was found, this returns
null
DataAccessException
- if something went wrong executing the queryForeignKey.fetchParent(Record)
,
ForeignKey.fetchParents(java.util.Collection)
,
ForeignKey.fetchParents(Record...)
Copyright © 2014. All Rights Reserved.