ENTITY - The type of the entity.BUILDER - The class that is used to build new entity instances.public interface Column<ENTITY,BUILDER>
Most users of hrorm will have no need to directly use this.
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
The name of the database column this instance represents.
|
String |
getPrefix()
The prefix that should be used for this column when generating
SQL.
|
default boolean |
isParentColumn()
Flag indicating whether this column represents a reference to a parent entity.
|
default boolean |
isPrimaryKey()
Flag indicating whether or not this column is the primary key of the table
|
void |
notNull()
Calling this method will enforce a not-null constraint on this column.
|
PopulateResult |
populate(BUILDER constructor,
ResultSet resultSet)
Populates the object with the data read from the database.
|
void |
setValue(ENTITY item,
int index,
PreparedStatement preparedStatement)
Sets a value onto the prepared statement based on the state of the object passed.
|
Set<Integer> |
supportedTypes()
The members of
java.sql.Types that this column should support. |
Column<ENTITY,BUILDER> |
withPrefix(String newPrefix,
Prefixer prefixer)
Make a new instance of the column, identical to this instance, except with a
new prefix.
|
String getName()
String getPrefix()
void setValue(ENTITY item, int index, PreparedStatement preparedStatement) throws SQLException
item - The object to read the data from.index - Where in the prepared statement to set the read valuepreparedStatement - The statement being populatedSQLException - allowed for PreparedStatement operationsdefault boolean isPrimaryKey()
void notNull()
default boolean isParentColumn()
PopulateResult populate(BUILDER constructor, ResultSet resultSet) throws SQLException
constructor - The object being populatedresultSet - The result said being readSQLException - allowed for ResultSet operationsColumn<ENTITY,BUILDER> withPrefix(String newPrefix, Prefixer prefixer)
newPrefix - The new prefixprefixer - The source for new prefixesCopyright © 2019. All rights reserved.