public class Id
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Id(EntityType ownerType) |
|
Id(EntityType ownerType,
java.util.ArrayList<IdField> keys) |
|
Id(EntityType ownerType,
IdField key) |
Modifier and Type | Method and Description |
---|---|
protected void |
addKey(IdField key)
Adds a new field to the id.
|
java.lang.String |
generateCastFromObject(java.lang.String value)
Generates code to convert to the type from the object.
|
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 |
generateCreateTableSQL(AmberPersistenceUnit manager)
Generates the where clause.
|
java.lang.String |
generateEquals(java.lang.String leftBase,
java.lang.String value)
Generates code to test the equals.
|
java.lang.String |
generateGet(java.lang.String obj)
Returns the key for the value
|
java.lang.String |
generateGetProxyKey(java.lang.String value)
Returns the key for the value
|
java.lang.String |
generateJavaSelect(java.lang.String id)
Generates the JPA QL select clause.
|
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
|
java.lang.String |
generateLoadSelect(java.lang.String id)
Generates the select clause.
|
void |
generateMatch(JavaWriter out,
java.lang.String key)
Generates code for a match.
|
java.lang.String |
generateMatchArgWhere(java.lang.String id)
Generates the where clause.
|
void |
generatePrologue(JavaWriter out,
java.util.HashSet<java.lang.Object> completedSet)
Generates any prologue.
|
void |
generatePrologue(JavaWriter out,
java.util.HashSet<java.lang.Object> completedSet,
java.lang.String name)
Generates any prologue.
|
java.lang.String |
generateRawWhere(java.lang.String id)
Generates the where clause.
|
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 loading cache
|
void |
generateSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String value)
Generates the set clause.
|
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.
|
void |
generateSetKey(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String keyObject)
Generates the set clause.
|
void |
generateStatementSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index)
Generates the set clause.
|
void |
generateUpdateFromObject(JavaWriter out,
java.lang.String obj)
Generates loading cache
|
java.util.ArrayList<AmberColumn> |
getColumns()
Returns all the column.
|
EmbeddedIdField |
getEmbeddedIdField()
Returns the embedded id field
|
java.lang.String |
getForeignTypeName()
Returns the foreign type.
|
IdField |
getGeneratedIdField() |
IdField |
getKey()
Returns the keys.
|
int |
getKeyCount()
Returns all the keys.
|
java.util.ArrayList<IdField> |
getKeys()
Returns all the keys.
|
java.lang.Object |
getObject(java.sql.ResultSet rs,
int index)
Generates code to convert to the object.
|
EntityType |
getOwnerType()
Returns the owner type.
|
void |
init()
Initialize the id.
|
boolean |
isEmbeddedId()
Returns true if this is an @EmbeddedId
|
boolean |
isIdentityGenerator() |
java.lang.String |
toObject(java.lang.String value)
Generates code to convert to the object.
|
java.lang.Object |
toObjectKey(long value)
Generates code to convert to the object.
|
public Id(EntityType ownerType, java.util.ArrayList<IdField> keys)
protected Id(EntityType ownerType)
public Id(EntityType ownerType, IdField key)
protected void addKey(IdField key)
public EntityType getOwnerType()
public java.util.ArrayList<AmberColumn> getColumns()
public java.util.ArrayList<IdField> getKeys()
public int getKeyCount()
public IdField getKey()
public java.lang.String getForeignTypeName()
public boolean isIdentityGenerator()
public IdField getGeneratedIdField()
public void init() throws ConfigException
ConfigException
public void generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet, java.lang.String name) throws java.io.IOException
java.io.IOException
public void generatePrologue(JavaWriter out, java.util.HashSet<java.lang.Object> completedSet) throws java.io.IOException
java.io.IOException
public int generateLoadForeign(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index) throws java.io.IOException
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
java.io.IOException
public void generateCopy(JavaWriter out, java.lang.String dest, java.lang.String source) throws java.io.IOException
java.io.IOException
public java.lang.String generateSelect(java.lang.String id)
public java.lang.String generateJavaSelect(java.lang.String id)
public java.lang.String generateLoadSelect(java.lang.String id)
public java.lang.String generateGetProxyKey(java.lang.String value)
public void generateLoadFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
java.io.IOException
public java.lang.String generateGet(java.lang.String obj)
public void generateSet(JavaWriter out, java.lang.String obj, java.lang.String value) throws java.io.IOException
java.io.IOException
public void generateUpdateFromObject(JavaWriter out, java.lang.String obj) throws java.io.IOException
java.io.IOException
public java.lang.String generateMatchArgWhere(java.lang.String id)
public java.lang.String generateRawWhere(java.lang.String id)
public java.lang.String generateCreateTableSQL(AmberPersistenceUnit manager)
public void generateSetKey(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String keyObject) throws java.io.IOException
java.io.IOException
public void generateSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String value) throws java.io.IOException
java.io.IOException
public void generateStatementSet(JavaWriter out, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
java.io.IOException
public void generateSetInsert(JavaWriter out, java.lang.String pstmt, java.lang.String index) throws java.io.IOException
java.io.IOException
public java.lang.String generateCastFromObject(java.lang.String value)
public void generateMatch(JavaWriter out, java.lang.String key) throws java.io.IOException
java.io.IOException
public java.lang.String generateEquals(java.lang.String leftBase, java.lang.String value)
public void generateCheckCreateKey(JavaWriter out) throws java.io.IOException
java.io.IOException
public void generateSetGeneratedKeys(JavaWriter out, java.lang.String pstmt) throws java.io.IOException
java.io.IOException
public EmbeddedIdField getEmbeddedIdField()
public boolean isEmbeddedId()
public java.lang.String toObject(java.lang.String value)
public java.lang.Object toObjectKey(long value)
public java.lang.Object getObject(java.sql.ResultSet rs, int index) throws java.sql.SQLException
java.sql.SQLException