branch develop updated (450d0dd -> 02ce2c3)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository topia. See http://git.nuiton.org/topia.git from 450d0dd [jgitflow-maven-plugin]Updating develop poms back to pre merge state new fe892c7 introduction du nouveau stéréotype IndexedCollection (refs #3694) new 02ce2c3 fixes #3694: Introduction du stéréotype IndexedCollection dans Topia Merge branch 'feature/3694' into develop The 2 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 02ce2c373ab8a727918a54c849f42f8540694b59 Merge: 450d0dd fe892c7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun May 24 12:46:50 2015 +0200 fixes #3694: Introduction du stéréotype IndexedCollection dans Topia Merge branch 'feature/3694' into develop commit fe892c71f63245769cc64461bf832700d5f9b359 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun May 24 12:45:34 2015 +0200 introduction du nouveau stéréotype IndexedCollection (refs #3694) Summary of changes: .../generator/EntityHibernateMappingGenerator.java | 10 ++-- .../nuiton/topia/generator/TopiaGeneratorUtil.java | 61 ++++++---------------- .../nuiton/topia/generator/TopiaStereoTypes.java | 10 ++++ 3 files changed, 30 insertions(+), 51 deletions(-) -- 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 develop in repository topia. See http://git.nuiton.org/topia.git commit fe892c71f63245769cc64461bf832700d5f9b359 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun May 24 12:45:34 2015 +0200 introduction du nouveau stéréotype IndexedCollection (refs #3694) --- .../generator/EntityHibernateMappingGenerator.java | 10 ++-- .../nuiton/topia/generator/TopiaGeneratorUtil.java | 61 ++++++---------------- .../nuiton/topia/generator/TopiaStereoTypes.java | 10 ++++ 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityHibernateMappingGenerator.java b/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityHibernateMappingGenerator.java index 52e7cd1..cd35e1f 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityHibernateMappingGenerator.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityHibernateMappingGenerator.java @@ -486,7 +486,7 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_SCHEMA, classContext.getSchema()); } - if (TopiaGeneratorUtil.hasIndexedStereotype(attr)) { + if (TopiaGeneratorUtil.hasIndexedCollectionStereotype(attr)) { String indexName = tableName + "_idx"; optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_INDEX, indexName); } @@ -502,7 +502,7 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { }*/ } else { String optionalAttributes = ""; - if (TopiaGeneratorUtil.hasIndexedStereotype(attr)) { + if (TopiaGeneratorUtil.hasIndexedCollectionStereotype(attr)) { String indexName = tableName + "_idx"; optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_INDEX, indexName); // optionalAttributes += "index=\"" + indexName + "\""; @@ -639,7 +639,7 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { ClassContext classContext, ObjectModelAttribute attr, String prefix) throws IOException { - boolean needsIndex = TopiaGeneratorUtil.hasIndexedStereotype(attr); + boolean needsIndex = TopiaGeneratorUtil.hasIndexedCollectionStereotype(attr); boolean isInverse = attr.getReverseAttribute().isNavigable(); isInverse |= hasUnidirectionalRelationOnAbstractType(attr, model); @@ -717,7 +717,7 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { ClassContext classContext, ObjectModelAttribute attr, String prefix) throws IOException { - boolean needsIndex = TopiaGeneratorUtil.hasIndexedStereotype(attr); + boolean needsIndex = TopiaGeneratorUtil.hasIndexedCollectionStereotype(attr); String attrName = getName(attr); String attrType = getType(attr); String collType = TopiaGeneratorUtil.getNMultiplicityHibernateType(attr); @@ -808,7 +808,7 @@ public class EntityHibernateMappingGenerator extends ObjectModelGenerator { isInverse &= TopiaGeneratorUtil.isFirstAttribute(attr); } - boolean needsIndex = TopiaGeneratorUtil.hasIndexedStereotype(attr); + boolean needsIndex = TopiaGeneratorUtil.hasIndexedCollectionStereotype(attr); String cascade = ""; if (attr.isComposite() || attr.hasAssociationClass()) { cascade = " cascade=\"delete,delete-orphan\""; diff --git a/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaGeneratorUtil.java b/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaGeneratorUtil.java index fed5160..b09347c 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaGeneratorUtil.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaGeneratorUtil.java @@ -29,7 +29,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.eugene.AbstractGenerator; -import org.nuiton.eugene.EugeneStereoTypes; import org.nuiton.eugene.GeneratorUtil; import org.nuiton.eugene.java.JavaGeneratorUtil; import org.nuiton.eugene.models.Model; @@ -294,42 +293,6 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { } /** - * Cherche et renvoie le prefixe i18n à utiliser sur cet element, sinon sur - * le model. - * - * @param element l'élément à tester - * @param model le modele utilisé - * @return le prefix i18n ou <code>null</code> si non spécifié - * @deprecated since 2.5, prefer use the {@link JavaGeneratorUtil#getI18nPrefixTagValue(ObjectModelElement, ObjectModelPackage, ObjectModel)} - */ - @Deprecated - public static String getI18nPrefix(ObjectModelElement element, - ObjectModel model) { - return JavaGeneratorUtil.getI18nPrefixTagValue(element, null, model); - } - - /** - * Cherche si le tagvalue {@link TopiaTagValues#TAG_GENERATE_OPERATOR_FOR_DAO_HELPER} a été - * activé dans le model. - * - * @param element l'élément à tester - * @param model le modele utilisé - * @return {@code true} si le tag value trouvé dans le modèle, {@code false} - * sinon. - * @deprecated since 2.5, use now the method {@link #shouldGenerateOperatorForDAOHelper(ObjectModel)} - */ - @Deprecated - public static boolean shouldgenerateOperatorForDAOHelper( - ObjectModelElement element, ObjectModel model) { - return shouldGenerateOperatorForDAOHelper(model); -// String tagValue = GeneratorUtil.findTagValue( -// TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER, element, model); -// boolean generate = StringUtils.isNotEmpty(tagValue) && -// Boolean.valueOf(tagValue); -// return generate; - } - - /** * Cherche si le tagvalue {@link TopiaTagValues#TAG_GENERATE_OPERATOR_FOR_DAO_HELPER} a été * activé dans le model. * @@ -805,7 +768,7 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { ObjectModelAttribute attr) { if (hasUniqueStereotype(attr)) { return Set.class.getName(); - } else if (EugeneStereoTypes.hasIndexedStereotype(attr) || attr.isOrdered()) { + } else if (attr.isOrdered()) { return List.class.getName(); } return Collection.class.getName(); @@ -820,7 +783,7 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { public static String getNMultiplicityObjectType(ObjectModelAttribute attr) { if (hasUniqueStereotype(attr)) { return HashSet.class.getName(); - } else if (EugeneStereoTypes.hasIndexedStereotype(attr) || attr.isOrdered()) { + } else if (attr.isOrdered()) { //On considère qu'on ne sait pas traiter vraiment l'attribut "ordered" // puisqu'on va conserver l'ordre d'insertion, et non un ordre en // fonction d'un élément donné. Donc on renvoi une ArrayList @@ -830,12 +793,6 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { return ArrayList.class.getName(); } - @Deprecated - public static boolean hasIndexedStereotype(ObjectModelAttribute attr) { - - return EugeneStereoTypes.hasIndexedStereotype(attr); - } - /** * Renvoie le type d'interface à utiliser en fonction de l'attribut * @@ -846,7 +803,7 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { ObjectModelAttribute attr) { if (hasUniqueStereotype(attr)) { return "set"; - } else if (EugeneStereoTypes.hasIndexedStereotype(attr)) { + } else if (attr.isOrdered()) { return "list"; } //attr.isOrdered() - On génère le ordered en bag @@ -1385,6 +1342,18 @@ public class TopiaGeneratorUtil extends JavaGeneratorUtil { } /** + * Check if the given attribute has the {@link TopiaStereoTypes#STEREOTYPE_INDEXED_COLLECTION} stereotype. + * + * @param attribute attribute to test + * @return {@code true} if stereotype was found, {@code false} otherwise + * @see TopiaStereoTypes#STEREOTYPE_INDEXED_COLLECTION + * @since 2.10 + */ + public static boolean hasIndexedCollectionStereotype(ObjectModelAttribute attribute) { + return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_INDEXED_COLLECTION); + } + + /** * Obtain the value of the {@link TopiaTagValues#TAG_PERSISTENCE_TYPE} * tag value on the given classifier. * <p/> diff --git a/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaStereoTypes.java b/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaStereoTypes.java index 243dd76..81a7a6a 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaStereoTypes.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/generator/TopiaStereoTypes.java @@ -114,4 +114,14 @@ public class TopiaStereoTypes extends StereotypeDefinitionProvider { @StereotypeDefinition(target = ObjectModelAttribute.class, documentation = "To specify that an attribute is part of a primary key (Hibernate mapping)") public static final String STEREOTYPE_PRIMARYKAY = "primaryKey"; + + /** + * Stéréotype pour utiliser une collectionné indexée sur un attribut. + * + * @see TopiaGeneratorUtil#hasIndexedCollectionStereotype(ObjectModelAttribute) + * @since 2.10 + */ + @StereotypeDefinition(target = ObjectModelAttribute.class, + documentation = "To specify that the attribute is an indexed collection (Hibernate mapping)") + public static final String STEREOTYPE_INDEXED_COLLECTION = "indexedCollection"; } -- 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 develop in repository topia. See http://git.nuiton.org/topia.git commit 02ce2c373ab8a727918a54c849f42f8540694b59 Merge: 450d0dd fe892c7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun May 24 12:46:50 2015 +0200 fixes #3694: Introduction du stéréotype IndexedCollection dans Topia Merge branch 'feature/3694' into develop .../generator/EntityHibernateMappingGenerator.java | 10 ++-- .../nuiton/topia/generator/TopiaGeneratorUtil.java | 61 ++++++---------------- .../nuiton/topia/generator/TopiaStereoTypes.java | 10 ++++ 3 files changed, 30 insertions(+), 51 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm