|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.core.nature.BaseNature
org.castor.cpa.jpa.natures.JPAFieldNature
public class JPAFieldNature
A BaseNature extension, that gives access to information derived from
field bound JPA annotations.
PropertyHolder| Field Summary | |
|---|---|
static String |
CASCADE_TYPES
Property Key for CascadeType array of a relation. |
static String |
LOB
Property Key for Lob |
static String |
STRING_ENUM_TYPE
Property Key for Enumerated |
static String |
TEMPORAL_TYPE
Property Key for Temporal |
| Constructor Summary | |
|---|---|
JPAFieldNature(PropertyHolder holder)
Instantiate a JPAFieldNature to access the given
PropertyHolder. |
|
| Method Summary | |
|---|---|
javax.persistence.FetchType |
getBasicFetch()
|
javax.persistence.CascadeType[] |
getCascadeTypes()
|
String |
getColumnDefinition()
Returns the 'columnDefinition' value of the @Column annotation. |
Boolean |
getColumnInsertable()
|
Integer |
getColumnLength()
|
String |
getColumnName()
Returns the name of the @Column annotation. |
Boolean |
getColumnNullable()
|
Integer |
getColumnPrecision()
|
Integer |
getColumnScale()
|
String |
getColumnTable()
|
Boolean |
getColumnUnique()
|
Boolean |
getColumnUpdatable()
|
FieldInfo |
getFieldInfo()
Get the underlying FieldInfo (the PropertyHolder). |
String |
getGeneratedValueGenerator()
Get the GeneratedValue.generator() |
javax.persistence.GenerationType |
getGeneratedValueStrategy()
Get the GeneratedValue.strategy() |
String |
getId()
|
String |
getJoinColumnColumnDefinition()
|
Boolean |
getJoinColumnInsertable()
|
String |
getJoinColumnName()
|
Boolean |
getJoinColumnNullable()
|
String |
getJoinColumnReferencedColumnName()
|
String |
getJoinColumnTable()
|
Boolean |
getJoinColumnUnique()
|
Boolean |
getJoinColumnUpdatable()
|
String |
getJoinTableCatalog()
|
javax.persistence.JoinColumn[] |
getJoinTableInverseJoinColumns()
|
javax.persistence.JoinColumn[] |
getJoinTableJoinColumns()
|
String |
getJoinTableName()
|
String |
getJoinTableSchema()
|
Class<?> |
getRelationCollectionType()
|
String |
getRelationMappedBy()
|
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(String columnDefinition)
Sets the 'columnDefinition' value of the @Column annotation. |
void |
setColumnInsertable(boolean insertable)
|
void |
setColumnLength(int length)
|
void |
setColumnName(String name)
Set the name value of the @Column annotation. |
void |
setColumnNullable(boolean nullable)
|
void |
setColumnPrecision(int precision)
|
void |
setColumnScale(int scale)
|
void |
setColumnTable(String table)
|
void |
setColumnUnique(boolean unique)
|
void |
setColumnUpdatable(boolean updatable)
|
void |
setGeneratedValueGenerator(String generator)
Set the GeneratedValue.generator() |
void |
setGeneratedValueStrategy(javax.persistence.GenerationType strategy)
Set the GeneratedValue.strategy() |
void |
setId(boolean isId)
|
void |
setJoinColumnColumnDefinition(String columnDefinition)
|
void |
setJoinColumnInsertable(boolean insertable)
|
void |
setJoinColumnName(String name)
|
void |
setJoinColumnNullable(boolean nullable)
|
void |
setJoinColumnReferencedColumnName(String referencedColumnName)
|
void |
setJoinColumnTable(String table)
|
void |
setJoinColumnUnique(boolean unique)
|
void |
setJoinColumnUpdatable(boolean updatable)
|
void |
setJoinTableCatalog(String catalog)
|
void |
setJoinTableInverseJoinColumns(javax.persistence.JoinColumn[] inverseJoinColumns)
|
void |
setJoinTableJoinColumns(javax.persistence.JoinColumn[] joinColumns)
|
void |
setJoinTableName(String tablename)
|
void |
setJoinTableSchema(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(Class<?> collectionType)
|
void |
setRelationLazyFetch(boolean lazyFetch)
|
void |
setRelationMappedBy(String mappedBy)
|
void |
setRelationOptional(boolean optional)
|
void |
setRelationTargetEntity(Class<?> targetEntity)
|
void |
setStringEnumType(boolean isStringEnumType)
|
void |
setTemporalType(javax.persistence.TemporalType temporalType)
|
void |
setTransient(boolean isTransient)
|
| Methods inherited from class org.castor.core.nature.BaseNature |
|---|
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TEMPORAL_TYPE
Temporal
public static final String LOB
Lob
public static final String STRING_ENUM_TYPE
Enumerated
public static final String CASCADE_TYPES
CascadeType array of a relation.
| Constructor Detail |
|---|
public JPAFieldNature(PropertyHolder holder)
JPAFieldNature to access the given
PropertyHolder.
holder - The underlying PropertyHolder (obviously a
FieldInfo).PropertyHolder| Method Detail |
|---|
public final 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_FETCHpublic final javax.persistence.FetchType getBasicFetch()
Basic.fetch()BASIC_FETCHpublic final void setBasicOptional(boolean optional)
optional - The value of Basic.optional()BASIC_OPTIONALpublic final boolean isBasicOptional()
Basic.optional() was set to
true on the field.BASIC_OPTIONALpublic final void setColumnName(String name)
name - The value of Column.name()COLUMN_NAMEpublic final String getColumnName()
Column.name()COLUMN_NAMEpublic final void setColumnDefinition(String columnDefinition)
columnDefinition - The value of
Column.columnDefinition()COLUMN_DEFINITIONpublic final String getColumnDefinition()
Column.columnDefinition()COLUMN_DEFINITIONpublic final void setColumnLength(int length)
length - The value of Column.length()COLUMN_LENGTHpublic final Integer getColumnLength()
Column.length()COLUMN_LENGTHpublic final void setColumnInsertable(boolean insertable)
insertable - The value of Column.insertable()COLUMN_INSERTABLEpublic final Boolean getColumnInsertable()
Column.insertable()COLUMN_INSERTABLEpublic final void setColumnNullable(boolean nullable)
nullable - The value of Column.nullable()COLUMN_NULLABLEpublic final Boolean getColumnNullable()
Column.nullable()COLUMN_NULLABLEpublic final void setColumnPrecision(int precision)
precision - The value of Column.precision()COLUMN_PRECISIONpublic final Integer getColumnPrecision()
Column.precision()COLUMN_PRECISIONpublic final void setColumnScale(int scale)
scale - The value of Column.scale()COLUMN_SCALEpublic final Integer getColumnScale()
Column.scale()COLUMN_SCALEpublic final void setColumnTable(String table)
table - The value of Column.table()COLUMN_TABLEpublic final String getColumnTable()
Column.table()COLUMN_TABLEpublic final void setColumnUnique(boolean unique)
unique - The value of Column.unique()COLUMN_UNIQUEpublic final Boolean getColumnUnique()
Column.unique()COLUMN_UNIQUEpublic final void setColumnUpdatable(boolean updatable)
updatable - The value of Column.updatable()COLUMN_UPDATABLEpublic final Boolean getColumnUpdatable()
Column.updatable()COLUMN_UPDATABLEpublic final void setId(boolean isId)
isId - If Id was found on that property.IDpublic final boolean isId()
Id was set on the property,
else false.IDpublic final void setTransient(boolean isTransient)
isTransient - if Transient was found on that
property.TRANSIENTpublic final boolean isTransient()
Transient was set on the
property, else falseTRANSIENTpublic void setJoinTableName(String tablename)
tablename - The value of JoinTable.name()JOINTABLE_NAMEpublic String getJoinTableName()
JoinTable.name()JOINTABLE_NAMEpublic void setJoinTableCatalog(String catalog)
catalog - The value of JoinTable.catalog()JOINTABLE_CATALOGpublic String getJoinTableCatalog()
JoinTable.catalog()JOINTABLE_CATALOGpublic void setJoinTableSchema(String schema)
schema - The value of JoinTable.schema()JOINTABLE_SCHEMApublic String getJoinTableSchema()
JoinTable.schema()#TABLE_SCHEMApublic void setJoinTableJoinColumns(javax.persistence.JoinColumn[] joinColumns)
joinColumns - The value of JoinTable.joinColumns()JOINTABLE_JOINCOLUMNSpublic javax.persistence.JoinColumn[] getJoinTableJoinColumns()
JoinTable.joinColumns()JOINTABLE_JOINCOLUMNSpublic void setJoinTableInverseJoinColumns(javax.persistence.JoinColumn[] inverseJoinColumns)
inverseJoinColumns - The value of
JoinTable.inverseJoinColumns()JOINTABLE_INVERSE_JOINCOLUMNSpublic javax.persistence.JoinColumn[] getJoinTableInverseJoinColumns()
JoinTable.inverseJoinColumns()JOINTABLE_INVERSE_JOINCOLUMNSpublic final void setJoinColumnName(String name)
name - The value of JoinColumn.name().JOINCOLUMN_NAMEpublic final String getJoinColumnName()
JoinColumn.name().JOINCOLUMN_NAMEpublic final void setJoinColumnReferencedColumnName(String referencedColumnName)
referencedColumnName - The value of
JoinColumn.referencedColumnName().JOINCOLUMN_REFERENCEDCOLUMNNAMEpublic final String getJoinColumnReferencedColumnName()
JoinColumn.referencedColumnName().JOINCOLUMN_REFERENCEDCOLUMNNAMEpublic final void setJoinColumnUnique(boolean unique)
unique - The value of JoinColumn.unique().JOINCOLUMN_UNIQUEpublic final Boolean getJoinColumnUnique()
JoinColumn.unique().JOINCOLUMN_UNIQUEpublic final void setJoinColumnNullable(boolean nullable)
nullable - The value of JoinColumn.nullable().JOINCOLUMN_NULLABLEpublic final Boolean getJoinColumnNullable()
JoinColumn.nullable().JOINCOLUMN_NULLABLEpublic final void setJoinColumnInsertable(boolean insertable)
insertable - The value of JoinColumn.insertable()
.JOINCOLUMN_INSERTABLEpublic final Boolean getJoinColumnInsertable()
JoinColumn.insertable().JOINCOLUMN_INSERTABLEpublic final void setJoinColumnUpdatable(boolean updatable)
updatable - The value of JoinColumn.updatable().JOINCOLUMN_UPDATABLEpublic final Boolean getJoinColumnUpdatable()
JoinColumn.updatable().JOINCOLUMN_UPDATABLEpublic final void setJoinColumnColumnDefinition(String columnDefinition)
columnDefinition - The value of
JoinColumn.columnDefinition().JOINCOLUMN_COLUMNDEFINITIONpublic final String getJoinColumnColumnDefinition()
JoinColumn.columnDefinition().JOINCOLUMN_COLUMNDEFINITIONpublic final void setJoinColumnTable(String table)
table - The value of JoinColumn.table().JOINCOLUMN_TABLEpublic final String getJoinColumnTable()
JoinColumn.table().JOINCOLUMN_TABLEpublic void setOneToOne(boolean hasOneToOne)
hasOneToOne - if OneToOne was found on that
property.ONETOONEpublic boolean isOneToOne()
OneToOne was set on the property,
else false.ONETOONEpublic void setManyToOne(boolean hasManyToOne)
hasManyToOne - if ManyToOne was found on that
property.MANYTOONEpublic boolean isManyToOne()
ManyToOne was set on the property,
else false.MANYTOONEpublic void setOneToMany(boolean hasOneToMany)
hasOneToMany - if OneToMany was found on that
property.ONETOMANYpublic boolean isOneToMany()
OneToMany was set on the property,
else false.ONETOMANYpublic void setManyToMany(boolean hasManyToMany)
hasManyToMany - if ManyToMany was found on that
property.MANYTOMANYpublic boolean isManyToMany()
ManyToOne was set on the property,
else false.MANYTOMANYpublic 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_INVERSECOPYpublic boolean isManyToManyInverseCopy()
JoinTable relevant information from the other side of the
relation (inverting the JoinColumn settings).MANYTOMANY_INVERSECOPYpublic void setRelationTargetEntity(Class<?> targetEntity)
targetEntity - The value of OneToOne.targetEntity()
, OneToMany.targetEntity(),
ManyToOne.targetEntity(),
ManyToMany.targetEntity(), depending
to the relation type.RELATION_TARGETENTITYpublic 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_TARGETENTITYpublic 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_LAZYFETCHpublic boolean isRelationLazyFetch()
OneToOne.fetch() ,
OneToMany.fetch(),
ManyToOne.fetch(),
ManyToMany.fetch() is set to
FetchType.LAZY, depending on the
relation type.RELATION_LAZYFETCHpublic void setRelationMappedBy(String mappedBy)
mappedBy - The content of OneToMany.mappedBy(),
ManyToMany.mappedBy(), depending on
the relation type.RELATION_MAPPEDBYpublic String getRelationMappedBy()
OneToMany.mappedBy(),
ManyToMany.mappedBy(), depending on the
relation type. If no (or an empty) String was set, null is
returned!RELATION_MAPPEDBYpublic Class<?> getRelationCollectionType()
OneToMany,
ManyToMany, depending on the relation
type. Returns null iff none of the above relational annotations
was set on the field.RELATION_COLLECTIONTYPEpublic void setRelationCollectionType(Class<?> collectionType)
collectionType - Set the type of Collection being used by
OneToMany,
ManyToMany, depending on the
relation type.RELATION_COLLECTIONTYPEpublic void setRelationOptional(boolean optional)
optional - Set the value of OneToOne.optional()
, ManyToOne.optional(), depending on
the relation type.RELATION_OPTIONALpublic boolean isRelationOptional()
OneToOne.optional(),
ManyToOne.optional() was set to true,
depending on the relation type.RELATION_OPTIONALpublic void setGeneratedValueStrategy(javax.persistence.GenerationType strategy)
GeneratedValue.strategy()
strategy - GENERATEDVALUE_STRATEGYpublic javax.persistence.GenerationType getGeneratedValueStrategy()
GeneratedValue.strategy()
GENERATEDVALUE_STRATEGYpublic void setGeneratedValueGenerator(String generator)
GeneratedValue.generator()
strategy - GENERATEDVALUE_STRATEGYpublic String getGeneratedValueGenerator()
GeneratedValue.generator()
GENERATEDVALUE_STRATEGYpublic javax.persistence.TemporalType getTemporalType()
TemporalType of field.TEMPORAL_TYPEpublic void setTemporalType(javax.persistence.TemporalType temporalType)
temporalType - set the TemporalType of field.TEMPORAL_TYPEpublic boolean isLob()
Lob was set on the
property, else falseLOBpublic void setLob(boolean isLob)
isLob - if Lob was found on that
property.LOBpublic boolean isStringEnumType()
Enumerated with value
EnumType STRING was set on the
property, else falseSTRING_ENUM_TYPEpublic void setStringEnumType(boolean isStringEnumType)
isStringEnumType - if Enumerated with value
EnumType STRING was found on that
property.STRING_ENUM_TYPEpublic javax.persistence.CascadeType[] getCascadeTypes()
CascadeType array of relation.CASCADE_TYPESpublic void setCascadeTypes(javax.persistence.CascadeType[] cascadeTypes)
cascadeTypes - set the CascadeType array of relation.CASCADE_TYPES
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||