Maps a Java field or property to a database column.
This may be applied to a Java field for direct field updates/reads, or to a Java property method for property-based access column values.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies the database sequence to be used for generating values for the annotated field or method.Class<? extends ColumnValueGenerator> Specifies a custom implementation ofColumnValueGeneratorto dynamically generate or compute values for the database column during runtime.The remote column name to which this column is joined.booleanJoin using the the current column's name.
-
Element Details
-
value
String valueSpecifies the name of the database column that the annotated field or method maps to.This value is used for static column mapping in the Litebridge ORM.
- Returns:
- The name of the column in the database table.
-
joinOn
String joinOnThe remote column name to which this column is joined.Only the column name should be specified; the table is inferred from the field type.
- Returns:
- The join column name as a string. If left empty or not specified, no join condition is associated with this column.
- Default:
""
-
joinUsing
boolean joinUsingJoin using the the current column's name.Indicates that the mapping should use the current column's name as part of a "USING" clause when performing a SQL join operation.
- Returns:
- true if the "using" clause should be applied; false otherwise.
- Default:
false
-
generator
Class<? extends ColumnValueGenerator> generatorSpecifies a custom implementation ofColumnValueGeneratorto dynamically generate or compute values for the database column during runtime. This attribute allows for overriding the default behavior of static column value assignment by providing a generator class that implements the logic for value computation.- Returns:
- A class that extends
ColumnValueGenerator, which will be used to generate the column value. If not specified, the default isColumnValueGenerator.class, indicating no custom generator is used. The class must have a no-argument constructor.
- Default:
org.litebridge.db.spi.generator.ColumnValueGenerator.class
-
generateUsingSequence
String generateUsingSequenceSpecifies the database sequence to be used for generating values for the annotated field or method. When provided, this sequence will be used to automatically populate the column value during insert operations.- Returns:
- The name of the database sequence to use. If not specified, no sequence will be used.
- Default:
""
-