ENTITY
- The type whose persistence is managed by this Dao
.PARENT
- The type of the parent (if any) of type ENTITY
.BUILDER
- The type of object that can build an ENTITY
instance.PARENTBUILDER
- The type of the object that can build a PARENT
instance.public class NoBackReferenceParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER> extends Object implements ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER>
Most users of hrorm will have no need to directly use this.
Constructor and Description |
---|
NoBackReferenceParentColumn(String name,
String prefix) |
Modifier and Type | Method and Description |
---|---|
String |
getName()
The name of the database column this instance represents.
|
Long |
getParentId(ENTITY entity) |
String |
getPrefix()
The prefix that should be used for this column when generating
SQL.
|
String |
getSqlTypeName()
Returns the name of the column type in SQL, e.g.
|
boolean |
isNullable()
Indicator of whether or not this column is nullable or not.
|
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 item,
ResultSet resultSet)
Populates the object with the data read from the database.
|
void |
setParentPrimaryKey(PrimaryKey<PARENT,PARENTBUILDER> primaryKey) |
void |
setSqlTypeName(String sqlTypeName) |
BiConsumer<BUILDER,PARENT> |
setter() |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isParentColumn
public void setParentPrimaryKey(PrimaryKey<PARENT,PARENTBUILDER> primaryKey)
setParentPrimaryKey
in interface ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER>
public BiConsumer<BUILDER,PARENT> setter()
setter
in interface ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER>
public String getName()
Column
public String getPrefix()
Column
public PopulateResult populate(BUILDER item, ResultSet resultSet)
Column
public void setValue(ENTITY item, int index, PreparedStatement preparedStatement)
Column
public Column<ENTITY,BUILDER> withPrefix(String newPrefix, Prefixer prefixer)
Column
withPrefix
in interface Column<ENTITY,BUILDER>
newPrefix
- The new prefixprefixer
- The source for new prefixespublic boolean isPrimaryKey()
Column
isPrimaryKey
in interface Column<ENTITY,BUILDER>
public void notNull()
Column
public Set<Integer> supportedTypes()
Column
java.sql.Types
that this column should support.supportedTypes
in interface Column<ENTITY,BUILDER>
public Long getParentId(ENTITY entity)
getParentId
in interface ParentColumn<ENTITY,PARENT,BUILDER,PARENTBUILDER>
public boolean isNullable()
Column
isNullable
in interface Column<ENTITY,BUILDER>
public String getSqlTypeName()
Column
String
,
"decimal" for BigDecimal
.getSqlTypeName
in interface Column<ENTITY,BUILDER>
public void setSqlTypeName(String sqlTypeName)
setSqlTypeName
in interface Column<ENTITY,BUILDER>
Copyright © 2019. All rights reserved.