org.nuiton.topia.generator
Class TopiaGeneratorUtil

java.lang.Object
  extended by org.nuiton.eugene.GeneratorUtil
      extended by org.nuiton.eugene.java.JavaGeneratorUtil
          extended by org.nuiton.topia.generator.TopiaGeneratorUtil

public class TopiaGeneratorUtil
extends org.nuiton.eugene.java.JavaGeneratorUtil

Classe regroupant divers méthodes utiles pour la génération des entités

Created: 13 déc. 2005

Version:
$Id: TopiaGeneratorUtil.java 2434 2012-04-06 13:58:37Z sletellier $
Author:
Arnaud Thimel , tchemit , fdesbois , chatellier

Nested Class Summary
static class TopiaGeneratorUtil.TopiaModelPropertiesProvider
          The Eugene provider of tag values and stereotypes.
 
Field Summary
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
 
Fields inherited from class org.nuiton.eugene.java.JavaGeneratorUtil
DEPENDENCIES_CONSTANTS, OPERATION_GETTER_BOOLEAN_PREFIX, OPERATION_GETTER_DEFAULT_PREFIX
 
Fields inherited from class org.nuiton.eugene.GeneratorUtil
SERIAL_VERSION_UID
 
Constructor Summary
TopiaGeneratorUtil()
           
 
Method Summary
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 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 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 getCopyright(org.nuiton.eugene.models.Model model)
          Deprecated. since 2.5 never use anywhere
static Class<?> getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
          Obtain the class to use as abstract dao.
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 getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
          Renvoie le nom BD de l'élement passé en paramètre.
static String getDBName(org.nuiton.eugene.models.object.ObjectModelElement element)
          Deprecated. since 2.5, prefer use the method getDbName(ObjectModelElement)
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 getDoCommitTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation, org.nuiton.eugene.models.object.ObjectModel model)
          Obtain the value of the TopiaTagValues.TAG_DO_COMMIT tag value on the given operation.
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>
Collection<Type>
getElementsWithStereotype(Collection<Type> elements, String... stereotypes)
           
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 getErrorArgsTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
          Obtain the value of the TopiaTagValues.TAG_ERROR_ARGS tag value on the given operation.
static String getExceptionClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
          Obtain the value of the TopiaTagValues.TAG_EXCEPTION_CLASS tag value on the given interface.
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 getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
           
static String getGenerateStandaloneEnumForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
          Obtain the value of the TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPER tag value on the given model.
static String getI18nPrefix(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
          Deprecated. since 2.5, prefer use the JavaGeneratorUtil.getI18nPrefixTagValue(ObjectModelElement, ObjectModel)
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 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 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 getNMultiplicityInterfaceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
          Renvoie le type d'interface à utiliser en fonction de l'attribut
static String getNMultiplicityObjectType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
          Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut
static String getNoLogInServiceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
          Deprecated. since 2.5.4, no more use will be remove soon.
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 getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Renvoie le type de persistence pour le classifier donné.
static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelElement element)
          Deprecated. since 2.5, prefer use the method getPersistenceType(ObjectModelClassifier)
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 getReverseDBName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
          Deprecated. since 2.5, prefer use the methode getReverseDbName(ObjectModelAttribute)
static String getSchemaName(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
          Deprecated. since 2.5, prefer use the method getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel) or getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel)
static String getSecurityCreateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Obtain the value of the TopiaTagValues.TAG_SECURITY_CREATE tag value on the given classifier.
static String getSecurityDeleteTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Obtain the value of the TopiaTagValues.TAG_SECURITY_DELETE tag value on the given classifier.
static String getSecurityLoadTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Obtain the value of the TopiaTagValues.TAG_SECURITY_LOAD tag value on the given classifier.
static String getSecurityUpdateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Obtain the value of the TopiaTagValues.TAG_SECURITY_UPDATE tag value on the given classifier.
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 getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given classifier.
static String getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
          Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given operation.
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 hasArrayStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
          Deprecated. since 2.5 , only BeanTransformer use it and it is a deprecated transformer, will be remove in version 3.0
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 hasFacadeStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_FACADE 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_PRIMARYKAY stereotype.
static boolean hasServiceStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_SERVICE 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 TopiaStereoTypes.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 isClassWithSecurity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
          Tests if the given classifier own at least one security tag value.
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 shouldgenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
          Deprecated. since 2.5, use now the method shouldGenerateOperatorForDAOHelper(ObjectModel)
