public class KeyPropertyField extends PropertyField implements IdField
Constructor and Description |
---|
KeyPropertyField(EntityType tableType) |
KeyPropertyField(EntityType tableType,
java.lang.String name) |
KeyPropertyField(EntityType entityType,
java.lang.String name,
AmberColumn column) |
Modifier and Type | Method and Description |
---|---|
AmberExpr |
createExpr(QueryParser parser,
PathExpr parent)
Creates the expression for the field.
|
void |
generateCheckCreateKey(JavaWriter out)
Generates the set clause.
|
void |
generateCopy(JavaWriter out,
java.lang.String dest,
java.lang.String source)
Generates code to copy to an object.
|
java.lang.String |
generateEquals(java.lang.String left,
java.lang.String right)
Generates code to test the equals.
|
java.lang.String |
generateGet(java.lang.String objThis)
Generates the field getter.
|
java.lang.String |
generateGetKeyProperty(java.lang.String key)
Generates the getter for a key property
|
java.lang.String |
generateGetProxyProperty(java.lang.String value)
Generates the property getter for an EJB proxy
|
java.lang.String |
generateIsNull(java.lang.String value)
Returns a test for null.
|
java.lang.String |
generateJavaSelect(java.lang.String id)
Returns the JPA QL select code
|
int |
generateLoadForeign(JavaWriter out,
java.lang.String rs,
java.lang.String indexVar,
int index)
Returns the foreign type.
|
int |
generateLoadForeign(JavaWriter out,
java.lang.String rs,
java.lang.String indexVar,
int index,
java.lang.String name)
Returns the foreign type.
|
void |
generateLoadFromObject(JavaWriter out,
java.lang.String obj)
Generates loading cache
|
void |
generateMatch(JavaWriter out,
java.lang.String key)
Generates code for a match.
|
java.lang.String |
generateMatchArgWhere(java.lang.String id)
Returns the where code
|
void |
generateMergeFrom(JavaWriter out,
java.lang.String dst,
java.lang.String src)
Keys are not merged
|
void |
generatePrologue(JavaWriter out,
java.util.HashSet<java.lang.Object> completedSet)
Generates any prologue.
|
java.lang.String |
generateRawWhere(java.lang.String id)
Returns the where code
|
java.lang.String |
generateSelect(java.lang.String id)
Returns the select code
|
java.lang.String |
generateSet(java.lang.String objThis,
java.lang.String value)
Generates the field setter.
|
void |
generateSetGeneratedKeys(JavaWriter out,
java.lang.String pstmt)
Generates the set clause.
|
void |
generateSetInsert(JavaWriter out,
java.lang.String pstmt,
java.lang.String index)
Generates the set clause.
|
java.lang.String |
generateSetKeyProperty(java.lang.String key,
java.lang.String value)
Generates the setter for a key property
|
java.lang.String |
generateSetNull(java.lang.String obj)
Generates loading cache
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String value)
Generates the set clause.
|
AmberColumn |
getColumn()
Returns column
|
java.util.ArrayList<AmberColumn> |
getColumns()
Returns columns
|
int |
getComponentCount()
Returns the component count.
|
java.lang.String |
getForeignTypeName()
Returns the foreign type.
|
java.lang.String |
getGenerator()
Gets the generator.
|
AmberType |
getType()
Returns type
|
boolean |
isAutoGenerate()
Returns true for a generator.
|
boolean |
isKey()
Returns true for a key
|
boolean |
isKeyField()
Returns true if key fields are accessed through fields.
|
AmberField |
override(AmberBeanType type)
Creates a copy of the field for a parent
|
void |
setColumn(AmberColumn column)
Sets the column
|
void |
setGenerator(java.lang.String generator)
Sets the generator.
|
void |
setKeyField(boolean isKeyField)
Set true if key fields are accessed through fields.
|
java.lang.String |
toObject(java.lang.String value)
Converts to an object.
|
java.lang.String |
toValue(java.lang.String value)
Converts from an object.
|
generateGetterMethod, generateInsertColumns, generateInsertSet, generateLoad, generateLoadNative, generateLoadSelect, generateNativeColumnNames, generateNull, generateSetterMethod, generateUpdate, generateUpdateSet, generateWhere, getFieldName, getRelatedSourceType, getTable, init, isInsert, isUpdate, setInsert, setType, setUpdate
childDelete, generateCastFromObject, generateCopyLoadObject, generateCopyUpdateObject, generateCreateTableSQL, generateDetach, generateDumpRelationships, generateExpire, generateGet, generateInsert, generateInvalidateForeign, generatePostConstructor, generatePostDelete, generatePostLoadSelect, generatePreDelete, generatePrePersist, generateSet, generateStatementSet, generateSuperGetter, generateSuperGetterMethod, generateSuperSetter, generateSuperSetterMethod, generateUpdate, generateUpdateFromObject, getBeanClass, getCreateLoadMask, getEntitySourceType, getGetterMethod, getGetterName, getIndex, getJavaClass, getJavaType, getJavaTypeName, getLoadGroupIndex, getName, getPersistenceUnit, getSetterMethod, getSetterName, getSourceType, hasLoadGroup, isAbstract, isCascadable, isFieldAccess, isLazy, isOverride, isUpdateable, link, setIndex, setJavaType, setLazy, setLoadGroupIndex, setName, setOverride, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getJavaTypeName
childDelete, generateCastFromObject, generateCopyLoadObject, generateCopyUpdateObject, generateCreateTableSQL, generateDetach, generateDumpRelationships, generateExpire, generateGet, generateGetterMethod, generateInsertColumns, generateInsertSet, generateInvalidateForeign, generateLoad, generateLoadNative, generateLoadSelect, generateNativeColumnNames, generatePostConstructor, generatePostDelete, generatePostLoadSelect, generatePreDelete, generatePrePersist, generateSet, generateSetterMethod, generateStatementSet, generateSuperGetter, generateSuperGetterMethod, generateSuperSetter, generateSuperSetterMethod, generateUpdate, generateUpdate, generateUpdateFromObject, generateUpdateSet, generateWhere, getCreateLoadMask, getGetterMethod, getGetterName, getIndex, getJavaClass, getJavaType, getLoadGroupIndex, getName, getSetterMethod, getSetterName, getSourceType, getTable, hasLoadGroup, init, isAbstract, isCascadable, isLazy, isUpdateable, link, setIndex
public KeyPropertyField(EntityType tableType)
public KeyPropertyField(EntityType tableType, java.lang.String name) throws ConfigException
ConfigException
public KeyPropertyField(EntityType entityType, java.lang.String name, AmberColumn column) throws ConfigException
ConfigException
public boolean isKey()
isKey
in class AbstractField
public boolean isKeyField()
public void setKeyField(boolean isKeyField)
setKeyField
in interface IdField
public void setGenerator(java.lang.String generator)
public java.lang.String getGenerator()
getGenerator
in interface IdField
public boolean isAutoGenerate()
isAutoGenerate
in interface IdField
public void setColumn(AmberColumn column)
setColumn
in class PropertyField
public AmberColumn getColumn()
getColumn
in interface AmberField
getColumn
in class PropertyField
public java.util.ArrayList<AmberColumn> getColumns()
getColumns
in interface IdField
public int getComponentCount()
getComponentCount
in interface IdField
public AmberType getType()
getType
in interface IdField
getType
in class PropertyField
public java.lang.String getForeignTypeName()
getForeignTypeName
in interface IdField
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 java.lang.String generateGet(java.lang.String objThis)
generateGet
in interface AmberField
generateGet
in class AbstractField
value
- the non-null valuepublic java.lang.String generateSet(java.lang.String objThis, java.lang.String value)
generateSet
in interface AmberField
generateSet
in class AbstractField
value
- the non-null valuepublic 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 generateCopy(JavaWriter out, java.lang.String dest, java.lang.String source) throws java.io.IOException
generateCopy
in interface IdField
java.io.IOException
public AmberField override(AmberBeanType type)
override
in interface AmberField
override
in class PropertyField
public java.lang.String generateSelect(java.lang.String id)
generateSelect
in interface AmberField
generateSelect
in class PropertyField
public java.lang.String generateJavaSelect(java.lang.String id)
generateJavaSelect
in interface AmberField
generateJavaSelect
in class AbstractField
public java.lang.String generateMatchArgWhere(java.lang.String id)
generateMatchArgWhere
in interface IdField
public java.lang.String generateRawWhere(java.lang.String id)
generateRawWhere
in interface IdField
public int generateLoadForeign(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index) throws java.io.IOException
generateLoadForeign
in interface IdField
java.io.IOException
public void generateLoadFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
generateLoadFromObject
in interface AmberField
generateLoadFromObject
in class AbstractField
java.io.IOException
public java.lang.String generateSetNull(java.lang.String obj) throws java.io.IOException
java.io.IOException
public java.lang.String generateIsNull(java.lang.String value)
generateIsNull
in interface IdField
public int generateLoadForeign(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index, java.lang.String name) throws java.io.IOException
generateLoadForeign
in interface IdField
java.io.IOException
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String value) throws java.io.IOException
generateStatementSet
in interface AmberField
generateStatementSet
in class PropertyField
java.io.IOException
public void generateMatch(JavaWriter out, java.lang.String key) throws java.io.IOException
java.io.IOException
public java.lang.String generateEquals(java.lang.String left, java.lang.String right)
generateEquals
in interface AmberField
generateEquals
in class AbstractField
public void generateSetInsert(JavaWriter out, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
generateSetInsert
in interface IdField
java.io.IOException
public void generateCheckCreateKey(JavaWriter out) throws java.io.IOException
generateCheckCreateKey
in interface IdField
java.io.IOException
public void generateSetGeneratedKeys(JavaWriter out, java.lang.String pstmt) throws java.io.IOException
generateSetGeneratedKeys
in interface IdField
java.io.IOException
public java.lang.String generateSetKeyProperty(java.lang.String key, java.lang.String value) throws java.io.IOException
generateSetKeyProperty
in interface IdField
java.io.IOException
public java.lang.String generateGetKeyProperty(java.lang.String key)
generateGetKeyProperty
in interface IdField
public java.lang.String generateGetProxyProperty(java.lang.String value)
generateGetProxyProperty
in interface IdField
value
- the non-null valuepublic AmberExpr createExpr(QueryParser parser, PathExpr parent)
createExpr
in interface AmberField
createExpr
in class PropertyField
public java.lang.String toObject(java.lang.String value)
toObject
in interface AmberField
toObject
in class AbstractField