|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.tool.hbm2x.pojo.BasicPOJOClass
public abstract class BasicPOJOClass
Abstract implementation of POJOClass. To be extended by ComponentPOJO and EntityPOJO
| Field Summary | |
|---|---|
protected Cfg2JavaTool |
c2j
|
protected ImportContext |
importContext
|
protected org.hibernate.mapping.MetaAttributable |
meta
|
| Fields inherited from interface org.hibernate.tool.hbm2x.MetaAttributeConstants |
|---|
CLASS_DESCRIPTION, CLASS_MODIFIER, EXTENDS, GEN_PROPERTY, GENERATED_CLASS, IMPLEMENTS, INTERFACE, SCOPE_CLASS |
| Constructor Summary | |
|---|---|
BasicPOJOClass(org.hibernate.mapping.MetaAttributable ma,
Cfg2JavaTool c2j)
|
|
| Method Summary | |
|---|---|
protected void |
appendCommonColumnInfo(StringBuffer annotations,
org.hibernate.mapping.Column column,
boolean insertable,
boolean updatable)
|
static String |
beanCapitalize(String fieldname)
foo -> Foo FOo -> FOo |
String |
generateAnnColumnAnnotation(org.hibernate.mapping.Property property)
|
String |
generateBasicAnnotation(org.hibernate.mapping.Property property)
|
String |
generateEquals(String thisName,
String otherName,
boolean useGenerics)
|
protected String |
generateEquals(String thisName,
String otherName,
Iterator allPropertiesIterator,
boolean useGenerics)
|
String |
generateHashCode(org.hibernate.mapping.Property property,
String result,
String thisName,
boolean jdk5)
|
String |
generateImports()
|
abstract Iterator |
getAllPropertiesIterator()
returns the properties that would be visible on this entity as a pojo. |
String |
getClassJavaDoc(String fallback,
int indent)
Returns the javadoc associated with the class. |
String |
getClassModifiers()
|
String |
getCollectionNameFor(org.hibernate.mapping.Property property)
|
String |
getDeclarationName()
|
String |
getDeclarationType()
|
Iterator |
getEqualsHashCodePropertiesIterator()
|
abstract String |
getExtends()
|
String |
getExtendsDeclaration()
|
String |
getExtraClassCode()
|
String |
getFieldDescription(org.hibernate.mapping.Property property)
|
String |
getFieldInitialization(org.hibernate.mapping.Property p,
boolean useGenerics)
|
String |
getFieldJavaDoc(org.hibernate.mapping.Property property,
int indent)
|
String |
getFieldModifiers(org.hibernate.mapping.Property property)
|
protected String |
getGeneratedClassName()
|
String |
getGetterSignature(org.hibernate.mapping.Property p)
Method getGetterSignature. |
abstract String |
getImplements()
|
String |
getImplementsDeclaration()
|
String |
getJavaTypeName(org.hibernate.mapping.Property p,
boolean useGenerics)
|
protected abstract String |
getMappedClassName()
|
boolean |
getMetaAsBool(String attribute)
|
boolean |
getMetaAsBool(String attribute,
boolean defaultValue)
|
String |
getMetaAsString(String attribute)
|
String |
getMetaAsString(String attribute,
String seperator)
|
boolean |
getMetaAttribAsBool(org.hibernate.mapping.MetaAttributable pc,
String attribute,
boolean defaultValue)
|
String |
getPackageDeclaration()
Returns "package packagename;" where packagename is either the declared packagename, or the one provide via meta attribute "generated-class". |
protected String |
getPackageDeclaration(String pkgName)
|
String |
getPackageName()
Return package name. |
String |
getPropertyGetModifiers(org.hibernate.mapping.Property property)
|
String |
getPropertyName(org.hibernate.mapping.Property p)
|
String |
getPropertySetModifiers(org.hibernate.mapping.Property property)
|
String |
getQualifiedDeclarationName()
|
String |
getShortName()
|
Iterator |
getToStringPropertiesIterator()
|
boolean |
hasFieldInitializor(org.hibernate.mapping.Property p,
boolean useGenerics)
|
boolean |
hasFieldJavaDoc(org.hibernate.mapping.Property property)
|
boolean |
hasMetaAttribute(org.hibernate.mapping.MetaAttributable pc,
String attribute)
|
boolean |
hasMetaAttribute(String attribute)
|
String |
importType(String fqcn)
Add fqcn to the import list. |
protected void |
init()
|
boolean |
isComponent(org.hibernate.mapping.Property property)
|
boolean |
isInterface()
|
protected boolean |
isRequiredInConstructor(org.hibernate.mapping.Property field)
|
boolean |
needsEqualsHashCode()
|
boolean |
needsFullConstructor()
|
boolean |
needsMinimalConstructor()
|
boolean |
needsToString()
|
protected String |
qualifyInnerClass(String className)
|
String |
staticImport(String fqcn,
String member)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ImportContext importContext
protected org.hibernate.mapping.MetaAttributable meta
protected final Cfg2JavaTool c2j
| Constructor Detail |
|---|
public BasicPOJOClass(org.hibernate.mapping.MetaAttributable ma,
Cfg2JavaTool c2j)
| Method Detail |
|---|
protected void init()
protected String getPackageDeclaration(String pkgName)
public String getPackageDeclaration()
POJOClass
getPackageDeclaration in interface POJOClasspublic String getPackageName()
getPackageName in interface POJOClasspublic String getShortName()
getShortName in interface POJOClasspublic String getQualifiedDeclarationName()
getQualifiedDeclarationName in interface POJOClasspublic String getDeclarationName()
getDeclarationName in interface POJOClassprotected String getGeneratedClassName()
protected String qualifyInnerClass(String className)
protected abstract String getMappedClassName()
public String getMetaAsString(String attribute)
public boolean hasMetaAttribute(String attribute)
public String getMetaAsString(String attribute,
String seperator)
public boolean getMetaAsBool(String attribute)
public boolean getMetaAsBool(String attribute,
boolean defaultValue)
public String getClassJavaDoc(String fallback,
int indent)
POJOClass
getClassJavaDoc in interface POJOClassfallback - the default text if nothing else is foundindent - how many spaces should be added
public String getClassModifiers()
getClassModifiers in interface POJOClasspublic String getDeclarationType()
getDeclarationType in interface POJOClasspublic boolean isInterface()
isInterface in interface POJOClasspublic String getExtendsDeclaration()
getExtendsDeclaration in interface POJOClasspublic String getImplementsDeclaration()
getImplementsDeclaration in interface POJOClass
public String generateEquals(String thisName,
String otherName,
boolean useGenerics)
generateEquals in interface POJOClasspublic abstract Iterator getAllPropertiesIterator()
getAllPropertiesIterator in interface POJOClass
protected String generateEquals(String thisName,
String otherName,
Iterator allPropertiesIterator,
boolean useGenerics)
public String getExtraClassCode()
getExtraClassCode in interface POJOClasspublic boolean needsEqualsHashCode()
needsEqualsHashCode in interface POJOClasspublic abstract String getExtends()
getExtends in interface POJOClasspublic abstract String getImplements()
getImplements in interface POJOClasspublic String importType(String fqcn)
ImportContext
importType in interface ImportContextpublic String generateImports()
generateImports in interface ImportContext
public String staticImport(String fqcn,
String member)
staticImport in interface ImportContextpublic String generateBasicAnnotation(org.hibernate.mapping.Property property)
generateBasicAnnotation in interface POJOClasspublic String generateAnnColumnAnnotation(org.hibernate.mapping.Property property)
generateAnnColumnAnnotation in interface POJOClass
protected void appendCommonColumnInfo(StringBuffer annotations,
org.hibernate.mapping.Column column,
boolean insertable,
boolean updatable)
public Iterator getToStringPropertiesIterator()
getToStringPropertiesIterator in interface POJOClasspublic Iterator getEqualsHashCodePropertiesIterator()
getEqualsHashCodePropertiesIterator in interface POJOClasspublic boolean needsToString()
needsToString in interface POJOClass
public boolean hasMetaAttribute(org.hibernate.mapping.MetaAttributable pc,
String attribute)
public boolean getMetaAttribAsBool(org.hibernate.mapping.MetaAttributable pc,
String attribute,
boolean defaultValue)
public boolean hasFieldJavaDoc(org.hibernate.mapping.Property property)
public String getFieldJavaDoc(org.hibernate.mapping.Property property,
int indent)
getFieldJavaDoc in interface POJOClasspublic String getFieldDescription(org.hibernate.mapping.Property property)
getFieldDescription in interface POJOClasspublic String getGetterSignature(org.hibernate.mapping.Property p)
public String getPropertyName(org.hibernate.mapping.Property p)
p -
public String getCollectionNameFor(org.hibernate.mapping.Property property)
public static String beanCapitalize(String fieldname)
public boolean isComponent(org.hibernate.mapping.Property property)
public String generateHashCode(org.hibernate.mapping.Property property,
String result,
String thisName,
boolean jdk5)
public String getFieldModifiers(org.hibernate.mapping.Property property)
public String getPropertyGetModifiers(org.hibernate.mapping.Property property)
public String getPropertySetModifiers(org.hibernate.mapping.Property property)
protected boolean isRequiredInConstructor(org.hibernate.mapping.Property field)
public boolean needsMinimalConstructor()
needsMinimalConstructor in interface POJOClasspublic boolean needsFullConstructor()
needsFullConstructor in interface POJOClass
public String getJavaTypeName(org.hibernate.mapping.Property p,
boolean useGenerics)
getJavaTypeName in interface POJOClass
public boolean hasFieldInitializor(org.hibernate.mapping.Property p,
boolean useGenerics)
public String getFieldInitialization(org.hibernate.mapping.Property p,
boolean useGenerics)
getFieldInitialization in interface POJOClass
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||