static boolean shouldGenerateStandaloneEnumForDAOHelper(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 shouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
          Deprecated. since 2.5, prefer use the method shouldGenerateStandaloneEnumForDAOHelper(ObjectModel)
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.
 
Methods inherited from class org.nuiton.eugene.java.JavaGeneratorUtil
capitalizeJavaBeanPropertyName, cloneOperations, containsGenerics, getConstantPrefixTagValue, getDoNotGenerateBooleanGetMethods, getI18nPrefixTagValue, getNoPCSTagValue, hasBeanStereotype, hasSkipStereotype, joinGeneric, splitFqnList, splitGeneric
 
Methods inherited from class org.nuiton.eugene.GeneratorUtil
computeSerialVersionUID, 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, removeGenericDefinition, splitGenericDefinition, toLowerCaseFirstLetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPENDENCIES_DAO

public static final String DEPENDENCIES_DAO
dependency to add extra operations for entity dao.

Since:
2.3.4
See Also:
Constant Field Values

PERSISTENCE_TYPE_HIBERNATE

public static final String PERSISTENCE_TYPE_HIBERNATE
Type de persistence Hibernate

See Also:
Constant Field Values

PERSISTENCE_TYPE_LDAP

public static final String PERSISTENCE_TYPE_LDAP
Type de persistence LDAP

See Also:
Constant Field Values

PERSISTENCE_TYPE_DEFAULT

public static final String PERSISTENCE_TYPE_DEFAULT
Type de persistence par défaut (si aucun précisé)

See Also:
Constant Field Values

PROPERTY_DEFAULT_PACKAGE

public static final String PROPERTY_DEFAULT_PACKAGE
Propriété des générateurs indiquant le package par défaut

See Also:
Constant Field Values

DEFAULT_PACKAGE

public static final String DEFAULT_PACKAGE
Le package par défaut si aucun n'est spécifié

See Also:
Constant Field Values

OBJECT_MODEL_CLASS_COMPARATOR

public static final Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR
Constructor Detail

TopiaGeneratorUtil

public TopiaGeneratorUtil()
Method Detail

getDefaultPackage

public static String getDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)
Renvoie le package par défaut pour le générateur donné

Parameters:
generator - le générateur donné
Returns:
le package par défaut du générator donné

getDAOInterface

public 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

Parameters:
clazz - la classe à tester
model - le modele utilisé
Returns:
l'interface trouvée ou null sinon

getPersistenceType

@Deprecated
public static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelElement element)
Deprecated. since 2.5, prefer use the method getPersistenceType(ObjectModelClassifier)

Renvoie le type de persistence pour l'élément donné. Si aucun n'est trouvé, le type par défaut est utilisé

Parameters:
element - l'élément à tester
Returns:
le type de persitence pour l'élément donné.

getPersistenceType

public static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Renvoie le type de persistence pour le classifier donné. Si aucun n'est trouvé, le type par défaut est utilisé

Parameters:
classifier - l'élément à tester
Returns:
le type de persitence pour l'élément donné.
Since:
2.5

getReverseDBName

@Deprecated
public static String getReverseDBName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Deprecated. since 2.5, prefer use the methode getReverseDbName(ObjectModelAttribute)

Parameters:
attr - the attribute to inspece
Returns:
the name of the name in db of the reverse attribute

getReverseDbName

public static String getReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Obtain the reverse db name of an attribute.

If attribute has a specific reverse attribute, use his db name, otherwise suffix the db name of the attribute by _id.

