public class KeyManyToOneField extends ManyToOneField implements IdField
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
KeyManyToOneField(EntityType entityType,
java.lang.String name) |
KeyManyToOneField(EntityType entityType,
java.lang.String name,
LinkColumns columns) |
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 |
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.
|
void |
generateJoin(CharBuffer cb,
java.lang.String table1,
java.lang.String table2)
Generates the linking for a join
|
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.
|
java.lang.String |
generateMatchArgWhere(java.lang.String id)
Returns the where code
|
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
|
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
|
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 value)
Generates the set clause.
|
java.lang.String |
generateSuperGetter(java.lang.String objThis)
Returns the actual data.
|
java.lang.String |
generateSuperSetter(java.lang.String objThis,
java.lang.String value)
Sets the actual data.
|
AmberColumn |
getColumn()
Returns the column for the field
|
ForeignColumn |
getColumn(AmberColumn key)
Gets the column corresponding to the target field.
|
java.util.ArrayList<AmberColumn> |
getColumns()
Returns columns
|
int |
getComponentCount()
Returns the component count.
|
EntityType |
getEntityType()
Returns the target type as entity (ejb 2.1)
See com.caucho.ejb.ql.Expr
|
java.lang.String |
getForeignTypeName()
Returns the foreign type name.
|
java.lang.String |
getGenerator()
Gets the generator.
|
KeyPropertyField |
getIdField(IdField field)
Returns the identifying field matching the target's id.
|
AmberType |
getType()
Returns type
|
void |
init()
Initialize the field.
|
boolean |
isAutoGenerate()
Returns true for a generator.
|
boolean |
isSourceCascadeDelete()
Set true if deletes cascade to the source.
|
boolean |
isTargetCascadeDelete()
Set true if deletes cascade to the target.
|
void |
setKeyField(boolean isKeyField)
Set true if key fields are accessed through fields.
|
java.lang.String |
toValue(java.lang.String value)
Converts from an object.
|
generateCopyLoadObject, generateCopyUpdateObject, generateGetterMethod, generateInsertColumns, generateInvalidateForeign, generateLoad, generateLoadProperty, generateLoadSelect, generateMergeFrom, generatePostConstructor, generatePostDelete, generatePostLoadSelect, generatePreDelete, generatePrePersist, generateSelect, generateSetterMethod, generateUpdate, generateUpdateFromObject, getEntityTargetType, getJoinColumnMap, getJoinColumns, getLinkColumns, getRelatedType, init, isAnnotatedManyToOne, override, setAliasField, setJoinColumnMap, setJoinColumns, setLinkColumns, setSourceCascadeDelete, setTargetCascadeDelete, setTargetField, setType
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, generateSuperGetterMethod, generateSuperSetterMethod, generateUpdate, generateUpdateSet, generateWhere, getBeanClass, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getJavaTypeName
childDelete, generateCastFromObject, generateCopyLoadObject, generateCopyUpdateObject, generateCreateTableSQL, generateDetach, generateDumpRelationships, generateEquals, generateExpire, generateGet, generateGet, generateGetterMethod, generateInsertColumns, generateInsertSet, generateInvalidateForeign, generateJavaSelect, generateLoad, generateLoadFromObject, generateLoadNative, generateLoadSelect, generateMergeFrom, generateNativeColumnNames, generatePostConstructor, generatePostDelete, generatePostLoadSelect, generatePreDelete, generatePrePersist, generateSelect, generateSet, generateSet, generateSetterMethod, generateSuperGetterMethod, generateSuperSetterMethod, generateUpdate, generateUpdate, generateUpdateFromObject, generateUpdateSet, generateWhere, getCreateLoadMask, getGetterMethod, getGetterName, getIndex, getJavaClass, getJavaType, getLoadGroupIndex, getName, getSetterMethod, getSetterName, getSourceType, getTable, hasLoadGroup, isAbstract, isCascadable, isLazy, isUpdateable, link, override, setIndex, toObject
public KeyManyToOneField(EntityType entityType, java.lang.String name) throws ConfigException
ConfigException
public KeyManyToOneField(EntityType entityType, java.lang.String name, LinkColumns columns) throws ConfigException
ConfigException
public java.lang.String getGenerator()
getGenerator
in interface IdField
public EntityType getEntityType()
public AmberColumn getColumn()
AbstractField
getColumn
in interface AmberField
getColumn
in class AbstractField
public boolean isAutoGenerate()
isAutoGenerate
in interface IdField
public void setKeyField(boolean isKeyField)
setKeyField
in interface IdField
public java.lang.String getForeignTypeName()
getForeignTypeName
in interface IdField
getForeignTypeName
in class ManyToOneField
public boolean isTargetCascadeDelete()
isTargetCascadeDelete
in class ManyToOneField
public boolean isSourceCascadeDelete()
isSourceCascadeDelete
in class ManyToOneField
public void init() throws ConfigException
init
in interface AmberField
init
in class ManyToOneField
ConfigException
public int getComponentCount()
getComponentCount
in interface IdField
public java.util.ArrayList<AmberColumn> getColumns()
getColumns
in interface IdField
public KeyPropertyField getIdField(IdField field)
public AmberExpr createExpr(QueryParser parser, PathExpr parent)
createExpr
in interface AmberField
createExpr
in class ManyToOneField
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 java.lang.String generateGetProxyProperty(java.lang.String value)
generateGetProxyProperty
in interface IdField
value
- the non-null valuepublic void generateJoin(CharBuffer cb, java.lang.String table1, java.lang.String table2)
generateJoin
in class ManyToOneField
public ForeignColumn getColumn(AmberColumn key)
getColumn
in class ManyToOneField
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 java.lang.String generateSuperGetter(java.lang.String objThis)
generateSuperGetter
in interface AmberField
generateSuperGetter
in class AbstractField
public java.lang.String generateSuperSetter(java.lang.String objThis, java.lang.String value)
generateSuperSetter
in interface AmberField
generateSuperSetter
in class AbstractField
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 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 generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet) throws java.io.IOException
generatePrologue
in interface AmberField
generatePrologue
in class ManyToOneField
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 ManyToOneField
java.io.IOException
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
generateStatementSet
in interface AmberField
generateStatementSet
in class AbstractField
java.io.IOException
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 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) throws java.io.IOException
generateGetKeyProperty
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 void generateCheckCreateKey(JavaWriter out) throws java.io.IOException
generateCheckCreateKey
in interface IdField
java.io.IOException
public java.lang.String generateIsNull(java.lang.String value)
generateIsNull
in interface IdField