@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Row
Table
subclass.
This annotation is only required if table name is different from class name or if a name
translator is needed.Modifier and Type | Optional Element and Description |
---|---|
int |
fetchSize
JDBC fetch size to use for prepared statement
Table.selectAll() ,
Table.selectAllCustom(String, Object...) , or other Table select method that
does not use a where condition.. |
FieldAccessType |
fieldAccess
Specifies how all fields in row be accessed when no
Column annotation is specified
or when Column.fieldAccess() is FieldAccessType.Default . |
boolean |
inhertedFields
Indicates that declared fields from the entire class hierarchy are to be used.
|
java.lang.Class<? extends NameTranslator>[] |
nameTranslators
Classes for providing sql names in place of class and field names.
|
java.lang.String[] |
primaryKeyFields
Defines the primary keys for table.
|
boolean |
readOnly
Indicates if operations using this row should never modify the database.
|
int |
selectInitialCapacity
Initial capacity of collection/map that will contain the results from
Table.selectAll() ,
Table.selectAllCustom(String, Object...) , or other Table select method that
does not use a where condition. |
java.lang.String |
tableName
SQL table name for row.
|
public abstract java.lang.String tableName
Class.getSimpleName()
or obtained by NameTranslator.translate(String, Class)
public abstract java.lang.Class<? extends NameTranslator>[] nameTranslators
public abstract boolean readOnly
ReadOnlyException
when modify operations are used;
false to allow all operationspublic abstract int selectInitialCapacity
Table.selectAll()
,
Table.selectAllCustom(String, Object...)
, or other Table
select method that
does not use a where condition. Sets this value with SelectOperation.setDefaultReadAllSize(int)
.
For queries that return large result sets, setting the initial capacity close to the number of rows in result set may improve performance since collection/map that holds results will not need to be resized as much.
public abstract boolean inhertedFields
Row
annotationpublic abstract int fetchSize
Table.selectAll()
,
Table.selectAllCustom(String, Object...)
, or other Table
select method that
does not use a where condition.. Setting fetch size may improve memory
and/or performance for large result sets.Statement.setFetchSize(int)
public abstract java.lang.String[] primaryKeyFields
Column.primaryKey()
or Column.identity()
.
The advantage of this annotation is that the order of the keys listed is the order used
by SqlOperation.setParameters(Object...)
.
Some JVM's do not reflect the fields in order of declaration so this method provides a
predictable order for primary keys.Column
annotationspublic abstract FieldAccessType fieldAccess
Column
annotation is specified
or when Column.fieldAccess()
is FieldAccessType.Default
.
Use FieldAccessType.Method
to read/write all field values with getter/setter. Public
getter/setter methods are required.
Use FieldAccessType.Direct
to read/write all field values with direct access
Field.equals(Object)
and Field.set(Object, Object)
. No getter/setter are required.
If no Row
annotation is specified or fieldAccess()
is FieldAccessType.Default
then Column.fieldAccess()
is used and fieldAccess()
is ignored.
If both fieldAccess()
and Column.fieldAccess()
are FieldAccessType.Default
,
then getter/setter methods are used. This is the behavior of versions prior to 3.4.
FieldAccessType.Method
, FieldAccessType.Direct
, or FieldAccessType.Default