Author: tchemit Date: 2014-04-26 21:17:33 +0200 (Sat, 26 Apr 2014) New Revision: 3084 Url: http://forge.nuiton.org/projects/topia/repository/revisions/3084 Log: refs #2079 (add some first tag values default values) + reformat tag values Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java =================================================================== --- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-04-26 18:57:31 UTC (rev 3083) +++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-04-26 19:17:33 UTC (rev 3084) @@ -25,6 +25,7 @@ */ import org.nuiton.eugene.EugeneTagValues; +import org.nuiton.eugene.metas.TagValueDefinition; import org.nuiton.eugene.metas.matcher.PrefixTagNameMatchTagValueMatcher; import org.nuiton.eugene.models.object.ObjectModel; import org.nuiton.eugene.models.object.ObjectModelAttribute; @@ -34,8 +35,6 @@ import org.nuiton.topia.persistence.TopiaDaoSupplier; import org.nuiton.topia.persistence.TopiaEntityContextable; -import org.nuiton.eugene.metas.TagValueDefinition; - /** * All extra tag values usable in topia generators. * @@ -52,7 +51,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelClassifier.class}, - documentation = "") + documentation = "TODO") String TAG_PERSISTENCE_TYPE = "persistenceType"; /** @@ -62,7 +61,7 @@ * * @since 2.5.3 */ - @TagValueDefinition(target = {ObjectModelClassifier.class}, documentation = "") + @TagValueDefinition(target = {ObjectModelClassifier.class}, documentation = "TODO") String TAG_CONTEXTABLE = "contextable"; /** @@ -73,7 +72,7 @@ * @see TopiaGeneratorUtil#getReverseDbName(ObjectModelAttribute) */ @TagValueDefinition(target = {ObjectModelElement.class}, - documentation = "Sets the database name of an element of the model (a table or a column)") + documentation = "Sets the database name of an element of the model (a table or a column)") String TAG_DB_NAME = "dbName"; /** @@ -84,7 +83,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class, ObjectModelAttribute.class}, - documentation = "Sets the database schema name") + documentation = "Sets the database schema name") String TAG_SCHEMA_NAME = "dbSchema"; /** @@ -94,7 +93,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the length of an attribute in database") + documentation = "Sets the length of an attribute in database") String TAG_LENGTH = "length"; /** @@ -104,7 +103,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets an annotation of an attribute") + documentation = "Sets an annotation of an attribute") String TAG_ANNOTATION = "annotation"; /** @@ -114,7 +113,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the access type of an attribute (Hibernate mapping)") + documentation = "Sets the access type of an attribute (Hibernate mapping)") String TAG_ACCESS = "access"; /** @@ -125,7 +124,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets an attribute as part of a natural id (Hibernate Mapping)") + documentation = "Sets an attribute as part of a natural id (Hibernate Mapping)") String TAG_NATURAL_ID = "naturalId"; /** @@ -136,7 +135,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelClassifier.class}, - documentation = "Sets if natural id of a entity is mutable (hibernate mapping)") + documentation = "Sets if natural id of a entity is mutable (hibernate mapping)") String TAG_NATURAL_ID_MUTABLE = "naturalIdMutable"; /** @@ -150,7 +149,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)") + documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)") String TAG_INVERSE = "inverse"; /** @@ -160,7 +159,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets if an association should be lazy (Hibernate mapping)") + documentation = "Sets if an association should be lazy (Hibernate mapping)") String TAG_LAZY = "lazy"; /** @@ -170,7 +169,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the fetch caracteristic of an attribute (Hibernate mapping)") + documentation = "Sets the fetch caracteristic of an attribute (Hibernate mapping)") String TAG_FETCH = "fetch"; /** @@ -180,7 +179,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the order by propertie of an multiple association (Hibernate mapping)") + documentation = "Sets the order by propertie of an multiple association (Hibernate mapping)") String TAG_ORDER_BY = "orderBy"; /** @@ -190,7 +189,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets if an attribute must be not null (Hibernate mapping)") + documentation = "Sets if an attribute must be not null (Hibernate mapping)") String TAG_NOT_NULL = "notNull"; /** @@ -198,11 +197,12 @@ * énumération : l'ajout de la tagValue indique qu'il faut utiliser le * {@code name} de l'énumération et non l'ordinal pour stocker la valeur en * base - * @see TopiaGeneratorUtil#hasUseEnumerationNameTagValue(ObjectModelClassifier,ObjectModelAttribute,ObjectModel) + * + * @see TopiaGeneratorUtil#hasUseEnumerationNameTagValue(ObjectModelClassifier, ObjectModelAttribute, ObjectModel) * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class, ObjectModelAttribute.class}, - documentation = "'true' if the value of this attribute of type Enumeration should be stored with its name (instead of using ordinal)") + documentation = "'true' if the value of this attribute of type Enumeration should be stored with its name (instead of using ordinal)") String TAG_USE_ENUMERATION_NAME = "useEnumerationName"; /** @@ -217,7 +217,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") + documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") String TAG_PROXY_INTERFACE = "hibernateProxyInterface"; /** @@ -232,7 +232,7 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") + documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)") String TAG_INHERITANCE_STRATEGY = "inheritanceStrategy"; /** @@ -243,7 +243,8 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "To not generate the toString method on entities") + defaultValue = "true", + documentation = "To not generate the toString method on entities") String TAG_NOT_GENERATE_TO_STRING = "notGenerateToString"; /** @@ -254,7 +255,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "To sort attribute while generation") + documentation = "To sort attribute while generation") String TAG_SORT_ATTRIBUTE = "sortAttribute"; /** @@ -265,7 +266,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "To generate EntityOperation on generated DAOHelper") + documentation = "To generate EntityOperation on generated DAOHelper") String TAG_GENERATE_OPERATOR_FOR_DAO_HELPER = "generateOperatorForDAOHelper"; /** @@ -278,7 +279,7 @@ */ @Deprecated @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the hibernate type of an attribute (Hibernate mapping)") + documentation = "Sets the hibernate type of an attribute (Hibernate mapping)") String TAG_TYPE = "type"; /** @@ -288,7 +289,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModelAttribute.class}, - documentation = "Sets the sql type of an attribute (Hibernate mapping)") + documentation = "Sets the sql type of an attribute (Hibernate mapping)") String TAG_SQL_TYPE = "sqlType"; /** @@ -302,7 +303,7 @@ * @since 2.5 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Sets the fully qualified name of the DAO implementation to use in generated DAO (default is DAOImpl (base on TopiaQuery))") + documentation = "Sets the fully qualified name of the DAO implementation to use in generated DAO (default is DAOImpl (base on TopiaQuery))") String TAG_DAO_IMPLEMENTATION = "daoImplementation"; /** @@ -312,7 +313,8 @@ * @since 2.6.5 */ @TagValueDefinition(target = {ObjectModel.class, ObjectModelAttribute.class}, - documentation = "Specifies if an nm-multiplicity attribute (or all nm-multiplicity attributes of a given model) needs an index in db (Hibernate mapping)") + defaultValue = "true", + documentation = "Specifies if an nm-multiplicity attribute (or all nm-multiplicity attributes of a given model) needs an index in db (Hibernate mapping)") String TAG_INDEX_FOREIGN_KEYS = "indexForeignKeys"; /** @@ -323,9 +325,11 @@ * @see EntityDTOTransformer * @see TopiaGeneratorUtil#shouldGenerateDTOTopiaIdTagValue(ObjectModelClassifier, ObjectModel) * @since 2.6.7 + * @deprecated since 3.0, will be removed at the same time that {@link EntityDTOTransformer}. */ + @Deprecated @TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class}, - documentation = "Add a \"id\" property with its getter/setter on a DTO.") + documentation = "Add a \"id\" property with its getter/setter on a DTO.") String TAG_GENERATE_TOPIA_ID_IN_DTO = "generateDTOTopiaId"; @@ -341,7 +345,7 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Change the super class to use when generating PersistenceContext.") + documentation = "Change the super class to use when generating PersistenceContext.") String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass"; /** @@ -356,7 +360,7 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModel.class}, - documentation = "Change the super class to use when generating ApplicationContext.") + documentation = "Change the super class to use when generating ApplicationContext.") String TAG_APPLICATION_CONTEXT_SUPER_CLASS = "applicationContextSuperClass"; /** @@ -369,7 +373,7 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class}, - documentation = "Change the super class to use when generating dao.") + documentation = "Change the super class to use when generating dao.") String TAG_DAO_SUPER_CLASS = "daoSuperClass"; /** @@ -382,24 +386,24 @@ * @since 3.0 */ @TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class}, - documentation = "Change the super class to use when generating Entity.") + documentation = "Change the super class to use when generating Entity.") String TAG_ENTITY_SUPER_CLASS = "entitySuperClass"; /** * Tag to change the type of an attribute in a hibernate mapping. - * + * <p/> * This is a special tagValue that is dynamic. - * + * <p/> * For example to change the type {@code String} into hibernate mapping type {@code text}, add this: * <pre> * model.tagValue.hibernateAttributeType.String=text * </pre> - * + * <p/> * Before 3.0, you could do the same thing using: * <pre> * model.tagValue.String=text * </pre> - * + * <p/> * The new way permits us to validate the usage of the tagValue, old way can't. * * @see TopiaGeneratorUtil#getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModel) @@ -407,7 +411,7 @@ */ @TagValueDefinition(target = {ObjectModelAttribute.class, ObjectModelClassifier.class, ObjectModel.class}, documentation = "Change the super class to use when generating Entity.", - validatorClass = PrefixTagNameMatchTagValueMatcher.class) + matcherClass = PrefixTagNameMatchTagValueMatcher.class) String TAG_HIBERNATE_ATTRIBUTE_TYPE = "hibernateAttributeType"; }