public class ManyToOneField extends CascadableField
Constructor and Description |
---|
ManyToOneField(EntityType relatedType) |
ManyToOneField(EntityType relatedType,
java.lang.String name) |
ManyToOneField(EntityType relatedType,
java.lang.String name,
CascadeType[] cascadeType) |
ManyToOneField(EntityType relatedType,
java.lang.String name,
CascadeType[] cascadeType,
boolean isManyToOne) |
Modifier and Type | Method and Description |
---|---|
AmberExpr |
createExpr(QueryParser parser,
PathExpr parent)
Creates the expression for the field.
|
void |
generateCopyLoadObject(JavaWriter out,
java.lang.String dst,
java.lang.String src,
int updateIndex)
Updates the cached copy.
|
void |
generateCopyUpdateObject(JavaWriter out,
java.lang.String dst,
java.lang.String src,
int updateIndex)
Updates the cached copy.
|
void |
generateGetterMethod(JavaWriter out)
Generates the get property.
|
void |
generateInsertColumns(java.util.ArrayList<java.lang.String> columns)
Generates the insert.
|
void |
generateInvalidateForeign(JavaWriter out)
Generates code for foreign entity create/delete
|
void |
generateJoin(CharBuffer cb,
java.lang.String sourceTable,
java.lang.String targetTable)
Generates the linking for a join
|
int |
generateLoad(JavaWriter out,
java.lang.String rs,
java.lang.String indexVar,
int index)
Generates loading code
|
java.lang.String |
generateLoadProperty(JavaWriter out,
java.lang.String index,
java.lang.String session)
Generates the set property.
|
java.lang.String |
generateLoadSelect(AmberTable table,
java.lang.String id)
Generates the select clause.
|
void |
generateMergeFrom(JavaWriter out,
java.lang.String dst,
java.lang.String src)
Updates the cached copy.
|
void |
generatePostConstructor(JavaWriter out)
Generates the post constructor initialization.
|
void |
generatePostDelete(JavaWriter out)
Generates any pre-delete code
|
int |
generatePostLoadSelect(JavaWriter out,
int index)
Generates loading code after the basic fields.
|
void |
generatePreDelete(JavaWriter out)
Generates any pre-delete code
|
void |
generatePrePersist(JavaWriter out)
Updates the cached copy.
|
void |
generatePrologue(JavaWriter out,
java.util.HashSet<java.lang.Object> completedSet)
Generates any prologue.
|
java.lang.String |
generateSelect(java.lang.String id)
Generates the select clause.
|
void |
generateSetterMethod(JavaWriter out)
Generates the set property.
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String source)
Generates the set clause.
|
void |
generateUpdate(CharBuffer sql)
Generates the update set clause
|
void |
generateUpdateFromObject(JavaWriter out,
java.lang.String obj)
Generates loading cache
|
ForeignColumn |
getColumn(AmberColumn targetColumn)
Gets the column corresponding to the target field.
|
EntityType |
getEntityTargetType()
Returns the target type as
entity or mapped-superclass.
|
java.lang.String |
getForeignTypeName()
Returns the foreign type.
|
java.util.HashMap<java.lang.String,JoinColumnConfig> |
getJoinColumnMap()
Gets the join column map.
|
java.lang.Object[] |
getJoinColumns()
Gets the join column annotations.
|
LinkColumns |
getLinkColumns()
Gets the columns.
|
EntityType |
getRelatedType()
Returns the source type as
entity or mapped-superclass.
|
void |
init()
Initializes the field.
|
void |
init(EntityType relatedType)
Initializes the field.
|
boolean |
isAnnotatedManyToOne()
Returns true if it is annotated as many-to-one.
|
boolean |
isSourceCascadeDelete()
Set true if deletes cascade to the source.
|
boolean |
isTargetCascadeDelete()
Set true if deletes cascade to the target.
|
AmberField |
override(AmberBeanType type)
Creates a copy of the field for a parent
|
void |
setAliasField(AmberField alias)
Sets any alias field.
|
void |
setJoinColumnMap(java.util.HashMap<java.lang.String,JoinColumnConfig> joinColumnMap)
Sets the join column map.
|
void |
setJoinColumns(JoinColumn[] joinColumnsAnn)
Sets the join column annotations.
|
void |
setLinkColumns(LinkColumns linkColumns)
Sets the join columns.
|
void |
setSourceCascadeDelete(boolean isCascadeDelete)
Set true if deletes cascade to the source.
|
void |
setTargetCascadeDelete(boolean isCascadeDelete)
Set true if deletes cascade to the target.
|
void |
setTargetField(DependentEntityOneToOneField field)
Sets the target field.
|
void |
setType(AmberType targetType)
Sets the target type.
|
generateFlushCheck, generateInternalCascade, generatePostCascade, generatePreCascade, getCascadeType, isCascadable, isCascade, setCascadeType
childDelete, generateCastFromObject, generateCreateTableSQL, generateDetach, generateDumpRelationships, generateEquals, generateExpire, generateGet, generateGet, generateInsert, generateInsertSet, generateJavaSelect, generateLoadFromObject, generateLoadNative, generateNativeColumnNames, generateNull, generateSet, generateSet, generateStatementSet, generateSuperGetter, generateSuperGetterMethod, generateSuperSetter, generateSuperSetterMethod, generateUpdate, generateUpdateSet, generateWhere, getBeanClass, getColumn, getCreateLoadMask, getEntitySourceType, getFieldName, getGetterMethod, getGetterName, getIndex, getJavaClass, getJavaType, getJavaTypeName, getLoadGroupIndex, getName, getPersistenceUnit, getSetterMethod, getSetterName, getSourceType, getTable, hasLoadGroup, isAbstract, isFieldAccess, isKey, isLazy, isOverride, isUpdateable, link, setColumn, setIndex, setJavaType, setLazy, setLoadGroupIndex, setName, setOverride, toObject, toString
public ManyToOneField(EntityType relatedType, java.lang.String name, CascadeType[] cascadeType, boolean isManyToOne) throws ConfigException
ConfigException
public ManyToOneField(EntityType relatedType, java.lang.String name, CascadeType[] cascadeType) throws ConfigException
ConfigException
public ManyToOneField(EntityType relatedType, java.lang.String name) throws ConfigException
ConfigException
public ManyToOneField(EntityType relatedType)
public void setType(AmberType targetType)
public EntityType getRelatedType()
public EntityType getEntityTargetType()
public java.lang.String getForeignTypeName()
public boolean isAnnotatedManyToOne()
public void setTargetCascadeDelete(boolean isCascadeDelete)
public void setSourceCascadeDelete(boolean isCascadeDelete)
public boolean isTargetCascadeDelete()
public boolean isSourceCascadeDelete()
public void setJoinColumns(JoinColumn[] joinColumnsAnn)
public java.lang.Object[] getJoinColumns()
public void setJoinColumnMap(java.util.HashMap<java.lang.String,JoinColumnConfig> joinColumnMap)
public java.util.HashMap<java.lang.String,JoinColumnConfig> getJoinColumnMap()
public void setLinkColumns(LinkColumns linkColumns)
public LinkColumns getLinkColumns()
public void setTargetField(DependentEntityOneToOneField field)
public void setAliasField(AmberField alias)
public AmberField override(AmberBeanType type)
override
in interface AmberField
override
in class AbstractField
public void init() throws ConfigException
init
in interface AmberField
init
in class AbstractField
ConfigException
public void init(EntityType relatedType) throws ConfigException
ConfigException
public void generatePostConstructor(JavaWriter out) throws java.io.IOException
generatePostConstructor
in interface AmberField
generatePostConstructor
in class AbstractField
java.io.IOException
public AmberExpr createExpr(QueryParser parser, PathExpr parent)
createExpr
in interface AmberField
createExpr
in class AbstractField
public ForeignColumn getColumn(AmberColumn targetColumn)
public void generateInsertColumns(java.util.ArrayList<java.lang.String> columns)
generateInsertColumns
in interface AmberField
generateInsertColumns
in class AbstractField
public java.lang.String generateLoadSelect(AmberTable table, java.lang.String id)
generateLoadSelect
in interface AmberField
generateLoadSelect
in class AbstractField
public java.lang.String generateSelect(java.lang.String id)
generateSelect
in interface AmberField
generateSelect
in class AbstractField
public void generateUpdate(CharBuffer sql)
generateUpdate
in interface AmberField
generateUpdate
in class AbstractField
public void generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet) throws java.io.IOException
generatePrologue
in interface AmberField
generatePrologue
in class AbstractField
java.io.IOException
public void generateJoin(CharBuffer cb, java.lang.String sourceTable, java.lang.String targetTable)
public int generateLoad(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index) throws java.io.IOException
generateLoad
in interface AmberField
generateLoad
in class AbstractField
java.io.IOException
public int generatePostLoadSelect(JavaWriter out, int index) throws java.io.IOException
generatePostLoadSelect
in interface AmberField
generatePostLoadSelect
in class AbstractField
java.io.IOException
public void generateGetterMethod(JavaWriter out) throws java.io.IOException
generateGetterMethod
in interface AmberField
generateGetterMethod
in class AbstractField
java.io.IOException
public java.lang.String generateLoadProperty(JavaWriter out, java.lang.String index, java.lang.String session) throws java.io.IOException
java.io.IOException
public void generateSetterMethod(JavaWriter out) throws java.io.IOException
generateSetterMethod
in interface AmberField
generateSetterMethod
in class AbstractField
java.io.IOException
public void generateCopyUpdateObject(JavaWriter out, java.lang.String dst, java.lang.String src, int updateIndex) throws java.io.IOException
generateCopyUpdateObject
in interface AmberField
generateCopyUpdateObject
in class AbstractField
java.io.IOException
public void generateCopyLoadObject(JavaWriter out, java.lang.String dst, java.lang.String src, int updateIndex) throws java.io.IOException
generateCopyLoadObject
in interface AmberField
generateCopyLoadObject
in class AbstractField
java.io.IOException
public void generateMergeFrom(JavaWriter out, java.lang.String dst, java.lang.String src) throws java.io.IOException
generateMergeFrom
in interface AmberField
generateMergeFrom
in class AbstractField
java.io.IOException
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String source) throws java.io.IOException
generateStatementSet
in interface AmberField
generateStatementSet
in class AbstractField
java.io.IOException
public void generateUpdateFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateUpdateFromObject
in interface AmberField
generateUpdateFromObject
in class AbstractField
java.io.IOException
public void generatePrePersist(JavaWriter out) throws java.io.IOException
generatePrePersist
in interface AmberField
generatePrePersist
in class AbstractField
java.io.IOException
public void generateInvalidateForeign(JavaWriter out) throws java.io.IOException
generateInvalidateForeign
in interface AmberField
generateInvalidateForeign
in class AbstractField
java.io.IOException
public void generatePreDelete(JavaWriter out) throws java.io.IOException
generatePreDelete
in interface AmberField
generatePreDelete
in class AbstractField
java.io.IOException
public void generatePostDelete(JavaWriter out) throws java.io.IOException
generatePostDelete
in interface AmberField
generatePostDelete
in class AbstractField
java.io.IOException