Class TopiaGeneratorUtil

java.lang.Object
org.nuiton.eugene.GeneratorUtil
org.nuiton.eugene.java.JavaGeneratorUtil
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$
Author:
Arnaud Thimel <thimel@codelutin.com>, tchemit <tchemit@codelutin.com>, fdesbois <fdesbois@codelutin.com>, chatellier <chatellier@codelutin.com>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String DEFAULT_PACKAGE
    Le package par défaut si aucun n'est spécifié
    static java.lang.String DEPENDENCIES_DAO
    dependency to add extra operations for entity dao.
    static java.util.Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR  
    static java.lang.String PERSISTENCE_TYPE_DEFAULT
    Type de persistence par défaut (si aucun précisé)
    static java.lang.String PERSISTENCE_TYPE_HIBERNATE
    Type de persistence Hibernate
    static java.lang.String PERSISTENCE_TYPE_LDAP
    Type de persistence LDAP
    static java.lang.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

    Constructors 
    Constructor Description
    TopiaGeneratorUtil()  
  • Method Summary

    Modifier and Type Method Description
    protected static java.util.List<java.lang.String> cleanImports​(java.lang.String packageName, java.util.Set<java.lang.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 java.lang.String getAccessTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_ACCESS tag value on the given attribute.
    static java.lang.String getAnnotationTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_ANNOTATION tag value on the given attribute.
    static java.util.List<org.nuiton.eugene.models.object.ObjectModelClass> getClassesByStereotype​(java.lang.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 java.lang.String getCopyright​(org.nuiton.eugene.models.Model model)
    Deprecated.
    since 2.5 never use anywhere
    static java.lang.Class<?> getDAOImplementation​(org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the class to use as abstract dao.
    static java.lang.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 java.lang.String getDbName​(org.nuiton.eugene.models.object.ObjectModelElement element)
    Renvoie le nom BD de l'élement passé en paramètre.
    static java.lang.String getDBName​(org.nuiton.eugene.models.object.ObjectModelElement element)
    Deprecated.
    since 2.5, prefer use the method getDbName(ObjectModelElement)
    static java.lang.String getDbNameTagValue​(org.nuiton.eugene.models.object.ObjectModelElement element)
    Obtain the value of the TopiaTagValues.TAG_DB_NAME tag value on the given element.
    static java.lang.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 java.lang.String getDefaultPackage​(org.nuiton.eugene.AbstractGenerator<?> generator)
    Renvoie le package par défaut pour le générateur donné
    static java.lang.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 java.lang.String getDOType​(java.lang.String type, org.nuiton.eugene.models.object.ObjectModel model)  
    static java.lang.String getDOType​(org.nuiton.eugene.models.object.ObjectModelElement elem, org.nuiton.eugene.models.object.ObjectModel model)  
    static <Type extends org.nuiton.eugene.models.object.ObjectModelElement>
    java.util.Collection<Type>
    getElementsWithStereotype​(java.util.Collection<Type> elements, java.lang.String... stereotypes)  
    static java.util.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 java.lang.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 java.lang.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 java.lang.String getFetchTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_FETCH tag value on the given attribute.
    static java.lang.String getGenerateOperatorForDAOHelperTagValue​(org.nuiton.eugene.models.object.ObjectModel model)  
    static java.lang.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 java.util.List<java.lang.String> getImports​(org.nuiton.eugene.models.object.ObjectModelClass aClass, java.lang.String... incomingFqns)
    Obtain the list of fqn of object involed in the given class.
    protected static void getImports​(org.nuiton.eugene.models.object.ObjectModelClass aClass, java.util.Set<java.lang.String> fqns)
    Obtain the list of fqn of object involed in the given class.
    static java.util.List<java.lang.String> getImports​(org.nuiton.eugene.models.object.ObjectModelInterface anInterface, java.lang.String... incomingFqns)
    Obtain the list of fqn of object involed in the given interface.
    protected static void getImports​(org.nuiton.eugene.models.object.ObjectModelInterface anInterface, java.util.Set<java.lang.String> fqns)
    Obtain the list of fqn of object involed in the given interface.
    protected static void getImports​(org.nuiton.eugene.models.object.ObjectModelOperation operation, java.util.Set<java.lang.String> fqns)
    Obtain the fqn's list of all involed type in a givne operation.
    static java.lang.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 java.lang.String getInverseTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_INVERSE tag value on the given attribute.
    static java.lang.String getLazyTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_LAZY tag value on the given attribute.
    static java.lang.String getLengthTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_LENGTH tag value on the given attribute.
    static java.lang.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.
    static java.lang.String getManytoManyTableNameTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Obtain the value of the TopiaTagValues.TAG_MANY_TO_MANY_TABLE_NAME tag value on the given attribute.
    static java.util.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 java.lang.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 java.lang.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 java.lang.String getNMultiplicityHibernateType​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'interface à utiliser en fonction de l'attribut
    static java.lang.String getNMultiplicityInterfaceType​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'interface à utiliser en fonction de l'attribut
    static java.lang.String getNMultiplicityObjectType​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut
    static java.lang.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 java.lang.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 java.util.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 java.lang.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 java.lang.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 java.lang.String getPersistenceType​(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Renvoie le type de persistence pour le classifier donné.
    static java.lang.String getPersistenceType​(org.nuiton.eugene.models.object.ObjectModelElement element)
    Deprecated.
    since 2.5, prefer use the method getPersistenceType(ObjectModelClassifier)
    static java.lang.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 java.lang.String getPrimaryKeyAttributesListDeclaration​(org.nuiton.eugene.models.object.ObjectModelClass clazz, boolean includeName)  
    static java.lang.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 java.lang.String getReverseDbName​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Obtain the reverse db name of an attribute.
    static java.lang.String getReverseDBName​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Deprecated.
    since 2.5, prefer use the methode getReverseDbName(ObjectModelAttribute)
    static java.lang.String getReverseDbNameOnReverseAttribute​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
    Obtain the reverse db name of a reverse attribute.
    static java.lang.String getReverseDbNameTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute element)
    Obtain the value of the TopiaTagValues.TAG_REVERSE_DB_NAME tag value on the given element.
    static java.lang.String getSchemaName​(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
    Deprecated.
    static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getTransactionTagValue​(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
    Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given classifier.
    static java.lang.String getTransactionTagValue​(org.nuiton.eugene.models.object.ObjectModelOperation operation)
    Obtain the value of the TopiaTagValues.TAG_TRANSACTION tag value on the given operation.
    static java.lang.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 hasIndexedCollectionStereotype​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
    Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTION 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, java.lang.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​(java.util.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 isDoNotGenerateReadListeners​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the value of the TopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERS tag value on the given model or classifier.
    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 isGenerateForeignKeyNames​(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
    Obtain the value of the TopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERS tag value on the given model or classifier and returns true if the tag value was found and value true.
    static boolean isImportNeeded​(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations, java.lang.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​(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)  
    static boolean isTextType​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)  
    static java.util.Map<org.nuiton.eugene.models.object.ObjectModelClass,​java.util.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, java.util.Map<java.lang.String,​org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN, java.util.Map<org.nuiton.eugene.models.object.ObjectModelClass,​java.util.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 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.
    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, getAttributeImplementationType, getAttributeImplementationType, getAttributeInterfaceType, getAttributeInterfaceType, getAttributeInterfaceType, getClassAttributesListDeclaration, getCollectionInstanceType, getCollectionType, getOperationParametersListDeclaration, isOrdered, joinGeneric, splitFqnList, splitGeneric

    Methods inherited from class org.nuiton.eugene.GeneratorUtil

    computeSerialVersionUID, convertConstantNameToVariableName, convertVariableNameToConstantName, findTagValue, generateSerialVersionUID, getAssocAttrName, getCastValue, getClassifiers, getClassNameFromQualifiedName, getFilenameFromQualifiedName, getFormatingExpression, getHashCodeExpression, getInitValue, getInitValue, getOperationParametersListName, getParentPackageName, getParsingExpression, getPrimitiveWrapType, getSimpleName, getSimpleName, getTypesList, hasDocumentation, hasStereotype, isBooleanPrimitive, isBooleanPrimitive, isComposition, isFirstAttribute, isNMultiplicity, isNMultiplicity, isOneMultiplicity, isPrimitiveAttributeType, isPrimitiveType, notEmpty, removeAnyGenericDefinition, removeGenericDefinition, splitGenericDefinition, toLowerCaseFirstLetter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getDefaultPackage

      public static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getReverseDbName​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
      Obtain the reverse db name of an attribute. Try first to get the reverse db Name from the ReverseDbname tag-vlaue, then 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
    • getReverseDbNameOnReverseAttribute

      public static java.lang.String getReverseDbNameOnReverseAttribute​(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
      Obtain the reverse db name of a reverse attribute. Note that the reverse attribute can't be null here.
      • Try first to get the reverse db Name from the ReverseDbname tag-value
      • If not found, try then the ReverseDbname tag-value on the same attribute but from this other side of the relation
      • If not found, try then just get the name of the reverse attribute
      Parameters:
      attr - the attribute to seek
      Returns:
      the value of the reverse db name on the revser attribute
      Since:
      2.9.5.2
    • getDBName

      @Deprecated public static java.lang.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 java.lang.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 java.lang.String getSchemaName​(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)
      Deprecated.
      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
    • 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.
      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 java.util.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 java.util.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 java.lang.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> java.util.Collection<Type> getElementsWithStereotype​(java.util.Collection<Type> elements, java.lang.String... stereotypes)
    • hasStereotypes

      public static boolean hasStereotypes​(org.nuiton.eugene.models.object.ObjectModelElement element, java.lang.String... stereotypes)
    • getPrimaryKeyAttributesListDeclaration

      public static java.lang.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 java.lang.String getDOType​(org.nuiton.eugene.models.object.ObjectModelElement elem, org.nuiton.eugene.models.object.ObjectModel model)
    • getDOType

      public static java.lang.String getDOType​(java.lang.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 java.lang.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.
      Parameters:
      attr - l'attribut servant de base au calcul du nom
      Returns:
      le nom de la table
    • getNMultiplicityInterfaceType

      public static java.lang.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 java.lang.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 java.lang.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 java.util.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 java.util.List<org.nuiton.eugene.models.object.ObjectModelClass> getClassesByStereotype​(java.lang.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 java.util.List<java.lang.String> getImports​(org.nuiton.eugene.models.object.ObjectModelClass aClass, java.lang.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 java.util.List<java.lang.String> getImports​(org.nuiton.eugene.models.object.ObjectModelInterface anInterface, java.lang.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, java.util.Set<java.lang.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, java.util.Set<java.lang.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, java.util.Set<java.lang.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 java.util.List<java.lang.String> cleanImports​(java.lang.String packageName, java.util.Set<java.lang.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 java.lang.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 java.util.Map<org.nuiton.eugene.models.object.ObjectModelClass,​java.util.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, java.util.Map<java.lang.String,​org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN, java.util.Map<org.nuiton.eugene.models.object.ObjectModelClass,​java.util.Set<org.nuiton.eugene.models.object.ObjectModelClass>> usages)
    • isImportNeeded

      public static boolean isImportNeeded​(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations, java.lang.String importName)
    • isCollectionNeeded

      public static boolean isCollectionNeeded​(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)
    • isSetNeeded

      public static boolean isSetNeeded​(java.util.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
    • hasIndexedCollectionStereotype

      public static boolean hasIndexedCollectionStereotype​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
      Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTION stereotype.
      Parameters:
      attribute - attribute to test
      Returns:
      true if stereotype was found, false otherwise
      Since:
      2.10
      See Also:
      TopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTION
    • getPersistenceTypeTagValue

      public static java.lang.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 java.lang.String getDbNameTagValue​(org.nuiton.eugene.models.object.ObjectModelElement element)
      Obtain the value of the TopiaTagValues.TAG_DB_NAME tag value on the given element. Note that it won't and search on declaring element or anywhere else than on the given element. See https://forge.nuiton.org/issues/2342
      Parameters:
      element - element 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
    • getReverseDbNameTagValue

      public static java.lang.String getReverseDbNameTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute element)
      Obtain the value of the TopiaTagValues.TAG_REVERSE_DB_NAME tag value on the given element. Note that it won't and search on declaring element or anywhere else than on the given element. See https://forge.nuiton.org/issues/2342
      Parameters:
      element - element 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_REVERSE_DB_NAME
    • getManytoManyTableNameTagValue

      public static java.lang.String getManytoManyTableNameTagValue​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
      Obtain the value of the TopiaTagValues.TAG_MANY_TO_MANY_TABLE_NAME tag value on the given attribute. Note that it won't and search on declaring element or anywhere else than on the given element. See https://forge.nuiton.org/issues/2342
      Parameters:
      attribute - attribute to seek
      Returns:
      the none empty value of the found tag value or null if not found nor empty.
      Since:
      2.9.2
      See Also:
      TopiaTagValues.TAG_MANY_TO_MANY_TABLE_NAME
    • getDbSchemaNameTagValue

      public static java.lang.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
    • getLengthTagValue

      public static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getGenerateOperatorForDAOHelperTagValue​(org.nuiton.eugene.models.object.ObjectModel model)
    • getTypeTagValue

      public static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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
    • isDoNotGenerateReadListeners

      public static boolean isDoNotGenerateReadListeners​(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)
      Obtain the value of the TopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERS tag value on the given model or classifier. It will first look on the model, and then in the given classifier.
      Parameters:
      model - model to seek
      attribute - attribute to seek
      Returns:
      the none empty value of the found tag value or null if not found nor empty.
      Since:
      2.9
      See Also:
      TopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERS
    • isGenerateForeignKeyNames

      public static boolean isGenerateForeignKeyNames​(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)
      Obtain the value of the TopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERS tag value on the given model or classifier and returns true if the tag value was found and value true. It will first look on the model, and then in the given classifier.
      Parameters:
      model - model to seek
      classifier - classifier to seek
      Returns:
      true if tag value was found on classifier or model and his value is true, otherwise false.
      Since:
      2.10
      See Also:
      TopiaTagValues.TAG_GENERATE_FOREIGN_KEY_NAMES