branch feature/3761 updated (1e0cb5c -> 49fd7a2)
This is an automated email from the git hooks/post-receive script. New change to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git discards 1e0cb5c Use package while seeking for dbschema tag value (See #3766) discards b0074ca Add attributeType tag value (See #3765) discards 6215bcc passage sur nuitonpom 3 + mise à jour de l'url du projet discards 13c309e Override toString() in JdbcConfiguration and TopiaConfiguration discards 8c87c65 Add TopiaApplicationContext isOpened() as shortcut to ! closed discards aa80e3b add shortcuts methods to declare services without configuration discards d2ba7e2 Can not use hibernateAttributeType (closes #3763) discards 5fcbc41 Fix site generation (fixes #3741) discards 34fc0f7 [jgitflow-maven-plugin]Updating develop poms back to pre merge state discards ea0f97b [jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts discards d4f05cc [jgitflow-maven-plugin]updating poms for branch'release/3.0' with non-snapshot versions discards 7e41235 [jgitflow-maven-plugin]updating poms for 3.1-SNAPSHOT development discards 441e186 Use pom 2.4.1 discards 6a7e1bb Fix a tagValue in topia-it, the package was not coherent with the model discards ed8442f 'generateDTOTopiaId' tagvalue no longer exists discards 53d6a74 A bug in Eugene make 'tagValue' invalid, use 'tagvalue' instead discards b5fda51 Set eugeneVersion to 3.0-SNAPSHOT adds 61ff770 Use pom 2.4.1 adds ba64ea2 [jgitflow-maven-plugin]updating poms for 3.1-SNAPSHOT development adds 1881c87 [jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts adds 02e3d4f [jgitflow-maven-plugin]updating poms for branch'release/3.0' with non-snapshot versions adds 6e5746d [jgitflow-maven-plugin]merging 'release/3.0' into 'master' adds 3306392 [jgitflow-maven-plugin]merging 'master' into 'develop' adds eebab4b [jgitflow-maven-plugin]Updating develop poms back to pre merge state adds 3de2446 Fix site generation (fixes #3741) adds 851b2a7 Can not use hibernateAttributeType (closes #3763) adds 884cb81 add shortcuts methods to declare services without configuration adds d124359 Add TopiaApplicationContext isOpened() as shortcut to ! closed adds 6c21935 Override toString() in JdbcConfiguration and TopiaConfiguration adds b108556 Use package while seeking for dbschema tag value (See #3766) adds c1112cb Db schema name is not generated if tag value is set on a package close #3766 Merge branch 'feature/3766' into develop new ab398b9 Set eugeneVersion to 3.0-SNAPSHOT new 4619d54 A bug in Eugene make 'tagValue' invalid, use 'tagvalue' instead new 97033ea 'generateDTOTopiaId' tagvalue no longer exists new 06e4384 Fix a tagValue in topia-it, the package was not coherent with the model new 60ebdcb [jgitflow-maven-plugin]updating poms for branch'release/3.0' with non-snapshot versions new 70e3741 passage sur nuitonpom 3 + mise à jour de l'url du projet new 49fd7a2 Add attributeType tag value (See #3765) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (1e0cb5c) \ N -- N -- N refs/heads/feature/3761 (49fd7a2) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 7 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 49fd7a25ca89eb57d536a1b57c70c30a47613b6a Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 22 20:59:29 2015 +0200 Add attributeType tag value (See #3765) commit 70e37412a2743849072e12ae3c05049f43d90973 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Aug 21 19:18:25 2015 +0200 passage sur nuitonpom 3 + mise à jour de l'url du projet commit 60ebdcbfc3042c1e1df3f84f99788f09f3d2cae6 Author: Maven Release <maven-release@codelutin.com> Date: Fri Jul 31 17:28:34 2015 +0200 [jgitflow-maven-plugin]updating poms for branch'release/3.0' with non-snapshot versions commit 06e43841082e396ee371cb1c9eb472116ff860f7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 16:06:17 2015 +0200 Fix a tagValue in topia-it, the package was not coherent with the model commit 97033eaa9af12f024d08de20942b7369bba48ac7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 15:56:22 2015 +0200 'generateDTOTopiaId' tagvalue no longer exists commit 4619d54257baccbc372c3bd1a5fd0d12ea2dc2db Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 15:51:18 2015 +0200 A bug in Eugene make 'tagValue' invalid, use 'tagvalue' instead commit ab398b91a2baefffe6aa1ca2ba16fe6cb1488a20 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 14:48:32 2015 +0200 Set eugeneVersion to 3.0-SNAPSHOT Summary of changes: -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit ab398b91a2baefffe6aa1ca2ba16fe6cb1488a20 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 14:48:32 2015 +0200 Set eugeneVersion to 3.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3da0b46..6b84185 100644 --- a/pom.xml +++ b/pom.xml @@ -234,7 +234,7 @@ <!-- libs version --> <commonsLoggingVersion>1.2</commonsLoggingVersion> - <eugeneVersion>2.13</eugeneVersion> + <eugeneVersion>3.0-SNAPSHOT</eugeneVersion> <flywayVersion>3.1</flywayVersion> <guavaVersion>18.0</guavaVersion> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 4619d54257baccbc372c3bd1a5fd0d12ea2dc2db Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 15:51:18 2015 +0200 A bug in Eugene make 'tagValue' invalid, use 'tagvalue' instead --- topia-it/src/main/xmi/topia-it-legacy.properties | 8 ++++---- topia-it/src/main/xmi/topia-it-mapping.properties | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/topia-it/src/main/xmi/topia-it-legacy.properties b/topia-it/src/main/xmi/topia-it-legacy.properties index 8861673..4c9a5d8 100644 --- a/topia-it/src/main/xmi/topia-it-legacy.properties +++ b/topia-it/src/main/xmi/topia-it-legacy.properties @@ -25,10 +25,10 @@ model.tagvalue.i18n=topia.test.common. model.tagvalue.generateOperatorForDAOHelper=true model.tagvalue.constantPrefix=PROPERTY_ model.tagvalue.generateDTOTopiaId=true -model.tagValue.applicationContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyApplicationContext -model.tagValue.persistenceContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyPersistenceContext -model.tagValue.daoSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyDao -model.tagValue.entitySuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyEntity +model.tagvalue.applicationContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyApplicationContext +model.tagvalue.persistenceContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyPersistenceContext +model.tagvalue.daoSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyDao +model.tagvalue.entitySuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyEntity model.tagvalue.generatePropertyChangeSupport=true #org.nuiton.topia.it.legacy.topiatest.Company.class.tagvalue.naturalIdMutable=false diff --git a/topia-it/src/main/xmi/topia-it-mapping.properties b/topia-it/src/main/xmi/topia-it-mapping.properties index f63cc45..c413fd8 100644 --- a/topia-it/src/main/xmi/topia-it-mapping.properties +++ b/topia-it/src/main/xmi/topia-it-mapping.properties @@ -32,15 +32,15 @@ model.tagvalue.hibernateAttributeType.java.lang.String=java.lang.String org.nuiton.topia.it.mapping.test15.A15A.attribute.aFloat.tagvalue.hibernateAttributeType=double org.nuiton.topia.it.mapping.test15.A15A.attribute.aFloatWrapper.tagvalue.hibernateAttributeType=double -org.nuiton.topia.it.mapping.test17.A17.class.tagValue.dbSchema=A -org.nuiton.topia.it.mapping.test17.A17.class.tagValue.dbName=A -org.nuiton.topia.it.mapping.test17.A17.attribute.a.tagValue.dbName=aa +org.nuiton.topia.it.mapping.test17.A17.class.tagvalue.dbSchema=A +org.nuiton.topia.it.mapping.test17.A17.class.tagvalue.dbName=A +org.nuiton.topia.it.mapping.test17.A17.attribute.a.tagvalue.dbName=aa -org.nuiton.topia.it.mapping.test17.B17.class.tagValue.dbSchema=B -org.nuiton.topia.it.mapping.test17.B17.class.tagValue.dbName=B +org.nuiton.topia.it.mapping.test17.B17.class.tagvalue.dbSchema=B +org.nuiton.topia.it.mapping.test17.B17.class.tagvalue.dbName=B -org.nuiton.topia.it.mapping.test17.BB17.class.tagValue.dbSchema=B -org.nuiton.topia.it.mapping.test17.BB17.attribute.bb.tagValue.dbName=cc +org.nuiton.topia.it.mapping.test17.BB17.class.tagvalue.dbSchema=B +org.nuiton.topia.it.mapping.test17.BB17.attribute.bb.tagvalue.dbName=cc package.org.nuiton.topia.it.mapping.test18.stereotype=entity package.org.nuiton.topia.it.mapping.test18.tagvalue.constantPrefix=PROPERTY2_ -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 97033eaa9af12f024d08de20942b7369bba48ac7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 15:56:22 2015 +0200 'generateDTOTopiaId' tagvalue no longer exists --- topia-it/src/main/xmi/topia-it-legacy.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/topia-it/src/main/xmi/topia-it-legacy.properties b/topia-it/src/main/xmi/topia-it-legacy.properties index 4c9a5d8..89d99a1 100644 --- a/topia-it/src/main/xmi/topia-it-legacy.properties +++ b/topia-it/src/main/xmi/topia-it-legacy.properties @@ -24,7 +24,6 @@ model.tagvalue.i18n=topia.test.common. model.tagvalue.generateOperatorForDAOHelper=true model.tagvalue.constantPrefix=PROPERTY_ -model.tagvalue.generateDTOTopiaId=true model.tagvalue.applicationContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyApplicationContext model.tagvalue.persistenceContextSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyPersistenceContext model.tagvalue.daoSuperClass=org.nuiton.topia.it.legacy.AbstractTopiaItLegacyDao -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 06e43841082e396ee371cb1c9eb472116ff860f7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Aug 21 16:06:17 2015 +0200 Fix a tagValue in topia-it, the package was not coherent with the model --- topia-it/src/main/xmi/topia-it-legacy.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topia-it/src/main/xmi/topia-it-legacy.properties b/topia-it/src/main/xmi/topia-it-legacy.properties index 89d99a1..589f29f 100644 --- a/topia-it/src/main/xmi/topia-it-legacy.properties +++ b/topia-it/src/main/xmi/topia-it-legacy.properties @@ -39,4 +39,4 @@ org.nuiton.topia.it.legacy.topiatest.NaturalizedEntity.attribute.naturalIdNotNul org.nuiton.topia.it.legacy.topiatest.NaturalizedEntity.attribute.naturalIdNull.tagvalue.naturalId=true org.nuiton.topia.it.legacy.topiatest.NaturalizedEntity.attribute.naturalIdNull.tagvalue.notNull=false -org.nuiton.topia.it.legacy.test.entities.Personne.attribute.otherGender.tagvalue.useEnumerationName=true +org.nuiton.topia.it.legacy.topiatest.Personne.attribute.otherGender.tagvalue.useEnumerationName=true -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 60ebdcbfc3042c1e1df3f84f99788f09f3d2cae6 Author: Maven Release <maven-release@codelutin.com> Date: Fri Jul 31 17:28:34 2015 +0200 [jgitflow-maven-plugin]updating poms for branch'release/3.0' with non-snapshot versions --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6b84185..3da0b46 100644 --- a/pom.xml +++ b/pom.xml @@ -234,7 +234,7 @@ <!-- libs version --> <commonsLoggingVersion>1.2</commonsLoggingVersion> - <eugeneVersion>3.0-SNAPSHOT</eugeneVersion> + <eugeneVersion>2.13</eugeneVersion> <flywayVersion>3.1</flywayVersion> <guavaVersion>18.0</guavaVersion> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 70e37412a2743849072e12ae3c05049f43d90973 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Aug 21 19:18:25 2015 +0200 passage sur nuitonpom 3 + mise à jour de l'url du projet --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3da0b46..a647ed6 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>nuitonpom</artifactId> - <version>2.4.1</version> + <version>3</version> </parent> <artifactId>topia</artifactId> @@ -41,7 +41,7 @@ Tools for Portable and Independent Architecture : Framework de persistance et de distribution d'application. </description> - <url>https://doc.nuiton.org/topia</url> + <url>https://topia.nuiton.org</url> <inceptionYear>2004</inceptionYear> <developers> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3761 in repository topia. See http://git.nuiton.org/topia.git commit 49fd7a25ca89eb57d536a1b57c70c30a47613b6a Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 22 20:59:29 2015 +0200 Add attributeType tag value (See #3765) --- .../templates/EntityHibernateMappingGenerator.java | 81 ++++++------ .../nuiton/topia/templates/EntityTransformer.java | 140 +++++++++++---------- .../org/nuiton/topia/templates/TopiaTagValues.java | 41 +++++- 3 files changed, 156 insertions(+), 106 deletions(-) diff --git a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java index 9861cf4..9a37a83 100644 --- a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java +++ b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java @@ -405,49 +405,56 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { type = attrType; } else { - // old code - attrType = topiaTagValues.getTypeTagValue(attr); + attrType = topiaTagValues.getAttributeType(attr, clazz, aPackage, model); if (StringUtils.isNotEmpty(attrType)) { - // tag value detected of the attribute - if (log.isWarnEnabled()) { - String deprecatedTagName = clazz.getQualifiedName() + ".attribute." + - attr.getName() + ".tagValue." + topiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + - "." + type; - String tagName = clazz.getQualifiedName() + ".attribute." + - attr.getName() + ".tagValue." + topiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + - "." + type; - log.warn("---------"); - log.warn("You are using a deprecated tagValue (" + deprecatedTagName + "), replace it by"); - log.warn(tagName + "=" + attrType); - } type = attrType; - } else { + } else{ + + // old code + attrType = topiaTagValues.getTypeTagValue(attr); + if (StringUtils.isNotEmpty(attrType)) { + + // tag value detected of the attribute + if (log.isWarnEnabled()) { + String deprecatedTagName = clazz.getQualifiedName() + ".attribute." + + attr.getName() + ".tagValue." + TopiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + + "." + type; + String tagName = clazz.getQualifiedName() + ".attribute." + + attr.getName() + ".tagValue." + TopiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + + "." + type; + log.warn("---------"); + log.warn("You are using a deprecated tagValue (" + deprecatedTagName + "), replace it by"); + log.warn(tagName + "=" + attrType); + } + type = attrType; + } else { - String modelType = model.getTagValue(type); - if (StringUtils.isNotEmpty(modelType)) { - - // tag value detected of the model - String deprecatedTagName = "model.tagValue." + type; - String tagName = "model.tagValue." + topiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + - "." + type; - log.warn("---------"); - log.warn("You are using a deprecated tagValue ("+deprecatedTagName+"), replace it by"); - log.warn(tagName + "=" + modelType); - //TODO tchemit 20100507 Explain What todes it do ? Dont understand the story of columnNamesMap - int bracketIndex = modelType.indexOf('('); - if (bracketIndex != -1) { - type = modelType.substring(0, bracketIndex); - int bracketEndIndex = modelType.indexOf(')', bracketIndex + 1); - String colmunList; - if (bracketEndIndex != -1) { - colmunList = modelType.substring(bracketIndex + 1, bracketEndIndex); + String modelType = model.getTagValue(type); + if (StringUtils.isNotEmpty(modelType)) { + + // tag value detected of the model + String deprecatedTagName = "model.tagValue." + type; + String tagName = "model.tagValue." + topiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + + "." + type; + log.warn("---------"); + log.warn("You are using a deprecated tagValue ("+deprecatedTagName+"), replace it by"); + log.warn(tagName + "=" + modelType); + //TODO tchemit 20100507 Explain What todes it do ? Dont understand the story of columnNamesMap + int bracketIndex = modelType.indexOf('('); + if (bracketIndex != -1) { + type = modelType.substring(0, bracketIndex); + int bracketEndIndex = modelType.indexOf(')', bracketIndex + 1); + String colmunList; + if (bracketEndIndex != -1) { + colmunList = modelType.substring(bracketIndex + 1, bracketEndIndex); + } else { + colmunList = modelType.substring(bracketIndex); + } + columnNamesMap.put(type, colmunList.split(",")); } else { - colmunList = modelType.substring(bracketIndex); + type = modelType; } - columnNamesMap.put(type, colmunList.split(",")); - } else { - type = modelType; } } } diff --git a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java index 9d2b452..f35c7e4 100644 --- a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java +++ b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java @@ -187,7 +187,7 @@ public class EntityTransformer extends ObjectModelTransformerToJava { createAcceptInternalOperation(input); // Add constant, attribute and operations for each property - generateProperties(input.getAttributes()); + generateProperties(input.getAttributes(), input, aPackage); // Case of association class : properties from participants/extremities // of the association class. @@ -195,7 +195,7 @@ public class EntityTransformer extends ObjectModelTransformerToJava { ObjectModelAssociationClass association = (ObjectModelAssociationClass)input; associationClass = true; - generateProperties(association.getParticipantsAttributes()); + generateProperties(association.getParticipantsAttributes(), input, aPackage); associationClass = false; } @@ -581,10 +581,11 @@ public class EntityTransformer extends ObjectModelTransformerToJava { /** * Generate properties from {@code attributes}. Generate * constant, attribute and operations for each property. - * - * @param attributes Input attributes + * @param attributes Input attributes + * @param aClass + * @param aPackage */ - protected void generateProperties(Collection<ObjectModelAttribute> attributes) { + protected void generateProperties(Collection<ObjectModelAttribute> attributes, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { for (ObjectModelAttribute attribute : attributes) { if (!associationClass) { @@ -593,9 +594,9 @@ public class EntityTransformer extends ObjectModelTransformerToJava { if (!attribute.isNavigable() && attribute.hasAssociationClass()) { generatePropertyConstant(attribute); - generatePropertyAttribute(attribute); + generatePropertyAttribute(attribute, aClass, aPackage); - updateAcceptOperation(attribute); + updateAcceptOperation(attribute, aClass, aPackage); } if (!attribute.isNavigable() && @@ -609,13 +610,13 @@ public class EntityTransformer extends ObjectModelTransformerToJava { generatePropertyConstant(attribute); // attribute - generatePropertyAttribute(attribute); + generatePropertyAttribute(attribute, aClass, aPackage); // operations - generatePropertyOperations(attribute); + generatePropertyOperations(attribute, aClass, aPackage); // update accept body - updateAcceptOperation(attribute); + updateAcceptOperation(attribute, aClass, aPackage); } } @@ -640,10 +641,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { "\"" + attrName + "\""); } - protected void generatePropertyAttribute(ObjectModelAttribute attribute) { + protected void generatePropertyAttribute(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); String collectionType = getCollectionType(attribute); if (collectionType != null) { @@ -689,31 +690,33 @@ public class EntityTransformer extends ObjectModelTransformerToJava { * method (association class, reverse, entity reference, ...). * * @param attribute Input attribute to treate + * @param aClass Input class + * @param aPackage Input package * @see #addSingleGetOperation(ObjectModelAttribute, String, String) - * @see #addSingleSetOperation(ObjectModelAttribute) - * @see #addMultipleAddOperation(ObjectModelAttribute, String) - * @see #addMultipleAddAllOperation(ObjectModelAttribute) - * @see #addMultipleSetOperation(ObjectModelAttribute, String, String) - * @see #addMultipleRemoveOperation(ObjectModelAttribute) - * @see #addMultipleClearOperation(ObjectModelAttribute, String, String) - * @see #addMultipleGetOperation(ObjectModelAttribute, String) - * @see #addMultipleGetByTopiaIdOperation(ObjectModelAttribute) - * @see #addMultipleGetOperationFromEntity(ObjectModelAttribute) + * @see #addSingleSetOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage) + * @see #addMultipleAddOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, String) + * @see #addMultipleAddAllOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage) + * @see #addMultipleSetOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, String, String) + * @see #addMultipleRemoveOperation(ObjectModelAttribute,ObjectModelClassifier, ObjectModelPackage) + * @see #addMultipleClearOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, String, String) + * @see #addMultipleGetOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, String) + * @see #addMultipleGetByTopiaIdOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage) + * @see #addMultipleGetOperationFromEntity(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage) * @see #addMultipleSizeOperation(ObjectModelAttribute) * @see #addMultipleIsEmptyOperations(ObjectModelAttribute) - * @see #addMultipleGetByIndexOperation(ObjectModelAttribute) + * @see #addMultipleGetByIndexOperation(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage) */ - protected void generatePropertyOperations(ObjectModelAttribute attribute) { + protected void generatePropertyOperations(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { if (attribute.getMaxMultiplicity() == 1 || associationClass) { // setXXX - addSingleSetOperation(attribute); + addSingleSetOperation(attribute, aClass, aPackage); boolean booleanProperty = GeneratorUtil.isBooleanPrimitive(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (booleanProperty) { @@ -755,49 +758,49 @@ public class EntityTransformer extends ObjectModelTransformerToJava { boolean entity = templateHelper.isEntity(attribute, model); // addXXX - addMultipleAddOperation(attribute, collectionImpl); + addMultipleAddOperation(attribute, aClass, aPackage, collectionImpl); if (ordered && !unique) { // addXXX(index) - addMultipleAddAtIndexOperation(attribute, collectionImpl); + addMultipleAddAtIndexOperation(attribute, aClass, aPackage, collectionImpl); } // addAllXXX - addMultipleAddAllOperation(attribute); + addMultipleAddAllOperation(attribute, aClass, aPackage); // setXXX - addMultipleSetOperation(attribute, collectionInterface, collectionImpl); + addMultipleSetOperation(attribute, aClass, aPackage, collectionInterface, collectionImpl); // removeXXX - addMultipleRemoveOperation(attribute); + addMultipleRemoveOperation(attribute, aClass, aPackage); if (ordered && !unique) { // removeXXX(index) - addMultipleRemoveAtIndexOperation(attribute); + addMultipleRemoveAtIndexOperation(attribute, aClass, aPackage); } // clearXXX - addMultipleClearOperation(attribute, collectionInterface, collectionImpl); + addMultipleClearOperation(attribute, aClass, aPackage, collectionInterface, collectionImpl); // getXXX - addMultipleGetOperation(attribute, collectionInterface); + addMultipleGetOperation(attribute, aClass, aPackage, collectionInterface); if (ordered) { // getXXX(index) - addMultipleGetByIndexOperation(attribute); + addMultipleGetByIndexOperation(attribute, aClass, aPackage); } if (entity) { // getXXXByTopiaId - addMultipleGetByTopiaIdOperation(attribute); + addMultipleGetByTopiaIdOperation(attribute, aClass, aPackage); // getXXXTopiaIds - addMultipleGetTopiaIdsOperation(attribute, collectionInterface, collectionImpl); + addMultipleGetTopiaIdsOperation(attribute, aClass, aPackage, collectionInterface, collectionImpl); } @@ -808,14 +811,14 @@ public class EntityTransformer extends ObjectModelTransformerToJava { addMultipleIsEmptyOperations(attribute); // containsXXX - addMultipleContainsOperation(attribute); + addMultipleContainsOperation(attribute, aClass, aPackage); } } - protected void addSingleSetOperation(ObjectModelAttribute attribute) { + protected void addSingleSetOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate single 'set' operation for property : " + attrName + @@ -929,11 +932,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { setOperationBody(implOperation, body.toString()); } - protected void addMultipleAddOperation(ObjectModelAttribute attribute, - String collectionImpl) { + protected void addMultipleAddOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionImpl) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); ObjectModelAttribute reverse = attribute.getReverseAttribute(); if (log.isDebugEnabled()) { @@ -1013,11 +1015,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { setOperationBody(implOperation, body.toString()); } - protected void addMultipleAddAtIndexOperation(ObjectModelAttribute attribute, - String collectionImpl) { + protected void addMultipleAddAtIndexOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionImpl) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); ObjectModelAttribute reverse = attribute.getReverseAttribute(); if (log.isDebugEnabled()) { @@ -1098,10 +1099,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { setOperationBody(implOperation, body.toString()); } - protected void addMultipleAddAllOperation(ObjectModelAttribute attribute) { + protected void addMultipleAddAllOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate multiple 'addAll' operation for property : " + attrName + @@ -1134,11 +1135,12 @@ public class EntityTransformer extends ObjectModelTransformerToJava { } protected void addMultipleSetOperation(ObjectModelAttribute attribute, + ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionInterface, String collectionImpl) { String attrName = getPropertyName(attribute); - String referenceType = getPropertyType(attribute); + String referenceType = getPropertyType(attribute, aClass, aPackage); String attrType = collectionInterface + "<" + referenceType + ">"; String constantName = getConstantName(attrName); @@ -1187,10 +1189,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { } - protected void addMultipleRemoveOperation(ObjectModelAttribute attribute) { + protected void addMultipleRemoveOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); ObjectModelAttribute reverse = attribute.getReverseAttribute(); String constantName = getConstantName(attrName); @@ -1257,10 +1259,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { setOperationBody(implOperation, body.toString()); } - protected void addMultipleRemoveAtIndexOperation(ObjectModelAttribute attribute) { + protected void addMultipleRemoveAtIndexOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); ObjectModelAttribute reverse = attribute.getReverseAttribute(); String constantName = getConstantName(attrName); @@ -1331,11 +1333,12 @@ public class EntityTransformer extends ObjectModelTransformerToJava { } protected void addMultipleClearOperation(ObjectModelAttribute attribute, + ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionInterface, String collectionImpl) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); ObjectModelAttribute reverse = attribute.getReverseAttribute(); String constantName = getConstantName(attrName); @@ -1416,10 +1419,11 @@ public class EntityTransformer extends ObjectModelTransformerToJava { } protected void addMultipleGetOperation(ObjectModelAttribute attribute, + ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionInterface) { String attrName = getPropertyName(attribute); - String attrType = collectionInterface + "<" + getPropertyType(attribute) + ">"; + String attrType = collectionInterface + "<" + getPropertyType(attribute, aClass, aPackage) + ">"; if (log.isDebugEnabled()) { log.debug("Generate multiple 'get' operation for property : " + attrName + @@ -1441,10 +1445,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { ); } - protected void addMultipleGetByIndexOperation(ObjectModelAttribute attribute) { + protected void addMultipleGetByIndexOperation(ObjectModelAttribute attribute,ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate multiple 'getByTopiaId' operation for property : " + attrName + @@ -1470,10 +1474,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { }*/ ); } - protected void addMultipleGetByTopiaIdOperation(ObjectModelAttribute attribute) { + protected void addMultipleGetByTopiaIdOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate multiple 'getByTopiaId' operation for property : " + attrName + @@ -1500,10 +1504,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { ); } - protected void addMultipleGetTopiaIdsOperation(ObjectModelAttribute attribute, String collectionInterface, String collectionImpl) { + protected void addMultipleGetTopiaIdsOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage, String collectionInterface, String collectionImpl) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); String getterName = getJavaBeanMethodName("get" , attrName); @@ -1536,7 +1540,7 @@ public class EntityTransformer extends ObjectModelTransformerToJava { ); } - protected void addMultipleGetOperationFromEntity(ObjectModelAttribute attribute) { + protected void addMultipleGetOperationFromEntity(ObjectModelAttribute attribute,ObjectModelClassifier aClass, ObjectModelPackage aPackage) { // reference to the real attribute name String referenceName = attribute.getName(); @@ -1545,7 +1549,7 @@ public class EntityTransformer extends ObjectModelTransformerToJava { String referenceGetterName = getJavaBeanMethodName("get", referenceName); // association attribute name String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate multiple 'getFromEntity' operation for property : " + attrName + @@ -1648,10 +1652,10 @@ public class EntityTransformer extends ObjectModelTransformerToJava { ); } - protected void addMultipleContainsOperation(ObjectModelAttribute attribute) { + protected void addMultipleContainsOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = getPropertyName(attribute); - String attrType = getPropertyType(attribute); + String attrType = getPropertyType(attribute, aClass, aPackage); if (log.isDebugEnabled()) { log.debug("Generate multiple 'contains' operation for property : " + attrName); @@ -1728,11 +1732,11 @@ public class EntityTransformer extends ObjectModelTransformerToJava { } } - protected void updateAcceptOperation(ObjectModelAttribute attribute) { + protected void updateAcceptOperation(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { String attrName = GeneratorUtil.getSimpleName(getPropertyName(attribute)); String attrType = - GeneratorUtil.getSimpleName(getPropertyType(attribute)); + GeneratorUtil.getSimpleName(getPropertyType(attribute, aClass, aPackage)); // remove custom generics http://nuiton.org/issues/3453 attrType = GeneratorUtil.removeAnyGenericDefinition(attrType); String collectionType = getCollectionType(attribute); @@ -1864,8 +1868,8 @@ public class EntityTransformer extends ObjectModelTransformerToJava { return propertyName; } - protected String getPropertyType(ObjectModelAttribute attribute) { - String propertyType = attribute.getType(); + protected String getPropertyType(ObjectModelAttribute attribute, ObjectModelClassifier aClass, ObjectModelPackage aPackage) { + String propertyType = topiaTagValues.getAttributeType(attribute, aClass, aPackage ,model); if (!associationClass && attribute.hasAssociationClass()) { propertyType = attribute.getAssociationClass().getQualifiedName(); } diff --git a/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java b/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java index 09307fa..eda2348 100644 --- a/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java +++ b/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java @@ -434,6 +434,30 @@ public class TopiaTagValues extends TagValueDefinitionProvider { public static final String TAG_HIBERNATE_ATTRIBUTE_TYPE = "hibernateAttributeType"; /** + * Tag to change the type of an attribute. + * <p/> + * This is a special tagValue that is dynamic. + * <p/> + * For example to change the type {@code String} into type {@code java.lang.String}, add this: + * <pre> + * model.tagValue.attributeType.String=java.lang.String + * </pre> + * <p/> + * Before 3.0, you could do the same thing using: + * <pre> + * model.tagValue.String=java.lang.String + * </pre> + * <p/> + * The new way permits us to validate the usage of the tagValue, old way can't. + * + * @see #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, ObjectModel) + * @since 3.0 + */ + @TagValueDefinition(target = {ObjectModelAttribute.class, ObjectModelPackage.class, ObjectModelClassifier.class, ObjectModel.class}, + documentation = "Change an attribute type.", + matcherClass = StartsWithTagNameMatcher.class) + public static final String TAG_ATTRIBUTE_TYPE = "attributeType"; + /** * Tag to specify if PropertyChangeListener support should be generated * * @see #isGeneratePropertyChangeSupport(ObjectModelAttribute, ObjectModel) @@ -743,6 +767,21 @@ public class TopiaTagValues extends TagValueDefinitionProvider { } /** + * Obtain the value of the {@link #TAG_ATTRIBUTE_TYPE} tag value on the given attribute, classifier or model. + * + * @param attribute attribute to seek + * @return the none empty value of the found tag value or {@code null} if not found nor empty. + * @see #TAG_ATTRIBUTE_TYPE + * @since 3.0.1 + */ + public String getAttributeType(ObjectModelAttribute attribute, ObjectModelClassifier classifier, ObjectModelPackage aPackage, ObjectModel model) { + + String tagValueName = TAG_ATTRIBUTE_TYPE + "." + attribute.getType(); + String value = TagValues.findTagValue(tagValueName, attribute.getType(), attribute, classifier, aPackage, model); + return value; + } + + /** * Obtain the value of the {@link #TAG_SQL_TYPE} tag value on the given attribute. * * @param attribute attribute to seek @@ -879,7 +918,7 @@ public class TopiaTagValues extends TagValueDefinitionProvider { * @return the none empty value of the found tag value or {@code null} if not found nor empty. * @see #TAG_TYPE * @since 2.5 - * @deprecated since 3.0, use now {@link #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, ObjectModel)} + * @deprecated since 3.0, use now {@link #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, ObjectModel)} or {@link #getAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModelPackage, ObjectModel)} */ @Deprecated public String getTypeTagValue(ObjectModelAttribute attribute) { -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm