public abstract class AbstractField extends java.lang.Object implements AmberField
Modifier and Type | Method and Description |
---|---|
void |
childDelete(AmberConnection aConn,
java.io.Serializable primaryKey)
Deletes the children
|
AmberExpr |
createExpr(QueryParser parser,
PathExpr parent)
Creates the expression for the field.
|
java.lang.String |
generateCastFromObject(java.lang.String value)
Generates code to convert to the type from the object.
|
void |
generateCopyLoadObject(JavaWriter out,
java.lang.String dst,
java.lang.String src,
int loadIndex)
Updates the cached copy.
|
void |
generateCopyUpdateObject(JavaWriter out,
java.lang.String dst,
java.lang.String src,
int updateIndex)
Updates the cached copy.
|
java.lang.String |
generateCreateTableSQL(AmberPersistenceUnit manager)
Generates the table create.
|
void |
generateDetach(JavaWriter out)
Generates the detachment code
|
void |
generateDumpRelationships(JavaWriter out,
int updateIndex)
Checks entity-relationships from an object.
|
java.lang.String |
generateEquals(java.lang.String leftBase,
java.lang.String value)
Generates code to test the equals.
|
void |
generateExpire(JavaWriter out)
Generates the expire code
|
void |
generateGet(JavaWriter out,
java.lang.String objThis)
Generates the field getter.
|
java.lang.String |
generateGet(java.lang.String objThis)
Generates the field getter.
|
void |
generateGetterMethod(JavaWriter out)
Generates the getter method implementation.
|
java.lang.String |
generateInsert()
Generates the insert.
|
void |
generateInsertColumns(java.util.ArrayList<java.lang.String> columns)
Generates the insert.
|
void |
generateInsertSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String obj)
Generates the set clause for the insert clause.
|
void |
generateInvalidateForeign(JavaWriter out)
Generates code for foreign entity create/delete
|
java.lang.String |
generateJavaSelect(java.lang.String id)
Generates the JPA QL select clause.
|
int |
generateLoad(JavaWriter out,
java.lang.String rs,
java.lang.String indexVar,
int index)
Generates loading code
|
void |
generateLoadFromObject(JavaWriter out,
java.lang.String obj)
Generates loading cache
|
int |
generateLoadNative(JavaWriter out,
int index)
Generates loading for a native query
|
java.lang.String |
generateLoadSelect(AmberTable table,
java.lang.String id)
Generates the select clause for an entity load.
|
void |
generateMergeFrom(JavaWriter out,
java.lang.String dst,
java.lang.String src)
Updates the cached copy.
|
void |
generateNativeColumnNames(java.util.ArrayList<java.lang.String> names)
Generates loading for a native query
|
java.lang.String |
generateNull()
Returns the null value.
|
void |
generatePostConstructor(JavaWriter out)
Generates the post constructor initialization.
|
void |
generatePostDelete(JavaWriter out)
Generates the delete foreign
|
int |
generatePostLoadSelect(JavaWriter out,
int index)
Generates loading code after the basic fields.
|
void |
generatePreDelete(JavaWriter out)
Generates the pre-delete code
|
void |
generatePrePersist(JavaWriter out)
Generates any code needed before a persist occurs
|
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 |
generateSet(JavaWriter out,
java.lang.String obj,
java.lang.String value)
Generates set code, which goes through the active calls, i.e.
|
java.lang.String |
generateSet(java.lang.String objThis,
java.lang.String value)
Generates the field setter.
|
void |
generateSetterMethod(JavaWriter out)
Generates the setter method implementation.
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index)
Generates the set clause.
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String obj)
Generates the set clause.
|
java.lang.String |
generateSuperGetter(java.lang.String objThis)
Returns the actual data.
|
void |
generateSuperGetterMethod(JavaWriter out)
Generates the super getter method implementation
|
java.lang.String |
generateSuperSetter(java.lang.String objThis,
java.lang.String value)
Sets the actual data.
|
void |
generateSuperSetterMethod(JavaWriter out)
Generates the super setter method implementation
|
void |
generateUpdate(CharBuffer sql)
Generates the where clause.
|
void |
generateUpdate(JavaWriter out,
java.lang.String maskVar,
java.lang.String pstmt,
java.lang.String index)
Generates loading cache
|
void |
generateUpdateFromObject(JavaWriter out,
java.lang.String obj)
Generates loading cache
|
void |
generateUpdateSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String obj)
Generates the set clause for the insert clause.
|
java.lang.String |
generateWhere(java.lang.String id)
Generates the where clause.
|
java.lang.Class |
getBeanClass()
Returns the bean class.
|
AmberColumn |
getColumn()
Returns the column for the field
|
long |
getCreateLoadMask(int group)
Returns the load group mask.
|
EntityType |
getEntitySourceType()
Returns the source type as
entity or mapped-superclass.
|
protected java.lang.String |
getFieldName()
Returns the field name.
|
java.lang.reflect.Method |
getGetterMethod()
Returns the getter method.
|
java.lang.String |
getGetterName()
Returns the getter name.
|
int |
getIndex()
Returns the property index.
|
java.lang.Class |
getJavaClass()
Returns the field's class
|
JType |
getJavaType()
Returns the field's type
|
java.lang.String |
getJavaTypeName()
Returns the getter name.
|
int |
getLoadGroupIndex()
Returns the property's group index.
|
java.lang.String |
getName()
Returns the field name.
|
AmberPersistenceUnit |
getPersistenceUnit()
Returns the amber manager.
|
java.lang.reflect.Method |
getSetterMethod()
Returns the setter method.
|
java.lang.String |
getSetterName()
Returns the setter name.
|
AmberBeanType |
getSourceType()
Returns the owning entity class.
|
AmberTable |
getTable()
Returns the table containing the field's columns.
|
boolean |
hasLoadGroup(int index)
Generates loading code
|
void |
init()
Initialize the field.
|
boolean |
isAbstract()
Returns true if the methods are abstract.
|
boolean |
isCascadable()
Returns true if the field is cascadable.
|
boolean |
isFieldAccess()
Returns true if values are accessed by the fields.
|
boolean |
isKey()
Returns true for a key
|
boolean |
isLazy()
Returns true for a lazy field.
|
boolean |
isOverride()
Returns true for an override
|
boolean |
isUpdateable()
Returns true if the methods are abstract.
|
void |
link()
Links to the target.
|
AmberField |
override(AmberBeanType table)
Creates a copy of the field for a parent
|
void |
setColumn(AmberColumn column)
Returns the column for the field
|
void |
setIndex(int index)
Set the property index.
|
protected void |
setJavaType(JType type)
Sets the java type.
|
void |
setLazy(boolean isLazy)
Set true for a lazy field.
|
protected void |
setLoadGroupIndex(int index)
Returns the property's group index.
|
void |
setName(java.lang.String name)
Sets the name.
|
void |
setOverride(boolean isOverride)
Returns true for an override
|
java.lang.String |
toObject(java.lang.String value)
Converts to an object.
|
java.lang.String |
toString() |
public void setName(java.lang.String name) throws ConfigException
ConfigException
public java.lang.String getName()
getName
in interface AmberField
protected void setJavaType(JType type)
public AmberBeanType getSourceType()
getSourceType
in interface AmberField
public AmberPersistenceUnit getPersistenceUnit()
public java.lang.Class getBeanClass()
public EntityType getEntitySourceType()
public AmberTable getTable()
getTable
in interface AmberField
public AmberColumn getColumn()
getColumn
in interface AmberField
public void setColumn(AmberColumn column)
public int getIndex()
getIndex
in interface AmberField
public void setIndex(int index)
setIndex
in interface AmberField
public int getLoadGroupIndex()
getLoadGroupIndex
in interface AmberField
protected void setLoadGroupIndex(int index)
public long getCreateLoadMask(int group)
getCreateLoadMask
in interface AmberField
public boolean isLazy()
isLazy
in interface AmberField
public void setLazy(boolean isLazy)
public boolean isOverride()
public void setOverride(boolean isOverride)
public boolean isKey()
public java.lang.String getJavaTypeName()
getJavaTypeName
in interface AmberField
public JType getJavaType()
getJavaType
in interface AmberField
public java.lang.Class getJavaClass()
getJavaClass
in interface AmberField
public boolean isFieldAccess()
public boolean isAbstract()
isAbstract
in interface AmberField
public boolean isCascadable()
isCascadable
in interface AmberField
public boolean isUpdateable()
isUpdateable
in interface AmberField
public AmberField override(AmberBeanType table)
override
in interface AmberField
public void init() throws ConfigException
init
in interface AmberField
ConfigException
public void generatePostConstructor(JavaWriter out) throws java.io.IOException
generatePostConstructor
in interface AmberField
java.io.IOException
public void generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet) throws java.io.IOException
generatePrologue
in interface AmberField
java.io.IOException
public java.lang.reflect.Method getGetterMethod()
getGetterMethod
in interface AmberField
public java.lang.reflect.Method getSetterMethod()
getSetterMethod
in interface AmberField
public java.lang.String getGetterName()
getGetterName
in interface AmberField
public java.lang.String getSetterName()
getSetterName
in interface AmberField
public java.lang.String generateSuperGetter(java.lang.String objThis)
generateSuperGetter
in interface AmberField
public java.lang.String generateSuperSetter(java.lang.String objThis, java.lang.String value)
generateSuperSetter
in interface AmberField
public java.lang.String generateGet(java.lang.String objThis)
generateGet
in interface AmberField
value
- the non-null valuepublic java.lang.String generateSet(java.lang.String objThis, java.lang.String value)
generateSet
in interface AmberField
value
- the non-null valuepublic void generateGet(JavaWriter out, java.lang.String objThis) throws java.io.IOException
generateGet
in interface AmberField
value
- the non-null valuejava.io.IOException
public void generateSet(JavaWriter out, java.lang.String obj, java.lang.String value) throws java.io.IOException
generateSet
in interface AmberField
java.io.IOException
public void generateSuperGetterMethod(JavaWriter out) throws java.io.IOException
generateSuperGetterMethod
in interface AmberField
java.io.IOException
public void generateSuperSetterMethod(JavaWriter out) throws java.io.IOException
generateSuperSetterMethod
in interface AmberField
java.io.IOException
public void generateGetterMethod(JavaWriter out) throws java.io.IOException
generateGetterMethod
in interface AmberField
java.io.IOException
public void generateSetterMethod(JavaWriter out) throws java.io.IOException
generateSetterMethod
in interface AmberField
java.io.IOException
public void generateDetach(JavaWriter out) throws java.io.IOException
generateDetach
in interface AmberField
java.io.IOException
public java.lang.String generateLoadSelect(AmberTable table, java.lang.String id)
generateLoadSelect
in interface AmberField
public java.lang.String generateSelect(java.lang.String id)
generateSelect
in interface AmberField
public java.lang.String generateJavaSelect(java.lang.String id)
generateJavaSelect
in interface AmberField
public java.lang.String generateWhere(java.lang.String id)
generateWhere
in interface AmberField
public void generateUpdate(CharBuffer sql)
generateUpdate
in interface AmberField
public void generateUpdate(JavaWriter out, java.lang.String maskVar, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
generateUpdate
in interface AmberField
java.io.IOException
public boolean hasLoadGroup(int index)
hasLoadGroup
in interface AmberField
public int generateLoad(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index) throws java.io.IOException
generateLoad
in interface AmberField
java.io.IOException
public int generatePostLoadSelect(JavaWriter out, int index) throws java.io.IOException
generatePostLoadSelect
in interface AmberField
java.io.IOException
public void generateLoadFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateLoadFromObject
in interface AmberField
java.io.IOException
public int generateLoadNative(JavaWriter out, int index) throws java.io.IOException
generateLoadNative
in interface AmberField
java.io.IOException
public void generateNativeColumnNames(java.util.ArrayList<java.lang.String> names)
generateNativeColumnNames
in interface AmberField
public void generateUpdateFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateUpdateFromObject
in interface AmberField
java.io.IOException
public java.lang.String generateNull()
protected java.lang.String getFieldName()
public final java.lang.String generateInsert()
public void generateInsertColumns(java.util.ArrayList<java.lang.String> columns)
generateInsertColumns
in interface AmberField
public java.lang.String generateCreateTableSQL(AmberPersistenceUnit manager)
generateCreateTableSQL
in interface AmberField
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
generateStatementSet
in interface AmberField
java.io.IOException
public void generateInsertSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String obj) throws java.io.IOException
generateInsertSet
in interface AmberField
java.io.IOException
public void generateUpdateSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String obj) throws java.io.IOException
generateUpdateSet
in interface AmberField
java.io.IOException
public void generatePrePersist(JavaWriter out) throws java.io.IOException
generatePrePersist
in interface AmberField
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
java.io.IOException
public void generateCopyLoadObject(JavaWriter out, java.lang.String dst, java.lang.String src, int loadIndex) throws java.io.IOException
generateCopyLoadObject
in interface AmberField
java.io.IOException
public void generateMergeFrom(JavaWriter out, java.lang.String dst, java.lang.String src) throws java.io.IOException
generateMergeFrom
in interface AmberField
java.io.IOException
public void generateDumpRelationships(JavaWriter out, int updateIndex) throws java.io.IOException
generateDumpRelationships
in interface AmberField
java.io.IOException
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String obj) throws java.io.IOException
generateStatementSet
in interface AmberField
java.io.IOException
public java.lang.String toObject(java.lang.String value)
toObject
in interface AmberField
public void link()
link
in interface AmberField
public void generatePreDelete(JavaWriter out) throws java.io.IOException
generatePreDelete
in interface AmberField
java.io.IOException
public void generatePostDelete(JavaWriter out) throws java.io.IOException
generatePostDelete
in interface AmberField
java.io.IOException
public void generateExpire(JavaWriter out) throws java.io.IOException
generateExpire
in interface AmberField
java.io.IOException
public void generateInvalidateForeign(JavaWriter out) throws java.io.IOException
generateInvalidateForeign
in interface AmberField
java.io.IOException
public void childDelete(AmberConnection aConn, java.io.Serializable primaryKey) throws java.sql.SQLException
childDelete
in interface AmberField
java.sql.SQLException
public java.lang.String generateCastFromObject(java.lang.String value)
generateCastFromObject
in interface AmberField
public java.lang.String generateEquals(java.lang.String leftBase, java.lang.String value)
generateEquals
in interface AmberField
public AmberExpr createExpr(QueryParser parser, PathExpr parent)
createExpr
in interface AmberField
public java.lang.String toString()
toString
in class java.lang.Object