public class JpaTemplatesGeneratorUtil
extends org.nuiton.eugene.java.JavaGeneratorUtil
| Modifier and Type | Field and Description |
|---|---|
static Comparator<org.nuiton.eugene.models.object.ObjectModelClass> |
OBJECT_MODEL_CLASS_COMPARATOR |
| Constructor and Description |
|---|
JpaTemplatesGeneratorUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsMutiple(Collection<org.nuiton.eugene.models.object.ObjectModelAttribute> attributes) |
static boolean |
generateEntityGeneratedValueAnnotation(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClass clazz) |
static String |
getAttributeName(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static String |
getAttributeType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static Class<?> |
getCollectionInstanceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static Class<?> |
getCollectionType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static String |
getConcreteDaoQualifiedName(AbstractJpaTransformer transformer,
org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getConcreteEntityQualifiedName(AbstractJpaTransformer transformer,
org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getDaoAbstractName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getDaoConcreteName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getDaoGeneratedName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getDaoPackage(AbstractJpaTransformer transformer,
org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier input) |
static String |
getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
JpaTemplatesTagValues.TAG_DAO_SUPER_CLASS
tag value on the given model or classifier. |
static String |
getEntityAbstractName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static List<org.nuiton.eugene.models.object.ObjectModelClass> |
getEntityClasses(org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
Obtain the list of entities classes with the possibility to sort the
result.
|
static String |
getEntityConcreteName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getEntityPackage(AbstractJpaTransformer transformer,
org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier input) |
static String |
getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS
tag value on the given model or classifier. |
static String |
getGenerateExtraTechnicalFieldsTagValue(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
JpaTemplatesTagValues.TAG_GENERATE_EXTRA_TECHNICAL_FIELDS
tag value on the given model. |
static String |
getGeneratePropertyChangeListenersTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
JpaTemplatesTagValues.TAG_GENERATE_PROPERTY_CHANGE_LISTENERS
tag value on the given model. |
static String |
getGenerateVisitorsTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
JpaTemplatesTagValues.TAG_GENERATE_VISITORS
tag value on the given model. |
static String |
getIdFactoryTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
JpaTemplatesTagValues.TAG_ID_FACTORY
tag value on the given model. |
static String |
getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
JpaTemplatesTagValues.TAG_INVERSE
tag value on the given attribute. |
static String |
getPersistenceContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextPackage(AbstractJpaTransformer transformer,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
tag value on the given model. |
static List<org.nuiton.eugene.models.object.ObjectModelAttribute> |
getProperties(org.nuiton.eugene.models.object.ObjectModelClass input) |
static boolean |
hasNotGeneratedValueStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier clazz)
Check if the given class has the
JpaTemplatesStereoTypes.STEREOTYPE_NOT_GENERATED_VALUE stereotype. |
static boolean |
hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the
JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE stereotype. |
static boolean |
isEntity(org.nuiton.eugene.models.object.ObjectModelClassifier input)
Tests if the given class is an entity (Need only to be in a entity
package).
|
static boolean |
useGenerateExtraTechnicalFields(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier classifier) |
static boolean |
useGeneratePropertyChangeListeners(org.nuiton.eugene.models.object.ObjectModel model) |
static boolean |
useGenerateVisitors(org.nuiton.eugene.models.object.ObjectModel model) |
static boolean |
useIdFactory(org.nuiton.eugene.models.object.ObjectModel model) |
capitalizeJavaBeanPropertyName, cloneOperations, containsGenerics, getConstantPrefixTagValue, getDoNotGenerateBooleanGetMethods, getI18nPrefixTagValue, hasSkipStereotype, joinGeneric, splitFqnList, splitGenericcomputeSerialVersionUID, convertVariableNameToConstantName, findTagValue, generateSerialVersionUID, getAssocAttrName, getAttributeType, getAttributeType, getCastValue, getClassAttributesListDeclaration, getClassifiers, getClassNameFromQualifiedName, getDocumentationTagValue, getDocumentationTagValue, getFilenameFromQualifiedName, getFormatingExpression, getHashCodeExpression, getInitValue, getInitValue, getOperationParametersListDeclaration, getOperationParametersListName, getParentPackageName, getParsingExpression, getSimpleName, getSimpleName, getTypesList, hasDocumentation, hasIndexedStereotype, hasOrderedStereotype, hasStereotype, isBooleanPrimitive, isComposition, isFirstAttribute, isNMultiplicity, isNMultiplicity, isOneMultiplicity, isPrimitiveAttributeType, isPrimitiveType, notEmpty, removeAnyGenericDefinition, removeGenericDefinition, splitGenericDefinition, toLowerCaseFirstLetterpublic static final Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR
public static boolean isEntity(org.nuiton.eugene.models.object.ObjectModelClassifier input)
input - the class to testtrue if class is an entity.public static String getPersistenceContextPackage(AbstractJpaTransformer transformer, org.nuiton.eugene.models.object.ObjectModel model)
public static String getEntityPackage(AbstractJpaTransformer transformer, org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier input)
public static String getDaoPackage(AbstractJpaTransformer transformer, org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier input)
public static List<org.nuiton.eugene.models.object.ObjectModelClass> getEntityClasses(org.nuiton.eugene.models.object.ObjectModel model, boolean sort)
model - the current model to scansort - flag to allow sort the resultpublic static String getPersistenceContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getPersistenceContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getEntityAbstractName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getEntityConcreteName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getDaoAbstractName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getDaoGeneratedName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getDaoConcreteName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getConcreteEntityQualifiedName(AbstractJpaTransformer transformer, org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getConcreteDaoQualifiedName(AbstractJpaTransformer transformer, org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClass input)
public static Class<?> getCollectionType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static Class<?> getCollectionInstanceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean containsMutiple(Collection<org.nuiton.eugene.models.object.ObjectModelAttribute> attributes)
public static String getAttributeName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static String getAttributeType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static List<org.nuiton.eugene.models.object.ObjectModelAttribute> getProperties(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getIdFactoryTagValue(org.nuiton.eugene.models.object.ObjectModel model)
JpaTemplatesTagValues.TAG_ID_FACTORY
tag value on the given model.model - model to seeknull
if not found nor empty.JpaTemplatesTagValues.TAG_ID_FACTORYpublic static boolean useIdFactory(org.nuiton.eugene.models.object.ObjectModel model)
public static String getGeneratePropertyChangeListenersTagValue(org.nuiton.eugene.models.object.ObjectModel model)
JpaTemplatesTagValues.TAG_GENERATE_PROPERTY_CHANGE_LISTENERS
tag value on the given model.model - model to seeknull
if not found nor empty.JpaTemplatesTagValues.TAG_GENERATE_PROPERTY_CHANGE_LISTENERSpublic static boolean useGeneratePropertyChangeListeners(org.nuiton.eugene.models.object.ObjectModel model)
public static String getGenerateVisitorsTagValue(org.nuiton.eugene.models.object.ObjectModel model)
JpaTemplatesTagValues.TAG_GENERATE_VISITORS
tag value on the given model.model - model to seeknull
if not found nor empty.JpaTemplatesTagValues.TAG_GENERATE_VISITORSpublic static boolean useGenerateVisitors(org.nuiton.eugene.models.object.ObjectModel model)
public static String getGenerateExtraTechnicalFieldsTagValue(org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
JpaTemplatesTagValues.TAG_GENERATE_EXTRA_TECHNICAL_FIELDS
tag value on the given model.model - model to seeknull
if not found nor empty.JpaTemplatesTagValues.TAG_GENERATE_EXTRA_TECHNICAL_FIELDSpublic static boolean useGenerateExtraTechnicalFields(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
public static String getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS
tag value on the given model or classifier.
It will first look on the model, and then in the given classifier.model - model to seekclassifier - classifier to seeknull if not found nor empty.JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASSpublic static String getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
JpaTemplatesTagValues.TAG_DAO_SUPER_CLASS
tag value on the given model or classifier.
It will first look on the model, and then in the given classifier.model - model to seekclassifier - classifier to seeknull if not found nor empty.JpaTemplatesTagValues.TAG_DAO_SUPER_CLASSpublic static String getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
tag value on the given model.model - model to seeknull if not found nor empty.JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASSpublic static String getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
JpaTemplatesTagValues.TAG_INVERSE
tag value on the given attribute.
attribute - attribute to seeknull if not found nor empty.JpaTemplatesTagValues.TAG_INVERSEpublic static boolean hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE stereotype.attribute - attribute to testtrue if stereotype was found, false otherwiseJpaTemplatesStereoTypes.STEREOTYPE_UNIQUEpublic static boolean hasNotGeneratedValueStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier clazz)
JpaTemplatesStereoTypes.STEREOTYPE_NOT_GENERATED_VALUE stereotype.clazz - class to testtrue if stereotype was found, false otherwiseJpaTemplatesStereoTypes.STEREOTYPE_NOT_GENERATED_VALUEpublic static boolean generateEntityGeneratedValueAnnotation(org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClass clazz)
Copyright © 2013 CodeLutin. All rights reserved.