public class TopiaGeneratorUtil
extends org.nuiton.eugene.java.JavaGeneratorUtil
| Modifier and Type | Class and Description |
|---|---|
static class |
TopiaGeneratorUtil.TopiaModelPropertiesProvider
The Eugene provider of tag values and stereotypes.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_INHERITANCE_STRATEGY
Stratégie d'heritage par defaut.
|
static String |
DEFAULT_PACKAGE
Le package par défaut si aucun n'est spécifié
|
static String |
DEPENDENCIES_DAO
dependency to add extra operations for entity dao.
|
static Comparator<org.nuiton.eugene.models.object.ObjectModelClass> |
OBJECT_MODEL_CLASS_COMPARATOR |
static String |
PERSISTENCE_TYPE_DEFAULT
Type de persistence par défaut (si aucun précisé)
|
static String |
PERSISTENCE_TYPE_HIBERNATE
Type de persistence Hibernate
|
static String |
PERSISTENCE_TYPE_LDAP
Type de persistence LDAP
|
static String |
PROPERTY_DEFAULT_PACKAGE
Propriété des générateurs indiquant le package par défaut
|
| Constructor and Description |
|---|
TopiaGeneratorUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static List<String> |
cleanImports(String packageName,
Set<String> fqns)
Clean a set of fqns, transform it into a
List and sort it. |
static boolean |
generateToString(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Test if we need to generate
toString method for the given class. |
static String |
getAbstractDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getAbstractDaoName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_ACCESS
tag value on the given attribute. |
static String |
getAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_ANNOTATION
tag value on the given attribute. |
static String |
getApplicationContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getApplicationContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getApplicationContextInterfaceName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getApplicationContextPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getApplicationContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the
TopiaTagValues.TAG_APPLICATION_CONTEXT_SUPER_CLASS
tag value on the model. |
static List<org.nuiton.eugene.models.object.ObjectModelClass> |
getClassesByStereotype(String stereotype,
org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
Obtain the list of classes for a given stereotype with the possibility
to sort the result.
|
static String |
getClassForPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static String |
getConcreteDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getConcreteDaoName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getContractDaoName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static Class<?> |
getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
Deprecated.
since 3.0-alpha-8, replaced by
getDaoSuperClassTagValue(ObjectModelClassifier, ObjectModel) |
static String |
getDaoImplementationTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the
TopiaTagValues.TAG_DAO_IMPLEMENTATION
tag value on the given model. |
static org.nuiton.eugene.models.object.ObjectModelInterface |
getDAOInterface(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Renvoie l'interface DAO associée à la classe passée en paramètre
|
static String |
getDaoPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the
TopiaTagValues.TAG_DAO_SUPER_CLASS
tag value on the given classifier or on the model. |
static String |
getDaoSupplierInterfaceName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getDaoSupplierName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
Renvoie le nom BD de l'élement passé en paramètre.
|
static String |
getDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelElement element)
Obtain the value of the
TopiaTagValues.TAG_DB_NAME
tag value on the given classifier. |
static String |
getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given attribute. |
static String |
getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given classifier. |
static String |
getDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)
Renvoie le package par défaut pour le générateur donné
|
static String |
getDOType(org.nuiton.eugene.models.object.ObjectModelElement elem,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getDOType(String type,
org.nuiton.eugene.models.object.ObjectModel model) |
static <Type extends org.nuiton.eugene.models.object.ObjectModelElement> |
getElementsWithStereotype(Collection<Type> elements,
String... stereotypes) |
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 |
getEntityEnumName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getEntityPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer,
org.nuiton.eugene.models.object.ObjectModel model,
org.nuiton.eugene.models.object.ObjectModelClassifier input) |
static String |
getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the
TopiaTagValues.TAG_ENTITY_SUPER_CLASS
tag value on the given classifier or on the model. |
static String |
getFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_FETCH
tag value on the given attribute. |
static String |
getGeneratedDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getGeneratedDaoName(org.nuiton.eugene.models.object.ObjectModelClass input) |
static String |
getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model) |
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
Set<String> fqns)
Obtain the list of fqn of object involed in the given class.
|
static List<String> |
getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
String... incomingFqns)
Obtain the list of fqn of object involed in the given class.
|
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
Set<String> fqns)
Obtain the list of fqn of object involed in the given interface.
|
static List<String> |
getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
String... incomingFqns)
Obtain the list of fqn of object involed in the given interface.
|
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelOperation operation,
Set<String> fqns)
Obtain the fqn's list of all involed type in a givne operation.
|
static String |
getIndexForeignKeys(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the tag value
TopiaTagValues.TAG_INDEX_FOREIGN_KEYS on the model or on the
given attribute. |
static String |
getInheritanceStrategyTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
TopiaTagValues.TAG_INHERITANCE_STRATEGY
tag value on the given classifier. |
static String |
getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_INVERSE
tag value on the given attribute. |
static String |
getLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_LAZY
tag value on the given attribute. |
static String |
getLegacyDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
Deprecated.
|
static String |
getLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_LENGTH
tag value on the given attribute. |
static String |
getManyToManyTableName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le nom unique de table pour une relation ManyToMany en fonction
de l'attribut
attr
Plusieurs cas de figure:
|
static Set<org.nuiton.eugene.models.object.ObjectModelAttribute> |
getNaturalIdAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Cherche et renvoie la liste des attributs constituant la clef metier
d'une classe.
|
static String |
getNaturalIdMutableTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
TopiaTagValues.TAG_NATURAL_ID_MUTABLE
tag value on the given classifier. |
static String |
getNaturalIdTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_NATURAL_ID
tag value on the given attribute. |
static String |
getNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le type d'interface à utiliser en fonction de l'attribut
|
static String |
getNotGenerateToStringTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
TopiaTagValues.TAG_NOT_GENERATE_TO_STRING
tag value on the given class. |
static Set<org.nuiton.eugene.models.object.ObjectModelAttribute> |
getNotNullAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Cherche et renvoie la liste des attributs qui ne doivent pas etre null dans
une classe.
|
static String |
getNotNullTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_NOT_NULL
tag value on the given attribute. |
static String |
getOrderByTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_ORDER_BY
tag value on the given attribute. |
static String |
getParentDaoFqn(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getParentDaoName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextInterfaceName(org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer,
org.nuiton.eugene.models.object.ObjectModel model) |
static String |
getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtains the value of the
TopiaTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
tag value on the model. |
static String |
getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Renvoie le type de persistence pour le classifier donné.
|
static String |
getPersistenceTypeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the
TopiaTagValues.TAG_PERSISTENCE_TYPE
tag value on the given classifier. |
static String |
getPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz,
boolean includeName) |
static String |
getProxyInterfaceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
TopiaTagValues.TAG_PROXY_INTERFACE
tag value on the given classifier. |
static String |
getReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Obtain the reverse db name of an attribute.
|
static String |
getSortAttributeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the
TopiaTagValues.TAG_SORT_ATTRIBUTE
tag value on the given classifier. |
static String |
getSqlTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_SQL_TYPE
tag value on the given attribute. |
static String |
getTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the
TopiaTagValues.TAG_TYPE
tag value on the given attribute. |
static boolean |
hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the
TopiaStereoTypes.STEREOTYPE_DAO stereotype. |
static boolean |
hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)
Check if the given operation has the
TopiaStereoTypes.STEREOTYPE_DAO stereotype. |
static boolean |
hasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the
TopiaStereoTypes.STEREOTYPE_DTO stereotype. |
static boolean |
hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype. |
static boolean |
hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype. |
static boolean |
hasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee n'a aucune ou que des methodes abstraites
|
static boolean |
hasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the
TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY stereotype. |
static boolean |
hasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element,
String... stereotypes) |
static boolean |
hasUnidirectionalRelationOnAbstractType(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model)
Cette méthode permet de détecter si
- l'attribut représente une relation 1-n
- cette relation est unidirectionnelle
- le type de l'attribut représente un entité
- cette entité a des sous-classes dans le modèle
Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a
adopter un comportement particulier.
|
static boolean |
hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the
EugeneStereoTypes.STEREOTYPE_UNIQUE stereotype. |
static boolean |
hasUseEnumerationNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model) |
static boolean |
isAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static boolean |
isBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static boolean |
isCollectionNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations) |
static boolean |
isContextable(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Retourne true si le tagValue
TopiaTagValues.TAG_CONTEXTABLE
à la valeur true. |
static boolean |
isDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static boolean |
isEntity(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
Check if the given attribute type is an entity.
|
static boolean |
isEntity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the
TopiaStereoTypes.STEREOTYPE_ENTITY and is not an enumeration |
static boolean |
isImportNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations,
String importName) |
static boolean |
isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Detecte si un attribut fait partie d'une clef metier.
|
static boolean |
isNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Detecte si la clef metier d'une classe est mutable ou pas.
|
static boolean |
isNotNull(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Detecte si un attribut est marqué comme non null.
|
static boolean |
isNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static boolean |
isPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static boolean |
isSetNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations) |
static boolean |
isTextType(org.nuiton.eugene.models.object.ObjectModelAttribute attr) |
static Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> |
searchDirectUsages(org.nuiton.eugene.models.object.ObjectModel model) |
static void |
searchDirectUsages(org.nuiton.eugene.models.object.ObjectModelClass klass,
Map<String,org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN,
Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> usages) |
static boolean |
shouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee devrait etre abstraite
|
static boolean |
shouldGenerateDTOTopiaIdTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Search if the TagValue
TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTO has been
activated in the model. |
static boolean |
shouldGenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
Cherche si le tagvalue
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model. |
static boolean |
sortAttribute(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Cherche et renvoie la liste des attributs constituant la clef metier
d'une classe.
|
capitalizeJavaBeanPropertyName, cloneOperations, containsGenerics, getAttributeImplementationType, getAttributeImplementationType, getAttributeInterfaceType, getAttributeInterfaceType, getAttributeInterfaceType, getClassAttributesListDeclaration, getCollectionInstanceType, getCollectionType, getConstantPrefixTagValue, getI18nPrefixTagValue, getOperationParametersListDeclaration, hasSkipStereotype, isDoNotGenerateBooleanGetMethods, isOrdered, joinGeneric, splitFqnList, splitGenericcomputeSerialVersionUID, convertVariableNameToConstantName, findTagValue, generateSerialVersionUID, getAssocAttrName, getCastValue, getClassifiers, getClassNameFromQualifiedName, getDocumentationTagValue, getDocumentationTagValue, getFilenameFromQualifiedName, getFormatingExpression, getHashCodeExpression, getInitValue, getInitValue, 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 String DEPENDENCIES_DAO
public static final String PERSISTENCE_TYPE_HIBERNATE
public static final String PERSISTENCE_TYPE_LDAP
public static final String PERSISTENCE_TYPE_DEFAULT
public static final String PROPERTY_DEFAULT_PACKAGE
public static final String DEFAULT_PACKAGE
public static final String DEFAULT_INHERITANCE_STRATEGY
public static final Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR
public static String getDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)
generator - le générateur donnépublic static String getApplicationContextPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer, org.nuiton.eugene.models.object.ObjectModel model)
public static String getPersistenceContextPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer, org.nuiton.eugene.models.object.ObjectModel model)
public static String getDaoPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer, org.nuiton.eugene.models.object.ObjectModel model)
public static String getParentDaoName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getParentDaoFqn(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer, org.nuiton.eugene.models.object.ObjectModel model)
public static String getApplicationContextInterfaceName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getApplicationContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getApplicationContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getPersistenceContextAbstractName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getPersistenceContextConcreteName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getPersistenceContextInterfaceName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getDaoSupplierInterfaceName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getDaoSupplierName(org.nuiton.eugene.models.object.ObjectModel model)
public static String getEntityEnumName(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 getAbstractDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getGeneratedDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getConcreteDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getContractDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
@Deprecated public static String getLegacyDaoName(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getAbstractDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getGeneratedDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getConcreteDaoFqn(org.nuiton.eugene.models.object.ObjectModelClass input)
public static String getEntityPackage(org.nuiton.eugene.java.ObjectModelTransformerToJava transformer, org.nuiton.eugene.models.object.ObjectModel model, org.nuiton.eugene.models.object.ObjectModelClassifier input)
public static org.nuiton.eugene.models.object.ObjectModelInterface getDAOInterface(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
clazz - la classe à testermodel - le modele utilisépublic static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
classifier - l'élément à testerpublic static String getReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
_id.attr - the attribute to seekpublic static String getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
element - l'élément à testerpublic static boolean shouldGenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model.model - le modele utilisétrue si le tag value trouvé dans le modèle, false
sinon.public static Set<org.nuiton.eugene.models.object.ObjectModelAttribute> getNaturalIdAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - la classe à testerpublic static Set<org.nuiton.eugene.models.object.ObjectModelAttribute> getNotNullAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - la classe à testerpublic static boolean generateToString(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
toString method for the given class.clazz - class to testmodel - modeltrue if toString should be generated.
clef métier.public static boolean sortAttribute(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
clazz - la classe à testermodel - le modelepublic static boolean isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
attribute - l'attribut à testertrue si l'attribut fait partie d'une clef metier,
false sinon.public static boolean isNotNull(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute) sont not null par défautattribute - l'attribut à testertrue si l'attribut doit être non null,
par défaut pour les naturalId, false sinon..public static <Type extends org.nuiton.eugene.models.object.ObjectModelElement> Collection<Type> getElementsWithStereotype(Collection<Type> elements, String... stereotypes)
public static boolean hasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element,
String... stereotypes)
public static String getPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz, boolean includeName)
public static boolean isAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static String getDOType(org.nuiton.eugene.models.object.ObjectModelElement elem, org.nuiton.eugene.models.object.ObjectModel model)
public static String getDOType(String type, org.nuiton.eugene.models.object.ObjectModel model)
public static boolean isNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isTextType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static String getClassForPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean hasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - l'instance de ObjectModelClasspublic static boolean shouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - l'instance de ObjectModelClasspublic static boolean hasUnidirectionalRelationOnAbstractType(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model)
Cette méthode permet de détecter si - l'attribut représente une relation 1-n - cette relation est unidirectionnelle - le type de l'attribut représente un entité - cette entité a des sous-classes dans le modèle
Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a adopter un comportement particulier.attr - l'attribut a testermodel - le modelpublic static String getManyToManyTableName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr
Plusieurs cas de figure:
attr - l'attribut servant de base au calcul du nompublic static String getNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr - l'attribut a traiterpublic 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 List<org.nuiton.eugene.models.object.ObjectModelClass> getClassesByStereotype(String stereotype, org.nuiton.eugene.models.object.ObjectModel model, boolean sort)
stereotype - filter stereotypemodel - the current model to scansort - flag to allow sort the resultpublic static boolean isNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - la classe a testertrue si le tag value a ete positionne sur la classe
via le tag TopiaTagValues.TAG_NATURAL_ID_MUTABLE, false
sinon.public static boolean isContextable(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_CONTEXTABLE
à la valeur true.classifier - classifier to testtrue si TopiaTagValues.TAG_CONTEXTABLE == truepublic static List<String> getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass, String... incomingFqns)
aClass - the clazz to inspectincomingFqns - incoming fqnspublic static List<String> getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface, String... incomingFqns)
anInterface - the interface to inspectincomingFqns - incoming fqnsprotected static void getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
Set<String> fqns)
aClass - the class to inspectfqns - where to store found fqnsprotected static void getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
Set<String> fqns)
anInterface - the interface to inspectfqns - where to store found fqnsprotected static void getImports(org.nuiton.eugene.models.object.ObjectModelOperation operation,
Set<String> fqns)
operation - operation to inspectfqns - where to store found fqnsprotected static List<String> cleanImports(String packageName, Set<String> fqns)
List and sort it.packageName - the current package namefqns - the dirty set of fqns@Deprecated public static Class<?> getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
getDaoSuperClassTagValue(ObjectModelClassifier, ObjectModel)TopiaTagValues.TAG_DAO_IMPLEMENTATION in model
and if not found will use the default value which is AbstractTopiaDao.model - the model which could containspublic static Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> searchDirectUsages(org.nuiton.eugene.models.object.ObjectModel model)
public static void searchDirectUsages(org.nuiton.eugene.models.object.ObjectModelClass klass,
Map<String,org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN,
Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> usages)
public static boolean isImportNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations, String importName)
public static boolean isCollectionNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)
public static boolean isSetNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)
public static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.classifier - classifier to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean isEntity(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
attribute - attribute to testmodel - model containing the attributetrue if type of attribute is an entity,
false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean isEntity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_ENTITY and is not an enumerationclassifier - classifier to testtrue if stereotype was found and classifier is not
enumeration, false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.attribute - attribute to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean hasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_DTO stereotype.classifier - classifier to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DTOpublic static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_DAO stereotype.classifier - classifier to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DAOpublic static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)
TopiaStereoTypes.STEREOTYPE_DAO stereotype.operation - operation to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DAOpublic static boolean hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
EugeneStereoTypes.STEREOTYPE_UNIQUE stereotype.attribute - attribute to testtrue if stereotype was found, false otherwiseEugeneStereoTypes.STEREOTYPE_UNIQUEpublic static boolean hasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY stereotype.attribute - attribute to testtrue if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_PRIMARY_KEYpublic static String getPersistenceTypeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_PERSISTENCE_TYPE
tag value on the given classifier.classifier - classifier to seeknull if not found nor empty.TopiaTagValues.TAG_PERSISTENCE_TYPEpublic static String getInheritanceStrategyTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_INHERITANCE_STRATEGY
tag value on the given classifier.classifier - classifier to seeknull if not found nor empty.TopiaTagValues.TAG_INHERITANCE_STRATEGYpublic static String getDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelElement element)
TopiaTagValues.TAG_DB_NAME
tag value on the given classifier.element - classifier to seeknull if not found nor empty.TopiaTagValues.TAG_DB_NAMEpublic static String getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given classifier.classifier - classifier to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_SCHEMA_NAMEpublic static String getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given attribute.attribute - attribute to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_SCHEMA_NAMEpublic static String getLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_LENGTH
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_LENGTHpublic static String getAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ANNOTATION
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_ANNOTATIONpublic static String getAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ACCESS
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_ACCESSpublic static String getNaturalIdTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_NATURAL_ID
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_NATURAL_IDpublic static String getNaturalIdMutableTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_NATURAL_ID_MUTABLE
tag value on the given classifier.classifier - classifier to seeknull if not found nor empty.TopiaTagValues.TAG_NATURAL_ID_MUTABLEpublic static String getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_INVERSE
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_INVERSEpublic static String getLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_LAZY
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_LAZYpublic static String getFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_FETCH
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_FETCHpublic static String getOrderByTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ORDER_BY
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_ORDER_BYpublic static String getNotNullTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_NOT_NULL
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_NOT_NULLpublic static String getProxyInterfaceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_PROXY_INTERFACE
tag value on the given classifier.classifier - classifier to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_PROXY_INTERFACEpublic static String getNotGenerateToStringTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier clazz, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_NOT_GENERATE_TO_STRING
tag value on the given class.clazz - class to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_NOT_GENERATE_TO_STRINGpublic static String getSortAttributeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SORT_ATTRIBUTE
tag value on the given classifier.classifier - classifier to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_SORT_ATTRIBUTEpublic static String getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
public static String getTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_TYPE
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_TYPEpublic static String getSqlTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_SQL_TYPE
tag value on the given attribute.attribute - attribute to seeknull if not found nor empty.TopiaTagValues.TAG_TYPEpublic static String getDaoImplementationTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_DAO_IMPLEMENTATION
tag value on the given model.model - model to seeknull if not found nor empty.TopiaTagValues.TAG_DAO_IMPLEMENTATIONpublic static String getIndexForeignKeys(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_INDEX_FOREIGN_KEYS on the model or on the
given attribute.attribute - attribute to testmodel - model to testnull if not found nor empty.TopiaTagValues.TAG_INDEX_FOREIGN_KEYSpublic static boolean hasUseEnumerationNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model)
public static boolean shouldGenerateDTOTopiaIdTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTO has been
activated in the model.classifier - classifier to seekmodel - model to seeknull if not found nor empty.TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTOpublic static String getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
tag value on the model.model - model to seeknull if not found nor empty.TopiaTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASSpublic static String getApplicationContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_APPLICATION_CONTEXT_SUPER_CLASS
tag value on the model.model - model to seeknull if not found nor empty.TopiaTagValues.TAG_APPLICATION_CONTEXT_SUPER_CLASSpublic static String getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_DAO_SUPER_CLASS
tag value on the given classifier or on the model.model - model to seeknull if not found nor empty.TopiaTagValues.TAG_DAO_SUPER_CLASSpublic static String getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_ENTITY_SUPER_CLASS
tag value on the given classifier or on the model.model - model to seeknull if not found nor empty.TopiaTagValues.TAG_ENTITY_SUPER_CLASSCopyright © 2004–2014 CodeLutin. All rights reserved.