com.caucho.amber.field
Class VersionField

java.lang.Object
  extended by com.caucho.amber.field.AbstractField
      extended by com.caucho.amber.field.PropertyField
          extended by com.caucho.amber.field.VersionField
All Implemented Interfaces:
AmberField

public class VersionField
extends PropertyField

Configuration for a bean's field


Constructor Summary
VersionField(EntityType entityType)
           
VersionField(EntityType entityType, java.lang.String name)
           
 
Method Summary
 void generateIncrementVersion(JavaWriter out)
          Generates the increment version.
 java.lang.String generateIsNull()
          Generates the is null test.
 java.lang.String generateMatchArgWhere(java.lang.String id)
          Returns the where code
 void generatePostConstructor(JavaWriter out)
          Generates the post constructor initialization.
 void generateSetVersion(JavaWriter out, java.lang.String pstmt, java.lang.String index)
          Generates the set version clause.
 void generateUpdate(CharBuffer sql)
          Generates the update set clause
 void generateUpdate(JavaWriter out, java.lang.String maskVar, java.lang.String pstmt, java.lang.String index)
          Generates loading cache
 
Methods inherited from class com.caucho.amber.field.PropertyField
createExpr, generateGetterMethod, generateInsertColumns, generateInsertSet, generateLoad, generateLoadNative, generateLoadSelect, generateNativeColumnNames, generateNull, generateSelect, generateSetterMethod, generateStatementSet, generateUpdateSet, generateWhere, getColumn, getFieldName, getRelatedSourceType, getTable, getType, init, isInsert, isUpdate, override, setColumn, setInsert, setType, setUpdate
 
Methods inherited from class com.caucho.amber.field.AbstractField
childDelete, generateCastFromObject, generateCopyLoadObject, generateCopyUpdateObject, generateCreateTableSQL, generateDetach, generateDumpRelationships, generateEquals, generateExpire, generateGet, generateGet, generateInsert, generateInvalidateForeign, generateJavaSelect, generateLoadFromObject, generateMergeFrom, generatePostDelete, generatePostLoadSelect, generatePreDelete, generatePrePersist, generatePrologue, generateSet, generateSet, generateStatementSet, generateSuperGetter, generateSuperGetterMethod, generateSuperSetter, generateSuperSetterMethod, generateUpdateFromObject, getBeanClass, getCreateLoadMask, getEntitySourceType, getGetterMethod, getGetterName, getIndex, getJavaClass, getJavaType, getJavaTypeName, getLoadGroupIndex, getName, getPersistenceUnit, getSetterMethod, getSetterName, getSourceType, hasLoadGroup, isAbstract, isCascadable, isFieldAccess, isKey, isLazy, isOverride, isUpdateable, link, setIndex, setJavaType, setLazy, setLoadGroupIndex, setName, setOverride, toObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionField

public VersionField(EntityType entityType,
                    java.lang.String name)
             throws ConfigException
Throws:
ConfigException

VersionField

public VersionField(EntityType entityType)
Method Detail

generateIsNull

public java.lang.String generateIsNull()
Generates the is null test.


generateIncrementVersion

public void generateIncrementVersion(JavaWriter out)
                              throws java.io.IOException
Generates the increment version.

Throws:
java.io.IOException

generateMatchArgWhere

public java.lang.String generateMatchArgWhere(java.lang.String id)
Returns the where code


generatePostConstructor

public void generatePostConstructor(JavaWriter out)
                             throws java.io.IOException
Generates the post constructor initialization.

Specified by:
generatePostConstructor in interface AmberField
Overrides:
generatePostConstructor in class AbstractField
Throws:
java.io.IOException

generateSetVersion

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

Throws:
java.io.IOException

generateUpdate

public void generateUpdate(CharBuffer sql)
Generates the update set clause

Specified by:
generateUpdate in interface AmberField
Overrides:
generateUpdate in class PropertyField

generateUpdate

public void generateUpdate(JavaWriter out,
                           java.lang.String maskVar,
                           java.lang.String pstmt,
                           java.lang.String index)
                    throws java.io.IOException
Generates loading cache

Specified by:
generateUpdate in interface AmberField
Overrides:
generateUpdate in class AbstractField
Throws:
java.io.IOException