T - The child entity typeP - The type of the parentpublic class ParentColumnImpl<T,P> extends Object implements ParentColumn<T,P>
Most users of hrorm will have no need to directly use this.
| Constructor and Description |
|---|
ParentColumnImpl(String name,
String prefix,
Function<T,P> getter,
BiConsumer<T,P> setter) |
ParentColumnImpl(String name,
String prefix,
Function<T,P> getter,
BiConsumer<T,P> setter,
PrimaryKey<P> parentPrimaryKey,
boolean nullable) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
String |
getPrefix() |
boolean |
isPrimaryKey() |
void |
notNull()
Calling this method will enforce a not-null constraint on this column.
|
PopulateResult |
populate(T item,
ResultSet resultSet)
Populates the object with the data read from the database.
|
void |
setParentPrimaryKey(PrimaryKey<P> parentPrimaryKey) |
BiConsumer<T,P> |
setter() |
void |
setValue(T item,
int index,
PreparedStatement preparedStatement)
Sets a value onto the prepared statement based on the state of the object passed.
|
TypedColumn<T> |
withPrefix(String prefix,
Prefixer prefixer)
Make a new instance of the column, identical to this instance, except with a
new prefix.
|
public ParentColumnImpl(String name, String prefix, Function<T,P> getter, BiConsumer<T,P> setter)
public ParentColumnImpl(String name, String prefix, Function<T,P> getter, BiConsumer<T,P> setter, PrimaryKey<P> parentPrimaryKey, boolean nullable)
public String getName()
getName in interface TypedColumn<T>public String getPrefix()
getPrefix in interface TypedColumn<T>public PopulateResult populate(T item, ResultSet resultSet) throws SQLException
TypedColumnpopulate in interface TypedColumn<T>item - The object being populatedresultSet - The result said being readSQLException - allowed for ResultSet operationspublic void setValue(T item, int index, PreparedStatement preparedStatement) throws SQLException
TypedColumnsetValue in interface TypedColumn<T>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 TypedColumn<T> withPrefix(String prefix, Prefixer prefixer)
TypedColumnwithPrefix in interface TypedColumn<T>prefix - The new prefixprefixer - The source for new prefixespublic boolean isPrimaryKey()
isPrimaryKey in interface TypedColumn<T>public void notNull()
TypedColumnnotNull in interface TypedColumn<T>public BiConsumer<T,P> setter()
setter in interface ParentColumn<T,P>public void setParentPrimaryKey(PrimaryKey<P> parentPrimaryKey)
setParentPrimaryKey in interface ParentColumn<T,P>Copyright © 2018. All rights reserved.