Nature
public class JPAFieldNature extends BaseNature
BaseNature
extension, that gives access to information derived from
field bound JPA annotations.PropertyHolder
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
CASCADE_TYPES |
Property Key for
CascadeType array of a relation. |
static java.lang.String |
LOB |
Property Key for
Lob |
static java.lang.String |
STRING_ENUM_TYPE |
Property Key for
Enumerated |
static java.lang.String |
TEMPORAL_TYPE |
Property Key for
Temporal |
Constructor | Description |
---|---|
JPAFieldNature(PropertyHolder holder) |
Instantiate a
JPAFieldNature to access the given
PropertyHolder . |
Modifier and Type | Method | Description |
---|---|---|
javax.persistence.FetchType |
getBasicFetch() |
|
javax.persistence.CascadeType[] |
getCascadeTypes() |
|
java.lang.String |
getColumnDefinition() |
Returns the 'columnDefinition' value of the @Column annotation.
|
java.lang.Boolean |
getColumnInsertable() |
|
java.lang.Integer |
getColumnLength() |
|
java.lang.String |
getColumnName() |
Returns the name of the @Column annotation.
|
java.lang.Boolean |
getColumnNullable() |
|
java.lang.Integer |
getColumnPrecision() |
|
java.lang.Integer |
getColumnScale() |
|
java.lang.String |
getColumnTable() |
|
java.lang.Boolean |
getColumnUnique() |
|
java.lang.Boolean |
getColumnUpdatable() |
|
FieldInfo |
getFieldInfo() |
Get the underlying
FieldInfo (the PropertyHolder ). |
java.lang.String |
getGeneratedValueGenerator() |
Get the
GeneratedValue.generator() |
javax.persistence.GenerationType |
getGeneratedValueStrategy() |
Get the
GeneratedValue.strategy() |
java.lang.String |
getId() |
Returns the fully qualified name of the Nature.
|
java.lang.String |
getJoinColumnColumnDefinition() |
|
java.lang.Boolean |
getJoinColumnInsertable() |
|
java.lang.String |
getJoinColumnName() |
|
java.lang.Boolean |
getJoinColumnNullable() |
|
java.lang.String |
getJoinColumnReferencedColumnName() |
|
java.lang.String |
getJoinColumnTable() |
|
java.lang.Boolean |
getJoinColumnUnique() |
|
java.lang.Boolean |
getJoinColumnUpdatable() |
|
java.lang.String |
getJoinTableCatalog() |
|
javax.persistence.JoinColumn[] |
getJoinTableInverseJoinColumns() |
|
javax.persistence.JoinColumn[] |
getJoinTableJoinColumns() |
|
java.lang.String |
getJoinTableName() |
|
java.lang.String |
getJoinTableSchema() |
|
java.lang.Class<?> |
getRelationCollectionType() |
|
java.lang.String |
getRelationMappedBy() |
|
java.lang.Class<?> |
getRelationTargetEntity() |
|
javax.persistence.TemporalType |
getTemporalType() |
|
boolean |
isBasicOptional() |
|
boolean |
isId() |
|
boolean |
isLob() |
|
boolean |
isManyToMany() |
|
boolean |
isManyToManyInverseCopy() |
|
boolean |
isManyToOne() |
|
boolean |
isOneToMany() |
|
boolean |
isOneToOne() |
|
boolean |
isRelationLazyFetch() |
|
boolean |
isRelationOptional() |
|
boolean |
isStringEnumType() |
|
boolean |
isTransient() |
|
void |
setBasicFetch(javax.persistence.FetchType fetch) |
|
void |
setBasicOptional(boolean optional) |
|
void |
setCascadeTypes(javax.persistence.CascadeType[] cascadeTypes) |
|
void |
setColumnDefinition(java.lang.String columnDefinition) |
Sets the 'columnDefinition' value of the @Column annotation.
|
void |
setColumnInsertable(boolean insertable) |
|
void |
setColumnLength(int length) |
|
void |
setColumnName(java.lang.String name) |
Set the name value of the @Column annotation.
|
void |
setColumnNullable(boolean nullable) |
|
void |
setColumnPrecision(int precision) |
|
void |
setColumnScale(int scale) |
|
void |
setColumnTable(java.lang.String table) |
|
void |
setColumnUnique(boolean unique) |
|
void |
setColumnUpdatable(boolean updatable) |
|
void |
setGeneratedValueGenerator(java.lang.String generator) |
Set the
GeneratedValue.generator() |
void |
setGeneratedValueStrategy(javax.persistence.GenerationType strategy) |
Set the
GeneratedValue.strategy() |
void |
setId(boolean isId) |
|
void |
setJoinColumnColumnDefinition(java.lang.String columnDefinition) |
|
void |
setJoinColumnInsertable(boolean insertable) |
|
void |
setJoinColumnName(java.lang.String name) |
|
void |
setJoinColumnNullable(boolean nullable) |
|
void |
setJoinColumnReferencedColumnName(java.lang.String referencedColumnName) |
|
void |
setJoinColumnTable(java.lang.String table) |
|
void |
setJoinColumnUnique(boolean unique) |
|
void |
setJoinColumnUpdatable(boolean updatable) |
|
void |
setJoinTableCatalog(java.lang.String catalog) |
|
void |
setJoinTableInverseJoinColumns(javax.persistence.JoinColumn[] inverseJoinColumns) |
|
void |
setJoinTableJoinColumns(javax.persistence.JoinColumn[] joinColumns) |
|
void |
setJoinTableName(java.lang.String tablename) |
|
void |
setJoinTableSchema(java.lang.String schema) |
|
void |
setLob(boolean isLob) |
|
void |
setManyToMany(boolean hasManyToMany) |
|
void |
setManyToManyInverseCopy(boolean copySettingsInverse) |
|
void |
setManyToOne(boolean hasManyToOne) |
|
void |
setOneToMany(boolean hasOneToMany) |
|
void |
setOneToOne(boolean hasOneToOne) |
|
void |
setRelationCollectionType(java.lang.Class<?> collectionType) |
|
void |
setRelationLazyFetch(boolean lazyFetch) |
|
void |
setRelationMappedBy(java.lang.String mappedBy) |
|
void |
setRelationOptional(boolean optional) |
|
void |
setRelationTargetEntity(java.lang.Class<?> targetEntity) |
|
void |
setStringEnumType(boolean isStringEnumType) |
|
void |
setTemporalType(javax.persistence.TemporalType temporalType) |
|
void |
setTransient(boolean isTransient) |
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
public static final java.lang.String TEMPORAL_TYPE
Temporal
public static final java.lang.String LOB
Lob
public static final java.lang.String STRING_ENUM_TYPE
Enumerated
public static final java.lang.String CASCADE_TYPES
CascadeType
array of a relation.public JPAFieldNature(PropertyHolder holder)
JPAFieldNature
to access the given
PropertyHolder
.holder
- The underlying PropertyHolder
(obviously a
FieldInfo
).PropertyHolder
public final java.lang.String getId()
Nature.getId()
public FieldInfo getFieldInfo()
FieldInfo
(the PropertyHolder
).FieldInfo
. If the PropertyHolder
was not of type FieldInfo
, null is returned.public final void setBasicFetch(javax.persistence.FetchType fetch)
fetch
- The value of Basic.fetch()
BASIC_FETCH
public final javax.persistence.FetchType getBasicFetch()
Basic.fetch()
BASIC_FETCH
public final void setBasicOptional(boolean optional)
optional
- The value of Basic.optional()
BASIC_OPTIONAL
public final boolean isBasicOptional()
Basic.optional()
was set to
true on the field.BASIC_OPTIONAL
public final void setColumnName(java.lang.String name)
name
- The value of Column.name()
COLUMN_NAME
public final java.lang.String getColumnName()
Column.name()
COLUMN_NAME
public final void setColumnDefinition(java.lang.String columnDefinition)
columnDefinition
- The value of
Column.columnDefinition()
COLUMN_DEFINITION
public final java.lang.String getColumnDefinition()
Column.columnDefinition()
COLUMN_DEFINITION
public final void setColumnLength(int length)
length
- The value of Column.length()
COLUMN_LENGTH
public final java.lang.Integer getColumnLength()
Column.length()
COLUMN_LENGTH
public final void setColumnInsertable(boolean insertable)
insertable
- The value of Column.insertable()
COLUMN_INSERTABLE
public final java.lang.Boolean getColumnInsertable()
Column.insertable()
COLUMN_INSERTABLE
public final void setColumnNullable(boolean nullable)
nullable
- The value of Column.nullable()
COLUMN_NULLABLE
public final java.lang.Boolean getColumnNullable()
Column.nullable()
COLUMN_NULLABLE
public final void setColumnPrecision(int precision)
precision
- The value of Column.precision()
COLUMN_PRECISION
public final java.lang.Integer getColumnPrecision()
Column.precision()
COLUMN_PRECISION
public final void setColumnScale(int scale)
scale
- The value of Column.scale()
COLUMN_SCALE
public final java.lang.Integer getColumnScale()
Column.scale()
COLUMN_SCALE
public final void setColumnTable(java.lang.String table)
table
- The value of Column.table()
COLUMN_TABLE
public final java.lang.String getColumnTable()
Column.table()
COLUMN_TABLE
public final void setColumnUnique(boolean unique)
unique
- The value of Column.unique()
COLUMN_UNIQUE
public final java.lang.Boolean getColumnUnique()
Column.unique()
COLUMN_UNIQUE
public final void setColumnUpdatable(boolean updatable)
updatable
- The value of Column.updatable()
COLUMN_UPDATABLE
public final java.lang.Boolean getColumnUpdatable()
Column.updatable()
COLUMN_UPDATABLE
public final void setId(boolean isId)
isId
- If Id
was found on that property.ID
public final boolean isId()
Id
was set on the property,
else false.ID
public final void setTransient(boolean isTransient)
isTransient
- if Transient
was found on that
property.TRANSIENT
public final boolean isTransient()
Transient
was set on the
property, else falseTRANSIENT
public void setJoinTableName(java.lang.String tablename)
tablename
- The value of JoinTable.name()
JOINTABLE_NAME
public java.lang.String getJoinTableName()
JoinTable.name()
JOINTABLE_NAME
public void setJoinTableCatalog(java.lang.String catalog)
catalog
- The value of JoinTable.catalog()
JOINTABLE_CATALOG
public java.lang.String getJoinTableCatalog()
JoinTable.catalog()
JOINTABLE_CATALOG
public void setJoinTableSchema(java.lang.String schema)
schema
- The value of JoinTable.schema()
JOINTABLE_SCHEMA
public java.lang.String getJoinTableSchema()
JoinTable.schema()
#TABLE_SCHEMA
public void setJoinTableJoinColumns(javax.persistence.JoinColumn[] joinColumns)
joinColumns
- The value of JoinTable.joinColumns()
JOINTABLE_JOINCOLUMNS
public javax.persistence.JoinColumn[] getJoinTableJoinColumns()
JoinTable.joinColumns()
JOINTABLE_JOINCOLUMNS
public void setJoinTableInverseJoinColumns(javax.persistence.JoinColumn[] inverseJoinColumns)
inverseJoinColumns
- The value of
JoinTable.inverseJoinColumns()
JOINTABLE_INVERSE_JOINCOLUMNS
public javax.persistence.JoinColumn[] getJoinTableInverseJoinColumns()
JoinTable.inverseJoinColumns()
JOINTABLE_INVERSE_JOINCOLUMNS
public final void setJoinColumnName(java.lang.String name)
name
- The value of JoinColumn.name()
.JOINCOLUMN_NAME
public final java.lang.String getJoinColumnName()
JoinColumn.name()
.JOINCOLUMN_NAME
public final void setJoinColumnReferencedColumnName(java.lang.String referencedColumnName)
referencedColumnName
- The value of
JoinColumn.referencedColumnName()
.JOINCOLUMN_REFERENCEDCOLUMNNAME
public final java.lang.String getJoinColumnReferencedColumnName()
JoinColumn.referencedColumnName()
.JOINCOLUMN_REFERENCEDCOLUMNNAME
public final void setJoinColumnUnique(boolean unique)
unique
- The value of JoinColumn.unique()
.JOINCOLUMN_UNIQUE
public final java.lang.Boolean getJoinColumnUnique()
JoinColumn.unique()
.JOINCOLUMN_UNIQUE
public final void setJoinColumnNullable(boolean nullable)
nullable
- The value of JoinColumn.nullable()
.JOINCOLUMN_NULLABLE
public final java.lang.Boolean getJoinColumnNullable()
JoinColumn.nullable()
.JOINCOLUMN_NULLABLE
public final void setJoinColumnInsertable(boolean insertable)
insertable
- The value of JoinColumn.insertable()
.JOINCOLUMN_INSERTABLE
public final java.lang.Boolean getJoinColumnInsertable()
JoinColumn.insertable()
.JOINCOLUMN_INSERTABLE
public final void setJoinColumnUpdatable(boolean updatable)
updatable
- The value of JoinColumn.updatable()
.JOINCOLUMN_UPDATABLE
public final java.lang.Boolean getJoinColumnUpdatable()
JoinColumn.updatable()
.JOINCOLUMN_UPDATABLE
public final void setJoinColumnColumnDefinition(java.lang.String columnDefinition)
columnDefinition
- The value of
JoinColumn.columnDefinition()
.JOINCOLUMN_COLUMNDEFINITION
public final java.lang.String getJoinColumnColumnDefinition()
JoinColumn.columnDefinition()
.JOINCOLUMN_COLUMNDEFINITION
public final void setJoinColumnTable(java.lang.String table)
table
- The value of JoinColumn.table()
.JOINCOLUMN_TABLE
public final java.lang.String getJoinColumnTable()
JoinColumn.table()
.JOINCOLUMN_TABLE
public void setOneToOne(boolean hasOneToOne)
hasOneToOne
- if OneToOne
was found on that
property.ONETOONE
public boolean isOneToOne()
OneToOne
was set on the property,
else false.ONETOONE
public void setManyToOne(boolean hasManyToOne)
hasManyToOne
- if ManyToOne
was found on that
property.MANYTOONE
public boolean isManyToOne()
ManyToOne
was set on the property,
else false.MANYTOONE
public void setOneToMany(boolean hasOneToMany)
hasOneToMany
- if OneToMany
was found on that
property.ONETOMANY
public boolean isOneToMany()
OneToMany
was set on the property,
else false.ONETOMANY
public void setManyToMany(boolean hasManyToMany)
hasManyToMany
- if ManyToMany
was found on that
property.MANYTOMANY
public boolean isManyToMany()
ManyToOne
was set on the property,
else false.MANYTOMANY
public void setManyToManyInverseCopy(boolean copySettingsInverse)
copySettingsInverse
- set this to true if a ManyToMany related field shall copy all
JoinTable
relevant information from the other side of
the relation (inverting the JoinColumn
settings).MANYTOMANY_INVERSECOPY
public boolean isManyToManyInverseCopy()
JoinTable
relevant information from the other side of the
relation (inverting the JoinColumn
settings).MANYTOMANY_INVERSECOPY
public void setRelationTargetEntity(java.lang.Class<?> targetEntity)
targetEntity
- The value of OneToOne.targetEntity()
, OneToMany.targetEntity()
,
ManyToOne.targetEntity()
,
ManyToMany.targetEntity()
, depending
to the relation type.RELATION_TARGETENTITY
public java.lang.Class<?> getRelationTargetEntity()
OneToOne.targetEntity()
,
OneToMany.targetEntity()
,
ManyToOne.targetEntity()
,
ManyToMany.targetEntity()
, depending on
the relation type. Returns null iff no relational annotation was
set on the field.RELATION_TARGETENTITY
public void setRelationLazyFetch(boolean lazyFetch)
lazyFetch
- true if OneToOne.fetch()
,
OneToMany.fetch()
,
ManyToOne.fetch()
,
ManyToMany.fetch()
is set to
FetchType.LAZY
, depending on the
relation type.RELATION_LAZYFETCH
public boolean isRelationLazyFetch()
OneToOne.fetch()
,
OneToMany.fetch()
,
ManyToOne.fetch()
,
ManyToMany.fetch()
is set to
FetchType.LAZY
, depending on the
relation type.RELATION_LAZYFETCH
public void setRelationMappedBy(java.lang.String mappedBy)
mappedBy
- The content of OneToMany.mappedBy()
,
ManyToMany.mappedBy()
, depending on
the relation type.RELATION_MAPPEDBY
public java.lang.String getRelationMappedBy()
OneToMany.mappedBy()
,
ManyToMany.mappedBy()
, depending on the
relation type. If no (or an empty) String was set, null is
returned!RELATION_MAPPEDBY
public java.lang.Class<?> getRelationCollectionType()
OneToMany
,
ManyToMany
, depending on the relation
type. Returns null iff none of the above relational annotations
was set on the field.RELATION_COLLECTIONTYPE
public void setRelationCollectionType(java.lang.Class<?> collectionType)
collectionType
- Set the type of Collection being used by
OneToMany
,
ManyToMany
, depending on the
relation type.RELATION_COLLECTIONTYPE
public void setRelationOptional(boolean optional)
optional
- Set the value of OneToOne.optional()
, ManyToOne.optional()
, depending on
the relation type.RELATION_OPTIONAL
public boolean isRelationOptional()
OneToOne.optional()
,
ManyToOne.optional()
was set to true,
depending on the relation type.RELATION_OPTIONAL
public void setGeneratedValueStrategy(javax.persistence.GenerationType strategy)
GeneratedValue.strategy()
strategy
- GENERATEDVALUE_STRATEGY
public javax.persistence.GenerationType getGeneratedValueStrategy()
GeneratedValue.strategy()
GENERATEDVALUE_STRATEGY
public void setGeneratedValueGenerator(java.lang.String generator)
GeneratedValue.generator()
strategy
- GENERATEDVALUE_STRATEGY
public java.lang.String getGeneratedValueGenerator()
GeneratedValue.generator()
GENERATEDVALUE_STRATEGY
public javax.persistence.TemporalType getTemporalType()
TemporalType
of field.TEMPORAL_TYPE
public void setTemporalType(javax.persistence.TemporalType temporalType)
temporalType
- set the TemporalType
of field.TEMPORAL_TYPE
public boolean isLob()
Lob
was set on the
property, else falseLOB
public void setLob(boolean isLob)
isLob
- if Lob
was found on that
property.LOB
public boolean isStringEnumType()
Enumerated
with value
EnumType
STRING was set on the
property, else falseSTRING_ENUM_TYPE
public void setStringEnumType(boolean isStringEnumType)
isStringEnumType
- if Enumerated
with value
EnumType
STRING was found on that
property.STRING_ENUM_TYPE
public javax.persistence.CascadeType[] getCascadeTypes()
CascadeType
array of relation.CASCADE_TYPES
public void setCascadeTypes(javax.persistence.CascadeType[] cascadeTypes)
cascadeTypes
- set the CascadeType
array of relation.CASCADE_TYPES
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com