public class EmbeddedSubField extends java.lang.Object implements AmberField
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
EmbeddedSubField(EntityEmbeddedField embeddedField,
AmberField embeddableField,
int index) |
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 any code needed for detachment
|
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 value)
Generates the field getter.
|
java.lang.String |
generateGet(java.lang.String objThis)
Generates the field getter.
|
void |
generateGetterMethod(JavaWriter out)
Generates the get property.
|
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 loadGroupIndex)
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
|
void |
generatePostConstructor(JavaWriter out)
Generates the post constructor fixup
|
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 delete foreign
|
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 objThis,
java.lang.String value)
Generates loading cache
|
java.lang.String |
generateSet(java.lang.String obj,
java.lang.String value)
Generates the field setter.
|
void |
generateSetterMethod(JavaWriter out)
Generates the set property.
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index)
Generates the JDBC preparedStatement 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 get property.
|
java.lang.String |
generateSuperSetter(java.lang.String objThis,
java.lang.String value)
Sets the actual data.
|
void |
generateSuperSetterMethod(JavaWriter out)
Generates the get property.
|
void |
generateUpdate(CharBuffer sql)
Generates the where clause.
|
void |
generateUpdate(JavaWriter out,
java.lang.String mask,
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.
|
AmberColumn |
getColumn()
Returns the column for the field.
|
long |
getCreateLoadMask(int group)
Returns the load group mask.
|
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 type of the field
|
JType |
getJavaType()
Returns the type of the field
|
java.lang.String |
getJavaTypeName()
Returns the name of the java type.
|
int |
getLoadGroupIndex()
Returns the property's group index.
|
java.lang.String |
getName()
Returns the field name.
|
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 value (or null)
|
boolean |
hasLoadGroup(int index)
Generates loading code
|
void |
init()
Links to the target.
|
boolean |
isAbstract()
Returns true if the methods are abstract.
|
boolean |
isCascadable()
Returns true if the field is cascadable.
|
boolean |
isLazy()
Returns true if and only if this is a LAZY field.
|
boolean |
isUpdateable()
Returns true for an updateable field.
|
void |
link()
Links to the target.
|
AmberField |
override(AmberBeanType entityType)
Override the field
|
void |
setIndex(int index)
Links to the target.
|
java.lang.String |
toObject(java.lang.String value)
Converts to an object.
|
public EmbeddedSubField(EntityEmbeddedField embeddedField, AmberField embeddableField, int index) throws ConfigException
ConfigException
public AmberBeanType getSourceType()
getSourceType
in interface AmberField
public boolean isLazy()
isLazy
in interface AmberField
public java.lang.String getName()
getName
in interface AmberField
public AmberTable getTable()
getTable
in interface AmberField
public AmberColumn getColumn()
AmberField
getColumn
in interface AmberField
public int getIndex()
getIndex
in interface AmberField
public int getLoadGroupIndex()
getLoadGroupIndex
in interface AmberField
public long getCreateLoadMask(int group)
getCreateLoadMask
in interface AmberField
public JType getJavaType()
getJavaType
in interface AmberField
public java.lang.Class getJavaClass()
getJavaClass
in interface AmberField
public java.lang.String getJavaTypeName()
getJavaTypeName
in interface AmberField
public boolean isAbstract()
isAbstract
in interface AmberField
public boolean isCascadable()
isCascadable
in interface AmberField
public boolean isUpdateable()
isUpdateable
in interface AmberField
public void setIndex(int index)
setIndex
in interface AmberField
public java.lang.reflect.Method getGetterMethod()
getGetterMethod
in interface AmberField
public java.lang.String getGetterName()
getGetterName
in interface AmberField
public java.lang.reflect.Method getSetterMethod()
getSetterMethod
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 void generateSet(JavaWriter out, java.lang.String objThis, java.lang.String value) throws java.io.IOException
generateSet
in interface AmberField
java.io.IOException
public void init() throws ConfigException
init
in interface AmberField
ConfigException
public void generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet) throws java.io.IOException
generatePrologue
in interface AmberField
java.io.IOException
public void generatePostConstructor(JavaWriter out) throws java.io.IOException
generatePostConstructor
in interface AmberField
java.io.IOException
public void generateUpdate(JavaWriter out, java.lang.String mask, 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 loadGroupIndex) 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 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 generateLoadFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateLoadFromObject
in interface AmberField
java.io.IOException
public void generateUpdateFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateUpdateFromObject
in interface AmberField
java.io.IOException
public void generateGet(JavaWriter out, java.lang.String value) throws java.io.IOException
generateGet
in interface AmberField
value
- the non-null valuejava.io.IOException
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 obj, java.lang.String value)
generateSet
in interface AmberField
value
- the non-null valuepublic 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 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 AmberField override(AmberBeanType entityType)
override
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 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 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 void generateInsertColumns(java.util.ArrayList<java.lang.String> columns)
generateInsertColumns
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 generatePrePersist(JavaWriter out) throws java.io.IOException
generatePrePersist
in interface AmberField
java.io.IOException
public void generateDetach(JavaWriter out) throws java.io.IOException
generateDetach
in interface AmberField
java.io.IOException
public AmberExpr createExpr(QueryParser parser, PathExpr parent)
createExpr
in interface AmberField