Class Cfg2JavaTool
java.lang.Object
org.hibernate.tool.internal.export.java.Cfg2JavaTool
Helper methods for javacode generation.
- Author:
- max
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasArgumentList(Iterator<?> fields) asArgumentList(List<org.hibernate.mapping.Property> fields) asFinderArgumentList(Map<Object, Object> parameterTypes, ImportContext ctx) asNaturalIdParameterList(org.hibernate.mapping.PersistentClass clazz) asParameterList(Iterator<?> fields, boolean useGenerics, ImportContext ic) asParameterList(List<org.hibernate.mapping.Property> fields, boolean useGenerics, ImportContext ic) getClassModifiers(org.hibernate.mapping.MetaAttributable pc) getFilteredIdentifierGeneratorProperties(org.hibernate.mapping.SimpleValue simpleValue) getGenericCollectionDeclaration(org.hibernate.mapping.Collection collection, boolean preferRawTypeNames, ImportContext importContext) getJavaTypeName(org.hibernate.mapping.Property p, boolean useGenerics) Returns the typename for a property, using generics if this is a Set type and useGenerics is set to true.getJavaTypeName(org.hibernate.mapping.Property p, boolean useGenerics, ImportContext importContext) booleangetMetaAsBool(org.hibernate.mapping.MetaAttributable ma, String attribute) booleangetMetaAsBool(org.hibernate.mapping.MetaAttributable pc, String attribute, boolean defaultValue) getMetaAsString(org.hibernate.mapping.MetaAttributable pc, String attribute) Returns all meta items as one large string.getMetaAsString(org.hibernate.mapping.MetaAttributable pc, String attribute, String seperator) Map<?, ?> getParameterTypes(org.hibernate.boot.query.NamedHqlQueryDefinition<?> query) getPOJOClass(org.hibernate.mapping.Component comp) getPOJOClass(org.hibernate.mapping.PersistentClass comp) getPOJOIterator(Iterator<org.hibernate.mapping.PersistentClass> persistentClasses) booleanhasMetaAttribute(org.hibernate.mapping.MetaAttributable pc, String attribute) booleanbooleanisComponent(org.hibernate.mapping.Property property) booleanisComponent(org.hibernate.mapping.Value value) static booleanisNonPrimitiveTypeName(String typeName) booleanisPrimitive(String typeName) keyWordCheck(String possibleKeyword) simplePluralize(String str) Convert string into something that can be rendered nicely into a javadoc comment.
-
Constructor Details
-
Cfg2JavaTool
public Cfg2JavaTool()
-
-
Method Details
-
getPOJOClass
-
getPOJOClass
-
unqualify
-
getMetaAsString
Returns all meta items as one large string. -
hasMetaAttribute
-
getMetaAsString
-
getMetaAsBool
-
getMetaAsBool
public boolean getMetaAsBool(org.hibernate.mapping.MetaAttributable pc, String attribute, boolean defaultValue) -
toJavaDoc
Convert string into something that can be rendered nicely into a javadoc comment. Prefix each line with a star ('*').- Parameters:
string-
-
getClassModifiers
-
getJavaTypeName
Returns the typename for a property, using generics if this is a Set type and useGenerics is set to true. -
getJavaTypeName
public String getJavaTypeName(org.hibernate.mapping.Property p, boolean useGenerics, ImportContext importContext) -
isNonPrimitiveTypeName
-
getGenericCollectionDeclaration
public String getGenericCollectionDeclaration(org.hibernate.mapping.Collection collection, boolean preferRawTypeNames, ImportContext importContext) -
getFilteredIdentifierGeneratorProperties
public Properties getFilteredIdentifierGeneratorProperties(org.hibernate.mapping.SimpleValue simpleValue) - Parameters:
simpleValue-- Returns:
-
asParameterList
-
asArgumentList
- Parameters:
fields- iterator on Property elements.- Returns:
- "name, number, ..." for a property list, usable for method calls. TODO: handle this in a template ?
-
asNaturalIdParameterList
- Parameters:
clazz- persistent class.- Returns:
- "String name, int number, ..." for a property list, usable for method declarations. TODO: handle this in a template ?
-
asParameterList
public String asParameterList(List<org.hibernate.mapping.Property> fields, boolean useGenerics, ImportContext ic) -
asArgumentList
-
asFinderArgumentList
-
isPrimitive
-
isComponent
public boolean isComponent(org.hibernate.mapping.Property property) -
isComponent
public boolean isComponent(org.hibernate.mapping.Value value) -
getPOJOIterator
-
simplePluralize
-
keyWordCheck
-
isArray
-
getParameterTypes
-