Package org.nuiton.topia.generator
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.StringDEFAULT_PACKAGELe package par défaut si aucun n'est spécifiéstatic java.lang.StringDEPENDENCIES_DAOdependency to add extra operations for entity dao.static java.util.Comparator<org.nuiton.eugene.models.object.ObjectModelClass>OBJECT_MODEL_CLASS_COMPARATORstatic java.lang.StringPERSISTENCE_TYPE_DEFAULTType de persistence par défaut (si aucun précisé)static java.lang.StringPERSISTENCE_TYPE_HIBERNATEType de persistence Hibernatestatic java.lang.StringPERSISTENCE_TYPE_LDAPType de persistence LDAPstatic java.lang.StringPROPERTY_DEFAULT_PACKAGEPropriété des générateurs indiquant le package par défaut -
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 aListand sort it.static booleangenerateToString(org.nuiton.eugene.models.object.ObjectModelClass clazz, org.nuiton.eugene.models.object.ObjectModel model)Test if we need to generatetoStringmethod for the given class.static java.lang.StringgetAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_ACCESStag value on the given attribute.static java.lang.StringgetAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_ANNOTATIONtag 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.StringgetCopyright(org.nuiton.eugene.models.Model model)Deprecated.since 2.5 never use anywherestatic java.lang.Class<?>getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)Obtain the class to use as abstract dao.static java.lang.StringgetDaoImplementationTagValue(org.nuiton.eugene.models.object.ObjectModel model)Obtains the value of theTopiaTagValues.TAG_DAO_IMPLEMENTATIONtag value on the given model.static org.nuiton.eugene.models.object.ObjectModelInterfacegetDAOInterface(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ètrestatic java.lang.StringgetDbName(org.nuiton.eugene.models.object.ObjectModelElement element)Renvoie le nom BD de l'élement passé en paramètre.static java.lang.StringgetDBName(org.nuiton.eugene.models.object.ObjectModelElement element)Deprecated.since 2.5, prefer use the methodgetDbName(ObjectModelElement)static java.lang.StringgetDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelElement element)Obtain the value of theTopiaTagValues.TAG_DB_NAMEtag value on the given element.static java.lang.StringgetDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_SCHEMA_NAMEtag value on the given classifier.static java.lang.StringgetDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)Renvoie le package par défaut pour le générateur donnéstatic java.lang.StringgetDoCommitTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_DO_COMMITtag value on the given operation.static java.lang.StringgetDOType(java.lang.String type, org.nuiton.eugene.models.object.ObjectModel model)static java.lang.StringgetDOType(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.StringgetErrorArgsTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)Obtain the value of theTopiaTagValues.TAG_ERROR_ARGStag value on the given operation.static java.lang.StringgetExceptionClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_EXCEPTION_CLASStag value on the given interface.static java.lang.StringgetFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_FETCHtag value on the given attribute.static java.lang.StringgetGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)static java.lang.StringgetGenerateStandaloneEnumForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPERtag 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 voidgetImports(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 voidgetImports(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 voidgetImports(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.StringgetIndexForeignKeys(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)Obtains the value of the tag valueTopiaTagValues.TAG_INDEX_FOREIGN_KEYSon the model or on the given attribute.static java.lang.StringgetInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_INVERSEtag value on the given attribute.static java.lang.StringgetLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_LAZYtag value on the given attribute.static java.lang.StringgetLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_LENGTHtag value on the given attribute.static java.lang.StringgetManyToManyTableName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Renvoie le nom unique de table pour une relation ManyToMany en fonction de l'attributattr.static java.lang.StringgetManytoManyTableNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_MANY_TO_MANY_TABLE_NAMEtag 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.StringgetNaturalIdMutableTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_NATURAL_ID_MUTABLEtag value on the given classifier.static java.lang.StringgetNaturalIdTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_NATURAL_IDtag value on the given attribute.static java.lang.StringgetNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Renvoie le type d'interface à utiliser en fonction de l'attributstatic java.lang.StringgetNMultiplicityInterfaceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Renvoie le type d'interface à utiliser en fonction de l'attributstatic java.lang.StringgetNMultiplicityObjectType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Renvoie le type d'objet (instance) à utiliser en fonction de l'attributstatic java.lang.StringgetNoLogInServiceTagValue(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.StringgetNotGenerateToStringTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier clazz, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_NOT_GENERATE_TO_STRINGtag 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.StringgetNotNullTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_NOT_NULLtag value on the given attribute.static java.lang.StringgetOrderByTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_ORDER_BYtag value on the given attribute.static java.lang.StringgetPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Renvoie le type de persistence pour le classifier donné.static java.lang.StringgetPersistenceType(org.nuiton.eugene.models.object.ObjectModelElement element)Deprecated.since 2.5, prefer use the methodgetPersistenceType(ObjectModelClassifier)static java.lang.StringgetPersistenceTypeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_PERSISTENCE_TYPEtag value on the given classifier.static java.lang.StringgetPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz, boolean includeName)static java.lang.StringgetProxyInterfaceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_PROXY_INTERFACEtag value on the given classifier.static java.lang.StringgetReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Obtain the reverse db name of an attribute.static java.lang.StringgetReverseDBName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Deprecated.since 2.5, prefer use the methodegetReverseDbName(ObjectModelAttribute)static java.lang.StringgetReverseDbNameOnReverseAttribute(org.nuiton.eugene.models.object.ObjectModelAttribute attr)Obtain the reverse db name of a reverse attribute.static java.lang.StringgetReverseDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute element)Obtain the value of theTopiaTagValues.TAG_REVERSE_DB_NAMEtag value on the given element.static java.lang.StringgetSchemaName(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)Deprecated.since 2.5, prefer use the methodgetDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel)static java.lang.StringgetSecurityCreateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_SECURITY_CREATEtag value on the given classifier.static java.lang.StringgetSecurityDeleteTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_SECURITY_DELETEtag value on the given classifier.static java.lang.StringgetSecurityLoadTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_SECURITY_LOADtag value on the given classifier.static java.lang.StringgetSecurityUpdateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_SECURITY_UPDATEtag value on the given classifier.static java.lang.StringgetSortAttributeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_SORT_ATTRIBUTEtag value on the given classifier.static java.lang.StringgetSqlTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_SQL_TYPEtag value on the given attribute.static java.lang.StringgetTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Obtain the value of theTopiaTagValues.TAG_TRANSACTIONtag value on the given classifier.static java.lang.StringgetTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)Obtain the value of theTopiaTagValues.TAG_TRANSACTIONtag value on the given operation.static java.lang.StringgetTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Obtain the value of theTopiaTagValues.TAG_TYPEtag value on the given attribute.static booleanhasArrayStereotype(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.0static booleanhasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_DAOstereotype.static booleanhasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)Check if the given operation has theTopiaStereoTypes.STEREOTYPE_DAOstereotype.static booleanhasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_DTOstereotype.static booleanhasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Check if the given attribute has theTopiaStereoTypes.STEREOTYPE_ENTITYstereotype.static booleanhasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_ENTITYstereotype.static booleanhasFacadeStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_FACADEstereotype.static booleanhasIndexedCollectionStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Check if the given attribute has theTopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTIONstereotype.static booleanhasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)Indique si la classe specifiee n'a aucune ou que des methodes abstraitesstatic booleanhasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Check if the given attribute has theTopiaStereoTypes.STEREOTYPE_PRIMARYKAYstereotype.static booleanhasServiceStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_SERVICEstereotype.static booleanhasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element, java.lang.String... stereotypes)static booleanhasUnidirectionalRelationOnAbstractType(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 booleanhasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Check if the given attribute has theTopiaStereoTypes.STEREOTYPE_UNIQUEstereotype.static booleanhasUseEnumerationNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attr, org.nuiton.eugene.models.object.ObjectModel model)static booleanisAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr)static booleanisBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)static booleanisClassWithSecurity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Tests if the given classifier own at least one security tag value.static booleanisCollectionNeeded(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)static booleanisContextable(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Retourne true si le tagValueTopiaTagValues.TAG_CONTEXTABLEà la valeurtrue.static booleanisDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)static booleanisDoNotGenerateReadListeners(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERStag value on the given model or classifier.static booleanisEntity(org.nuiton.eugene.models.object.ObjectModelAttribute attribute, org.nuiton.eugene.models.object.ObjectModel model)Check if the given attribute type is an entity.static booleanisEntity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Check if the given classifier has theTopiaStereoTypes.STEREOTYPE_ENTITYand is not an enumerationstatic booleanisGenerateForeignKeyNames(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)Obtain the value of theTopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERStag value on the given model or classifier and returnstrueif the tag value was found and valuetrue.static booleanisImportNeeded(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations, java.lang.String importName)static booleanisNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Detecte si un attribut fait partie d'une clef metier.static booleanisNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)Detecte si la clef metier d'une classe est mutable ou pas.static booleanisNotNull(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Detecte si un attribut est marqué comme non null.static booleanisNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)static booleanisPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)static booleanisSetNeeded(java.util.Collection<org.nuiton.eugene.models.object.ObjectModelOperation> operations)static booleanisTextType(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 voidsearchDirectUsages(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 booleanshouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)Indique si la classe specifiee devrait etre abstraitestatic booleanshouldGenerateDTOTopiaIdTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier, org.nuiton.eugene.models.object.ObjectModel model)Search if the TagValueTopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTOhas been activated in the model.static booleanshouldGenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)Cherche si le tagvalueTopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPERa été activé dans le model.static booleanshouldGenerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)Cherche si le tagvalueTopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPERa été activé dans le model.static booleanshouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)Deprecated.since 2.5, prefer use the methodshouldGenerateStandaloneEnumForDAOHelper(ObjectModel)static booleansortAttribute(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, splitGenericMethods 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
-
Field Details
-
DEPENDENCIES_DAO
public static final java.lang.String DEPENDENCIES_DAOdependency to add extra operations for entity dao.- Since:
- 2.3.4
- See Also:
- Constant Field Values
-
PERSISTENCE_TYPE_HIBERNATE
public static final java.lang.String PERSISTENCE_TYPE_HIBERNATEType de persistence Hibernate- See Also:
- Constant Field Values
-
PERSISTENCE_TYPE_LDAP
public static final java.lang.String PERSISTENCE_TYPE_LDAPType de persistence LDAP- See Also:
- Constant Field Values
-
PERSISTENCE_TYPE_DEFAULT
public static final java.lang.String PERSISTENCE_TYPE_DEFAULTType de persistence par défaut (si aucun précisé)- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_PACKAGE
public static final java.lang.String PROPERTY_DEFAULT_PACKAGEPropriété des générateurs indiquant le package par défaut- See Also:
- Constant Field Values
-
DEFAULT_PACKAGE
public static final java.lang.String DEFAULT_PACKAGELe package par défaut si aucun n'est spécifié- See Also:
- Constant Field Values
-
OBJECT_MODEL_CLASS_COMPARATOR
public static final java.util.Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR
-
-
Constructor Details
-
TopiaGeneratorUtil
public TopiaGeneratorUtil()
-
-
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 à testermodel- 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 methodgetPersistenceType(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 methodegetReverseDbName(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 methodgetDbName(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.since 2.5, prefer use the methodgetDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel)Cherche et renvoie le schema a utiliser sur cet element, sinon sur le model.- Parameters:
element- l'élément à testermodel- 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 tagvalueTopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPERa été activé dans le model.- Parameters:
model- le modele utilisé- Returns:
truesi le tag value trouvé dans le modèle,falsesinon.- Since:
- 2.5
-
shouldGnerateStandaloneEnumForDAOHelper
@Deprecated public static boolean shouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element, org.nuiton.eugene.models.object.ObjectModel model)Deprecated.since 2.5, prefer use the methodshouldGenerateStandaloneEnumForDAOHelper(ObjectModel)Cherche si le tagvalueTopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPERa été activé dans le model.- Parameters:
element- l'élément à testermodel- le modele utilisé- Returns:
truesi le tag value trouvé dans le modèle,falsesinon.- Since:
- 2.4.1
-
shouldGenerateStandaloneEnumForDAOHelper
public static boolean shouldGenerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)Cherche si le tagvalueTopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPERa été activé dans le model.- Parameters:
model- le modele utilisé- Returns:
truesi le tag value trouvé dans le modèle,falsesinon.- 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 generatetoStringmethod for the given class.- Parameters:
clazz- class to testmodel- model- Returns:
trueiftoStringshould 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 à testermodel- 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:
truesi l'attribut fait partie d'une clef metier,falsesinon.
-
isNotNull
public static boolean isNotNull(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)Detecte si un attribut est marqué comme non null. Les naturalIdisNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute)sont not null par défaut- Parameters:
attribute- l'attribut à tester- Returns:
truesi l'attribut doit être non null, par défaut pour les naturalId,falsesinon..- Since:
- 2.6.9
-
getCopyright
@Deprecated public static java.lang.String getCopyright(org.nuiton.eugene.models.Model model)Deprecated.since 2.5 never use anywhereCherches 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 testermodel- 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'attributattr.- 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 scansort- 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 stereotypemodel- the current model to scansort- 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:
truesi le tag value a ete positionne sur la classe via le tagTopiaTagValues.TAG_NATURAL_ID_MUTABLE,falsesinon.
-
isContextable
public static boolean isContextable(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)Retourne true si le tagValueTopiaTagValues.TAG_CONTEXTABLEà la valeurtrue.- Parameters:
classifier- classifier to test- Returns:
truesiTopiaTagValues.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 inspectincomingFqns- 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 inspectincomingFqns- 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 inspectfqns- 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 inspectfqns- 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 inspectfqns- 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 aListand sort it.- Parameters:
packageName- the current package namefqns- 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 valueTopiaTagValues.TAG_DAO_IMPLEMENTATIONin model and if not found will use the default value which isTopiaDAOImpl.- 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 theTopiaStereoTypes.STEREOTYPE_FACADEstereotype.- Parameters:
classifier- classifier to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_ENTITYstereotype.- Parameters:
classifier- classifier to test- Returns:
trueif stereotype was found,falseotherwise- 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 testmodel- model containing the attribute- Returns:
trueif type of attribute is an entity,falseotherwise- 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 theTopiaStereoTypes.STEREOTYPE_ENTITYand is not an enumeration- Parameters:
classifier- classifier to test- Returns:
trueif stereotype was found and classifier is not enumeration,falseotherwise- 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 theTopiaStereoTypes.STEREOTYPE_ENTITYstereotype.- Parameters:
attribute- attribute to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_DTOstereotype.- Parameters:
classifier- classifier to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_SERVICEstereotype.- Parameters:
classifier- classifier to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_DAOstereotype.- Parameters:
classifier- classifier to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_DAOstereotype.- Parameters:
operation- operation to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_UNIQUEstereotype.- Parameters:
attribute- attribute to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_PRIMARYKAYstereotype.- Parameters:
attribute- attribute to test- Returns:
trueif 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.0Check if the given attribute has theTopiaStereoTypes.STEREOTYPE_ARRAYstereotype.- Parameters:
attribute- attribute to test- Returns:
trueif 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 theTopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTIONstereotype.- Parameters:
attribute- attribute to test- Returns:
trueif stereotype was found,falseotherwise- 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 theTopiaTagValues.TAG_PERSISTENCE_TYPEtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_DB_NAMEtag 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
nullif 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 theTopiaTagValues.TAG_REVERSE_DB_NAMEtag 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
nullif 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 theTopiaTagValues.TAG_MANY_TO_MANY_TABLE_NAMEtag 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
nullif 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 theTopiaTagValues.TAG_SCHEMA_NAMEtag value on the given classifier.- Parameters:
classifier- classifier to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_LENGTHtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_ANNOTATIONtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_ACCESStag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_NATURAL_IDtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_NATURAL_ID_MUTABLEtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_INVERSEtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_LAZYtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_FETCHtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_ORDER_BYtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_NOT_NULLtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_PROXY_INTERFACEtag value on the given classifier.- Parameters:
classifier- classifier to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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:
trueif 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 theTopiaTagValues.TAG_SECURITY_CREATEtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_SECURITY_DELETEtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_SECURITY_LOADtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_SECURITY_UPDATEtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_NOT_GENERATE_TO_STRINGtag value on the given class.- Parameters:
clazz- class to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_SORT_ATTRIBUTEtag value on the given classifier.- Parameters:
classifier- classifier to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPERtag value on the given model.- Parameters:
model- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_TYPEtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_SQL_TYPEtag value on the given attribute.- Parameters:
attribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_EXCEPTION_CLASStag value on the given interface.- Parameters:
model- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_TRANSACTIONtag value on the given operation.- Parameters:
operation- operation to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_TRANSACTIONtag value on the given classifier.- Parameters:
classifier- classifier to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_DO_COMMITtag value on the given operation.- Parameters:
operation- operation to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_ERROR_ARGStag value on the given operation.- Parameters:
operation- operation to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_NO_LOG_IN_SERVICEtag value on the given classifier.- Parameters:
classifier- classifier to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_DAO_IMPLEMENTATIONtag value on the given model.- Parameters:
model- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 valueTopiaTagValues.TAG_INDEX_FOREIGN_KEYSon the model or on the given attribute.- Parameters:
attribute- attribute to testmodel- model to test- Returns:
- none empty value of the found tag value or
nullif 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 TagValueTopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTOhas been activated in the model.- Parameters:
classifier- classifier to seekmodel- model to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERStag value on the given model or classifier. It will first look on the model, and then in the given classifier.- Parameters:
model- model to seekattribute- attribute to seek- Returns:
- the none empty value of the found tag value or
nullif 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 theTopiaTagValues.TAG_DO_NOT_GENERATE_READ_LISTENERStag value on the given model or classifier and returnstrueif the tag value was found and valuetrue. It will first look on the model, and then in the given classifier.- Parameters:
model- model to seekclassifier- classifier to seek- Returns:
trueif tag value was found on classifier or model and his value istrue, otherwisefalse.- Since:
- 2.10
- See Also:
TopiaTagValues.TAG_GENERATE_FOREIGN_KEY_NAMES
-