Parameters:
attr - the attribute to seek
Returns:
the value of the reverse name
Since:
2.5

getDBName

@Deprecated
public static String getDBName(org.nuiton.eugene.models.object.ObjectModelElement element)
Deprecated. since 2.5, prefer use the method getDbName(ObjectModelElement)

Renvoie le nom BD de l'élement passé en paramètre. Elle se base sur le tag associé si il existe, sinon sur le nom de l'élément

Parameters:
element - l'élément à tester
Returns:
le nom de table

getDbName

public static String getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
Renvoie le nom BD de l'élement passé en paramètre. Elle se base sur le tag associé si il existe, sinon sur le nom de l'élément

Parameters:
element - l'élément à tester
Returns:
le nom de table

getSchemaName

@Deprecated
public static String getSchemaName(org.nuiton.eugene.models.object.ObjectModelElement element,
                                              org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the method getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel) or getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel)

Cherche et renvoie le schema a utiliser sur cet element, sinon sur le model.

Parameters:
element - l'élément à tester
model - le modele utilisé
Returns:
le nom du schema ou null

getI18nPrefix

@Deprecated
public static String getI18nPrefix(org.nuiton.eugene.models.object.ObjectModelElement element,
                                              org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the JavaGeneratorUtil.getI18nPrefixTagValue(ObjectModelElement, ObjectModel)

Cherche et renvoie le prefixe i18n à utiliser sur cet element, sinon sur le model.

Parameters:
element - l'élément à tester
model - le modele utilisé
Returns:
le prefix i18n ou null si non spécifié

shouldgenerateOperatorForDAOHelper

@Deprecated
public static boolean shouldgenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
                                                                    org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, use now the method shouldGenerateOperatorForDAOHelper(ObjectModel)

Cherche si le tagvalue TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été activé dans le model.

Parameters:
element - l'élément à tester
model - le modele utilisé
Returns:
true si le tag value trouvé dans le modèle, false sinon.

shouldGenerateOperatorForDAOHelper

public 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.

Parameters:
model - le modele utilisé
Returns:
true si le tag value trouvé dans le modèle, false sinon.
Since:
2.5

shouldGnerateStandaloneEnumForDAOHelper

@Deprecated
public static boolean shouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
                                                                         org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the method shouldGenerateStandaloneEnumForDAOHelper(ObjectModel)

Cherche si le tagvalue TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été activé dans le model.

Parameters:
element - l'élément à tester
model - le modele utilisé
Returns:
true si le tag value trouvé dans le modèle, false sinon.
Since:
2.4.1

shouldGenerateStandaloneEnumForDAOHelper

public static boolean shouldGenerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
Cherche si le tagvalue TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été activé dans le model.

Parameters:
model - le modele utilisé
Returns:
true si le tag value trouvé dans le modèle, false sinon.
Since:
2.5

getNaturalIdAttributes

public 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.

Parameters:
clazz - la classe à tester
Returns:
la liste des attributs de la clef métier

getNotNullAttributes

public 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.

Parameters:
clazz - la classe à tester
Returns:
la liste des attributs qui ne doivent pas etre null

generateToString

public 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.

Parameters:
clazz - class to test
model - model
Returns:
true if toString should be generated. clef métier.

sortAttribute

public 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.

Parameters:
clazz - la classe à tester
model - le modele
Returns:
la liste des attributs de la clef métier ou null si pas de clef métier.

isNaturalId

public static boolean isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Detecte si un attribut fait partie d'une clef metier.

Parameters:
attribute - l'attribut à tester
Returns:
true si l'attribut fait partie d'une clef metier, false sinon.

isNotNull

public static boolean isNotNull(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Detecte si un attribut est marqué comme non null. Les naturalId isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute) sont not null par défaut

Parameters:
attribute - l'attribut à tester
Returns:
true si l'attribut doit être non null, par défaut pour les naturalId, false sinon..
Since:
2.6.9

getCopyright

@Deprecated
public static String getCopyright(org.nuiton.eugene.models.Model model)
Deprecated. since 2.5 never use anywhere

Cherches et renvoie le copyright a utiliser sur le model.

Parameters:
model - le modele utilisé
Returns:
le texte du copyright ou null$

getElementsWithStereotype

public static <Type extends org.nuiton.eugene.models.object.ObjectModelElement> Collection<Type> getElementsWithStereotype(Collection<Type> elements,
                                                                                                                           String... stereotypes)

hasStereotypes

public static boolean hasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element,
                                     String... stereotypes)

