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 Details

    • DEPENDENCIES_DAO

      public static final String DEPENDENCIES_DAO
      dependency to add extra operations for entity dao.
      Since:
      2.3.4
      See Also:
    • PERSISTENCE_TYPE_HIBERNATE

      public static final String PERSISTENCE_TYPE_HIBERNATE
      Type de persistence Hibernate
      See Also:
    • PERSISTENCE_TYPE_LDAP

      public static final String PERSISTENCE_TYPE_LDAP
      Type de persistence LDAP
      See Also:
    • PERSISTENCE_TYPE_DEFAULT

      public static final String PERSISTENCE_TYPE_DEFAULT
      Type de persistence par défaut (si aucun précisé)
      See Also:
    • PROPERTY_DEFAULT_PACKAGE

      public static final String PROPERTY_DEFAULT_PACKAGE
      Propriété des générateurs indiquant le package par défaut
      See Also:
    • DEFAULT_PACKAGE

      public static final String DEFAULT_PACKAGE
      Le package par défaut si aucun n'est spécifié
      See Also:
    • OBJECT_MODEL_CLASS_COMPARATOR

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

    • TopiaGeneratorUtil

      public TopiaGeneratorUtil()
  • Method Details

    • 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. 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 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 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.
      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 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.
      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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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 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:
    • getReverseDbNameTagValue

      public static 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:
    • getManytoManyTableNameTagValue

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