org.objectweb.jonas_ejb.genic
Class VcField

java.lang.Object
  extended by org.objectweb.jonas_ejb.genic.VcField

public class VcField
extends java.lang.Object

This class is the "Velocity context" for a container managed persistence bean's field used in the Velocity Template.

Author:
Helene Joanin : Initial developer

Constructor Summary
VcField(java.lang.String mName, java.lang.Class fType, FieldDesc fd, boolean isCmp1)
          VcField constructor
 
Method Summary
 java.lang.String getConvertClassName()
           
 java.lang.String getDefaultValue()
           
 java.lang.String getGetterName()
           
 java.lang.String getJormTypeName()
           
 java.lang.String getName()
           
 java.lang.String getNameUpperFirst()
           
 java.lang.String getSetterName()
           
 java.lang.String getSqlGetMethod()
           
 java.lang.String getSqlSetMethod()
           
 java.lang.String getSqlTypeName()
           
 java.lang.String getTypeName()
           
 boolean hasBigIntegerType()
           
 boolean hasJavaLangTypeExceptString()
           
 boolean hasNotPrimitiveType()
           
 boolean hasSerializableType()
           
 boolean isMustBeConvert()
           
 boolean isPrimaryKey()
           
 java.lang.String jormGetter()
           
 java.lang.String jormSetter()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VcField

public VcField(java.lang.String mName,
               java.lang.Class fType,
               FieldDesc fd,
               boolean isCmp1)
VcField constructor

Parameters:
mName - name of the cmp field
fType - type of the cmp field
fd - field descriptor of the cmp field
isCmp1 - true if it's a cmp version 1 field, false if it's a cmp version 2 field.
Method Detail

getName

public java.lang.String getName()
Returns:
the name of the cmp field

getNameUpperFirst

public java.lang.String getNameUpperFirst()
Returns:
the name, with the first letter capitalized, of the cmp field

jormGetter

public java.lang.String jormGetter()

jormSetter

public java.lang.String jormSetter()

getGetterName

public java.lang.String getGetterName()
Returns:
the name of the getter method of the cmp field

getSetterName

public java.lang.String getSetterName()
Returns:
the name of the setter method of the cmp field

getTypeName

public java.lang.String getTypeName()
Returns:
the type name of the cmp field

isPrimaryKey

public boolean isPrimaryKey()
Returns:
true if the cmp field composes the primary key

getDefaultValue

public java.lang.String getDefaultValue()
Returns:
the string representation of the java default value for the cmp field (ie "0 "for int, "null" for object ...)

getSqlTypeName

public java.lang.String getSqlTypeName()
Returns:
the SQL type name of the cmp field

getSqlGetMethod

public java.lang.String getSqlGetMethod()
Returns:
the SQL getter method name for the cmp field

getSqlSetMethod

public java.lang.String getSqlSetMethod()
Returns:
the SQL setter method name for the cmp field

hasNotPrimitiveType

public boolean hasNotPrimitiveType()
Returns:
true if the type of the cmp field is not a java primitive type

hasBigIntegerType

public boolean hasBigIntegerType()
Returns:
true if the type of the cmp field is java.math.BigInteger

hasSerializableType

public boolean hasSerializableType()
Returns:
true of the type of the cmp field is Serializable

hasJavaLangTypeExceptString

public boolean hasJavaLangTypeExceptString()
Returns:
true if the type of the cmp type is a java.lag type except java.lang.String

getJormTypeName

public java.lang.String getJormTypeName()
Returns:
the JORM type name of the cmp field

isMustBeConvert

public boolean isMustBeConvert()
Returns:
true if a conversion must be dome between the memory representation and the storage representation for the cmp field

getConvertClassName

public java.lang.String getConvertClassName()
Returns:
the class name of for the convertion between the memory representation and the storage representation for the cmp field

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the VcField for debug use