getPrimaryKeyAttributesListDeclaration

public static String getPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz,
                                                            boolean includeName)

isAssociationClassDoublon

public static boolean isAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

getDOType

public static String getDOType(org.nuiton.eugene.models.object.ObjectModelElement elem,
                               org.nuiton.eugene.models.object.ObjectModel model)

getDOType

public static String getDOType(String type,
                               org.nuiton.eugene.models.object.ObjectModel model)

isNumericType

public static boolean isNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

isTextType

public static boolean isTextType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

isDateType

public static boolean isDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

isBooleanType

public static boolean isBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

isPrimitiveType

public static boolean isPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

hasNothingOrAbstractMethods

public static boolean hasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee n'a aucune ou que des methodes abstraites

Parameters:
clazz - l'instance de ObjectModelClass
Returns:
true si la classe n'a que des operations abstraite ou aucune operation

shouldBeAbstract

public static boolean shouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee devrait etre abstraite

Parameters:
clazz - l'instance de ObjectModelClass
Returns:
true dans ce cas, false sinon

hasUnidirectionalRelationOnAbstractType

public 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.

Parameters:
attr - l'attribut a tester
model - le model
Returns:
true si et seulement si il s'agit bien de ce type de relation

getManyToManyTableName

public 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:

  • Parameters:
    attr - l'attribut servant de base au calcul du nom
    Returns:
    le nom de la table

  • getNMultiplicityInterfaceType

    public static String getNMultiplicityInterfaceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'interface à utiliser en fonction de l'attribut

    Parameters:
    attr - l'attribut a traiter
    Returns:
    String

    getNMultiplicityObjectType

    public static String getNMultiplicityObjectType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut

    Parameters:
    attr - l'attribut a traiter
    Returns:
    String

    getNMultiplicityHibernateType

    public static String getNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'interface à utiliser en fonction de l'attribut

    Parameters:
    attr - l'attribut a traiter
    Returns:
    String

    getEntityClasses

    public 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.

    Parameters:
    model - the current model to scan
    sort - flag to allow sort the result
    Returns:
    the list of filtred classes by their stereotype

    getClassesByStereotype

    public 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.

    Parameters:
    stereotype - filter stereotype
    model - the current model to scan
    sort - flag to allow sort the result
    Returns:
    the list of filtred classes by their stereotype

    isNaturalIdMutable

    public static boolean isNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)
    Detecte si la clef metier d'une classe est mutable ou pas.

    On respecte la valeur par defaut d'hibernate, à savoir que par default une clef metier est non mutable.

    Parameters:
    clazz - la classe a tester
    Returns:
    true si le tag value a ete positionne sur la classe via le tag TopiaTagValues.TAG_NATURAL_ID_MUTABLE, false sinon.

    isContextable

    public static boolean isContextable(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Retourne true si le tagValue TopiaTagValues.TAG_CONTEXTABLE à la valeur true.

    Parameters:
    classifier - classifier to test
    Returns:
    true si TopiaTagValues.TAG_CONTEXTABLE == true

    getImports

    public 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.

    Parameters:
    aClass - the clazz to inspect
    incomingFqns - incoming fqns
    Returns:
    the list of fqn of attributes

    getImports

    public 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.

    Parameters:
    anInterface - the interface to inspect
    incomingFqns - incoming fqns
    Returns:
    the list of fqn of attributes

    getImports

    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.

    Parameters:
    aClass - the class to inspect
    fqns - where to store found fqns

    getImports

    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.

    Parameters:
    anInterface - the interface to inspect
    fqns - where to store found fqns

    getImports

    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.

    Parameters:
    operation - operation to inspect
    fqns - where to store found fqns

    cleanImports

    protected static List<String> cleanImports(String packageName,
                                               Set<String> fqns)
    Clean a set of fqns, transform it into a List and sort it.

    Parameters:
    packageName - the current package name
    fqns - the dirty set of fqns
    Returns:
    the sorted cleaned list of fqns.

    getDAOImplementation

    public static Class<?> getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the class to use as abstract dao.

    It will look after a tag value TopiaTagValues.TAG_DAO_IMPLEMENTATION in model and if not found will use the default value which is TopiaDAOImpl.

    Parameters:
    model - the model which could contains
    Returns:
    the type of the abstract dao to use
    Since:
    2.5

    searchDirectUsages

    public static Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> searchDirectUsages(org.nuiton.eugene.models.object.ObjectModel model)

    searchDirectUsages

    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)

    isImportNeeded

    public static boolean isImportNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations,
                                         String importName)

    isCollectionNeeded

    public static boolean isCollectionNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)

    isSetNeeded

    public static boolean isSetNeeded(Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)

    hasFacadeStereotype

    public static boolean hasFacadeStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_FACADE stereotype.

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_FACADE

    hasEntityStereotype

    public static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_ENTITY

    isEntity

    public 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.

    Parameters:
    attribute - attribute to test
    model - model containing the attribute
    Returns:
    true if type of attribute is an entity, false otherwise
    Since:
    2.7
    See Also:
    TopiaStereoTypes.STEREOTYPE_ENTITY

    isEntity

    public 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

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found and classifier is not enumeration, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_ENTITY

    hasEntityStereotype

    public static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.

    Parameters:
    attribute - attribute to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_ENTITY

    hasDtoStereotype

    public static boolean hasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_DTO stereotype.

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_DTO

    hasServiceStereotype

    public static boolean hasServiceStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_SERVICE stereotype.

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_SERVICE

    hasDaoStereotype

    public static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_DAO stereotype.

    Parameters:
    classifier - classifier to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_DAO

    hasDaoStereotype

    public static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)
    Check if the given operation has the TopiaStereoTypes.STEREOTYPE_DAO stereotype.

    Parameters:
    operation - operation to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_DAO

    hasUniqueStereotype

    public static boolean hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_UNIQUE stereotype.

    Parameters:
    attribute - attribute to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_UNIQUE

    hasPrimaryKeyStereotype

    public static boolean hasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_PRIMARYKAY stereotype.

    Parameters:
    attribute - attribute to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_PRIMARYKAY

    hasArrayStereotype

    @Deprecated
    public static boolean hasArrayStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Deprecated. since 2.5 , only BeanTransformer use it and it is a deprecated transformer, will be remove in version 3.0

    Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_ARRAY stereotype.

    Parameters:
    attribute - attribute to test
    Returns:
    true if stereotype was found, false otherwise
    Since:
    2.5
    See Also:
    TopiaStereoTypes.STEREOTYPE_ARRAY

    getPersistenceTypeTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_PERSISTENCE_TYPE

    getDbNameTagValue

    public 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.

    Parameters:
    element - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_DB_NAME

    getDbSchemaNameTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SCHEMA_NAME

    getDbSchemaNameTagValue

    public 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.

    Parameters:
    attribute - attribute to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SCHEMA_NAME

    getLengthTagValue

    public static String getLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_LENGTH tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_LENGTH

    getAnnotationTagValue

    public static String getAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_ANNOTATION tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_ANNOTATION

    getAccessTagValue

    public static String getAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_ACCESS tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_ACCESS

    getNaturalIdTagValue

    public 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.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_NATURAL_ID

    getNaturalIdMutableTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_NATURAL_ID_MUTABLE

    getInverseTagValue

    public static String getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_INVERSE tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_INVERSE

    getLazyTagValue

    public static String getLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_LAZY tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_LAZY

    getFetchTagValue

    public static String getFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_FETCH tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_FETCH

    getOrderByTagValue

    public 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.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_ORDER_BY

    getNotNullTagValue

    public 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.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_NOT_NULL

    getProxyInterfaceTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_PROXY_INTERFACE

    isClassWithSecurity

    public static boolean isClassWithSecurity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Tests if the given classifier own at least one security tag value.

    Parameters:
    classifier - the classifier to test
    Returns:
    true if there is at least one security tag value on the given class
    Since:
    2.5

    getSecurityCreateTagValue

    public static String getSecurityCreateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_SECURITY_CREATE tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SECURITY_CREATE

    getSecurityDeleteTagValue

    public static String getSecurityDeleteTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_SECURITY_DELETE tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SECURITY_DELETE

    getSecurityLoadTagValue

    public static String getSecurityLoadTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_SECURITY_LOAD tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SECURITY_LOAD

    getSecurityUpdateTagValue

    public static String getSecurityUpdateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_SECURITY_UPDATE tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SECURITY_UPDATE

    getNotGenerateToStringTagValue

    public 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.

    Parameters:
    clazz - class to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_NOT_GENERATE_TO_STRING

    getSortAttributeTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_SORT_ATTRIBUTE

    getGenerateStandaloneEnumForDAOHelperTagValue

    public static String getGenerateStandaloneEnumForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the value of the TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPER tag value on the given model.

    Parameters:
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPER

    getGenerateOperatorForDAOHelperTagValue

    public static String getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)

    getTypeTagValue

    public static String getTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_TYPE tag value on the given attribute.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_TYPE

    getSqlTypeTagValue

    public 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.

    Parameters:
    attribute - attribute to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_TYPE

    getExceptionClassTagValue

    public static String getExceptionClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the value of the TopiaTagValues.TAG_EXCEPTION_CLASS tag value on the given interface.

    Parameters:
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_EXCEPTION_CLASS

    getTransactionTagValue

    public static String getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
    Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given operation.

    Parameters:
    operation - operation to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_TRANSACTION

    getTransactionTagValue

    public static String getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_TRANSACTION

    getDoCommitTagValue

    public static String getDoCommitTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation,
                                             org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the value of the TopiaTagValues.TAG_DO_COMMIT tag value on the given operation.

    Parameters:
    operation - operation to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_DO_COMMIT

    getErrorArgsTagValue

    public static String getErrorArgsTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
    Obtain the value of the TopiaTagValues.TAG_ERROR_ARGS tag value on the given operation.

    Parameters:
    operation - operation to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_ERROR_ARGS

    getNoLogInServiceTagValue

    @Deprecated
    public static String getNoLogInServiceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
                                                              org.nuiton.eugene.models.object.ObjectModel model)
    Deprecated. since 2.5.4, no more use will be remove soon.

    Obtain the value of the TopiaTagValues.TAG_NO_LOG_IN_SERVICE tag value on the given classifier.

    Parameters:
    classifier - classifier to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_NO_LOG_IN_SERVICE

    getDaoImplementationTagValue

    public 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.

    Parameters:
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.5
    See Also:
    TopiaTagValues.TAG_DAO_IMPLEMENTATION

    getIndexForeignKeys

    public 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.

    Parameters:
    attribute - attribute to test
    model - model to test
    Returns:
    none empty value of the found tag value or null if not found nor empty.
    Since:
    2.6.5
    See Also:
    TopiaTagValues.TAG_INDEX_FOREIGN_KEYS

    hasUseEnumerationNameTagValue

    public static boolean hasUseEnumerationNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                                        org.nuiton.eugene.models.object.ObjectModel model)

    shouldGenerateDTOTopiaIdTagValue

    public 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.

    Parameters:
    classifier - classifier to seek
    model - model to seek
    Returns:
    the none empty value of the found tag value or null if not found nor empty.
    Since:
    2.6.7
    See Also:
    TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTO


    Copyright © 2004-2012 CodeLutin. All Rights Reserved.