ENTITY
- the entity this column belongs toJOINED
- the entity being joinedENTITYBUILDER
- the class that can construct new entity instancesJOINEDBUILDER
- the class that can construct instances of the joined entitypublic class JoinColumn<ENTITY,JOINED,ENTITYBUILDER,JOINEDBUILDER> extends Object implements Column<ENTITY,ENTITYBUILDER>
Most users of hrorm will have no need to directly use this.
Constructor and Description |
---|
JoinColumn(String name,
String joinedTablePrefix,
Prefixer prefixer,
Function<ENTITY,JOINED> getter,
BiConsumer<ENTITYBUILDER,JOINED> setter,
DaoDescriptor<JOINED,JOINEDBUILDER> daoDescriptor,
boolean nullable) |
Modifier and Type | Method and Description |
---|---|
List<Column<JOINED,JOINEDBUILDER>> |
getDataColumns() |
String |
getJoinedTablePrefix() |
String |
getJoinedTablePrimaryKeyName() |
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.
|
String |
getTable() |
List<JoinColumn<JOINED,?,JOINEDBUILDER,?>> |
getTransitiveJoins() |
void |
notNull()
Calling this method will enforce a not-null constraint on this column.
|
PopulateResult |
populate(ENTITYBUILDER builder,
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. |
JoinColumn<ENTITY,JOINED,ENTITYBUILDER,JOINEDBUILDER> |
withPrefix(String newPrefix,
Prefixer prefixer)
Make a new instance of the column, identical to this instance, except with a
new prefix.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isParentColumn, isPrimaryKey
public JoinColumn(String name, String joinedTablePrefix, Prefixer prefixer, Function<ENTITY,JOINED> getter, BiConsumer<ENTITYBUILDER,JOINED> setter, DaoDescriptor<JOINED,JOINEDBUILDER> daoDescriptor, boolean nullable)
public List<JoinColumn<JOINED,?,JOINEDBUILDER,?>> getTransitiveJoins()
public String getTable()
public String getName()
Column
getName
in interface Column<ENTITY,ENTITYBUILDER>
public String getJoinedTablePrefix()
public String getPrefix()
Column
getPrefix
in interface Column<ENTITY,ENTITYBUILDER>
public PopulateResult populate(ENTITYBUILDER builder, ResultSet resultSet) throws SQLException
Column
populate
in interface Column<ENTITY,ENTITYBUILDER>
builder
- The object being populatedresultSet
- The result said being readSQLException
- allowed for ResultSet
operationspublic void setValue(ENTITY item, int index, PreparedStatement preparedStatement) throws SQLException
Column
setValue
in interface Column<ENTITY,ENTITYBUILDER>
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
operationspublic JoinColumn<ENTITY,JOINED,ENTITYBUILDER,JOINEDBUILDER> withPrefix(String newPrefix, Prefixer prefixer)
Column
withPrefix
in interface Column<ENTITY,ENTITYBUILDER>
newPrefix
- The new prefixprefixer
- The source for new prefixespublic List<Column<JOINED,JOINEDBUILDER>> getDataColumns()
public void notNull()
Column
notNull
in interface Column<ENTITY,ENTITYBUILDER>
public String getJoinedTablePrimaryKeyName()
public Set<Integer> supportedTypes()
Column
java.sql.Types
that this column should support.supportedTypes
in interface Column<ENTITY,ENTITYBUILDER>
Copyright © 2019. All rights reserved.