com.caucho.amber.field
Class SubId

java.lang.Object
  extended by com.caucho.amber.field.Id
      extended by com.caucho.amber.field.SubId

public class SubId
extends Id

Configuration for a bean's field


Constructor Summary
SubId(EntityType ownerType, EntityType rootType)
           
 
Method Summary
 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.
 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 value)
          Returns the key for the value
 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.
 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
 void generateSet(JavaWriter out, java.lang.String pstmt, java.lang.String obj, java.lang.String index)
          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 obj, java.lang.String index)
          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.lang.String getForeignTypeName()
          Returns the foreign type.
 java.util.ArrayList<IdField> getKeys()
          Returns the keys.
 java.util.ArrayList<IdField> getParentKeys()
          Returns the parent keys.
 java.lang.String toObject(java.lang.String value)
          Generates code to convert to the object.
 
Methods inherited from class com.caucho.amber.field.Id
addKey, generateCopy, generateGetProxyKey, generateJavaSelect, generatePrologue, generateRawWhere, generateSetGeneratedKeys, getColumns, getEmbeddedIdField, getGeneratedIdField, getKey, getKeyCount, getObject, getOwnerType, init, isEmbeddedId, isIdentityGenerator, toObjectKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubId

public SubId(EntityType ownerType,
             EntityType rootType)
Method Detail

getParentKeys

public java.util.ArrayList<IdField> getParentKeys()
Returns the parent keys.


getKeys

public java.util.ArrayList<IdField> getKeys()
Returns the keys.

Overrides:
getKeys in class Id

getForeignTypeName

public java.lang.String getForeignTypeName()
Returns the foreign type.

Overrides:
getForeignTypeName in class Id

generatePrologue

public void generatePrologue(JavaWriter out,
                             java.util.HashSet<java.lang.Object> completedSet)
                      throws java.io.IOException
Generates any prologue.

Overrides:
generatePrologue in class Id
Throws:
java.io.IOException

generateLoadForeign

public int generateLoadForeign(JavaWriter out,
                               java.lang.String rs,
                               java.lang.String indexVar,
                               int index)
                        throws java.io.IOException
Returns the foreign type.

Overrides:
generateLoadForeign in class Id
Throws:
java.io.IOException

generateLoadForeign

public int generateLoadForeign(JavaWriter out,
                               java.lang.String rs,
                               java.lang.String indexVar,
                               int index,
                               java.lang.String name)
                        throws java.io.IOException
Returns the foreign type.

Overrides:
generateLoadForeign in class Id
Throws:
java.io.IOException

generateSelect

public java.lang.String generateSelect(java.lang.String id)
Generates the select clause.

Overrides:
generateSelect in class Id

generateLoadSelect

public java.lang.String generateLoadSelect(java.lang.String id)
Generates the select clause.

Overrides:
generateLoadSelect in class Id

generateGet

public java.lang.String generateGet(java.lang.String value)
Returns the key for the value

Overrides:
generateGet in class Id

generateLoadFromObject

public void generateLoadFromObject(JavaWriter out,
                                   java.lang.String obj)
                            throws java.io.IOException
Generates loading cache

Overrides:
generateLoadFromObject in class Id
Throws:
java.io.IOException

generateSet

public void generateSet(JavaWriter out,
                        java.lang.String objThis,
                        java.lang.String value)
                 throws java.io.IOException
Generates loading cache

Overrides:
generateSet in class Id
Throws:
java.io.IOException

generateUpdateFromObject

public void generateUpdateFromObject(JavaWriter out,
                                     java.lang.String obj)
                              throws java.io.IOException
Generates loading cache

Overrides:
generateUpdateFromObject in class Id
Throws:
java.io.IOException

generateMatchArgWhere

public java.lang.String generateMatchArgWhere(java.lang.String id)
Generates the where clause.

Overrides:
generateMatchArgWhere in class Id

generateCreateTableSQL

public java.lang.String generateCreateTableSQL(AmberPersistenceUnit manager)
Generates the where clause.

Overrides:
generateCreateTableSQL in class Id

generateSetKey

public void generateSetKey(JavaWriter out,
                           java.lang.String pstmt,
                           java.lang.String obj,
                           java.lang.String index)
                    throws java.io.IOException
Generates the set clause.

Overrides:
generateSetKey in class Id
Throws:
java.io.IOException

generateSet

public void generateSet(JavaWriter out,
                        java.lang.String pstmt,
                        java.lang.String obj,
                        java.lang.String index)
                 throws java.io.IOException
Generates the set clause.

Overrides:
generateSet in class Id
Throws:
java.io.IOException

generateStatementSet

public void generateStatementSet(JavaWriter out,
                                 java.lang.String pstmt,
                                 java.lang.String index)
                          throws java.io.IOException
Generates the set clause.

Overrides:
generateStatementSet in class Id
Throws:
java.io.IOException

generateSetInsert

public void generateSetInsert(JavaWriter out,
                              java.lang.String pstmt,
                              java.lang.String index)
                       throws java.io.IOException
Generates the set clause.

Overrides:
generateSetInsert in class Id
Throws:
java.io.IOException

generateCastFromObject

public java.lang.String generateCastFromObject(java.lang.String value)
Generates code to convert to the type from the object.

Overrides:
generateCastFromObject in class Id

generateMatch

public void generateMatch(JavaWriter out,
                          java.lang.String key)
                   throws java.io.IOException
Generates code for a match.

Overrides:
generateMatch in class Id
Throws:
java.io.IOException

generateEquals

public java.lang.String generateEquals(java.lang.String leftBase,
                                       java.lang.String value)
Generates code to test the equals.

Overrides:
generateEquals in class Id

generateCheckCreateKey

public void generateCheckCreateKey(JavaWriter out)
                            throws java.io.IOException
Generates the set clause.

Overrides:
generateCheckCreateKey in class Id
Throws:
java.io.IOException

toObject

public java.lang.String toObject(java.lang.String value)
Generates code to convert to the object.

Overrides:
toObject in class Id