Author: bleny Date: 2013-06-05 16:23:54 +0200 (Wed, 05 Jun 2013) New Revision: 651 Url: http://nuiton.org/projects/sandbox/repository/revisions/651 Log: some refactorings renaming 'generator' to 'factory', confusing with eugene generators, reimplement default factory, introduce r.java Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdFactory.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactory.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactoryResolver.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/SequenceJpaEntityIdFactory.java Removed: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main/xmi/magalie.properties nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-06-05 14:23:54 UTC (rev 651) @@ -215,16 +215,13 @@ E onlyElement = null; if ( ! all.isEmpty()) { if (all.size() > 1) { - throw new IllegalStateException("multiple results " + all); + throw new IllegalStateException( + "multiple results for query = " + query + + " results = " + all); } onlyElement = all.get(0); } return onlyElement; } - protected long count(TypedQuery<E> query) { - // XXX brendan 24/05/13 worst way to do, use hql - return findAll(query).size(); - } - } Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-06-05 14:23:54 UTC (rev 651) @@ -44,10 +44,10 @@ this(null, entityManager); } - public AbstractJpaPersistenceContext(JpaEntityIdGenerator idGenerator, + public AbstractJpaPersistenceContext(JpaEntityIdFactory jpaEntityIdFactory, EntityManager entityManager) { - if (idGenerator != null) { - JpaEntityIdGeneratorFactory.setGenerator(idGenerator); + if (jpaEntityIdFactory != null) { + JpaEntityIdFactoryResolver.setFactory(jpaEntityIdFactory); } this.entityManager = entityManager; entityTransaction = entityManager.getTransaction(); Copied: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdFactory.java (from rev 648, nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java) =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdFactory.java (rev 0) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdFactory.java 2013-06-05 14:23:54 UTC (rev 651) @@ -0,0 +1,42 @@ +package org.nuiton.jpa.api; + +/* + * #%L + * Nuiton Jpa :: API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2013 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import java.util.UUID; + +/** + * Default implementation of {@link JpaEntityIdFactory}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class DefaultJpaEntityIdFactory implements JpaEntityIdFactory { + + @Override + public String newId(JpaEntity entity) { + return entity.getClass().getName() + '_' + UUID.randomUUID().toString(); + } + +} Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdFactory.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java 2013-06-05 14:23:54 UTC (rev 651) @@ -1,44 +0,0 @@ -package org.nuiton.jpa.api; - -/* - * #%L - * Nuiton Jpa :: API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2013 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -/** - * Default implementation of {@link JpaEntityIdGenerator}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class DefaultJpaEntityIdGenerator implements JpaEntityIdGenerator { - - @Override - public String generate(JpaEntity entity) { - double random = Math.random(); - while (Double.toString(random).contains("E-")) { - random = Math.random(); - } - return entity.getClass().getName() + '#' + System.currentTimeMillis() + '#' - + random; - } -} Copied: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactory.java (from rev 648, nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java) =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactory.java (rev 0) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactory.java 2013-06-05 14:23:54 UTC (rev 651) @@ -0,0 +1,37 @@ +package org.nuiton.jpa.api; + +/* + * #%L + * Nuiton Jpa :: API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2013 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +/** + * To generate entity id. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public interface JpaEntityIdFactory { + + String newId(JpaEntity entity); + +} Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactory.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactoryResolver.java (from rev 648, nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java) =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactoryResolver.java (rev 0) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactoryResolver.java 2013-06-05 14:23:54 UTC (rev 651) @@ -0,0 +1,49 @@ +package org.nuiton.jpa.api; + +/* + * #%L + * Nuiton Jpa :: API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2013 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import com.google.common.base.Preconditions; + +/** + * {@link JpaEntityIdFactory} used in generated code in entities. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class JpaEntityIdFactoryResolver implements JpaEntityIdFactory { + + protected static JpaEntityIdFactory factory; + + public static void setFactory(JpaEntityIdFactory factory) { + JpaEntityIdFactoryResolver.factory = factory; + } + + @Override + public String newId(JpaEntity entity) { + Preconditions.checkNotNull(factory, "No factory assigned"); + return factory.newId(entity); + } + +} Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdFactoryResolver.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java 2013-06-05 14:23:54 UTC (rev 651) @@ -1,36 +0,0 @@ -package org.nuiton.jpa.api; - -/* - * #%L - * Nuiton Jpa :: API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2013 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -/** - * To generate entity id. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public interface JpaEntityIdGenerator { - - String generate(JpaEntity entity); -} Deleted: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java 2013-06-05 14:23:54 UTC (rev 651) @@ -1,48 +0,0 @@ -package org.nuiton.jpa.api; - -/* - * #%L - * Nuiton Jpa :: API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2013 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -import com.google.common.base.Preconditions; - -/** - * {@link JpaEntityIdGenerator} used in generated code in entities. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class JpaEntityIdGeneratorFactory implements JpaEntityIdGenerator { - - protected static JpaEntityIdGenerator generator; - - public static void setGenerator(JpaEntityIdGenerator generator) { - JpaEntityIdGeneratorFactory.generator = generator; - } - - @Override - public String generate(JpaEntity entity) { - Preconditions.checkNotNull(generator, "No generator assigned."); - return generator.generate(entity); - } -} Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java 2013-06-05 14:23:54 UTC (rev 651) @@ -43,5 +43,4 @@ void rollback(); - } Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/SequenceJpaEntityIdFactory.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/SequenceJpaEntityIdFactory.java (rev 0) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/SequenceJpaEntityIdFactory.java 2013-06-05 14:23:54 UTC (rev 651) @@ -0,0 +1,19 @@ +package org.nuiton.jpa.api; + +/** + * An implementation of {@link JpaEntityIdFactory} that generate a sequence + * as long as the lifecycle of this factory. + * + * @since 0.1 + */ +public class SequenceJpaEntityIdFactory implements JpaEntityIdFactory { + + protected int sequence = 0; + + @Override + public String newId(JpaEntity entity) { + sequence += 1; + return entity.getClass().getSimpleName() + sequence; + } + +} Modified: nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main/xmi/magalie.properties =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main/xmi/magalie.properties 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main/xmi/magalie.properties 2013-06-05 14:23:54 UTC (rev 651) @@ -21,7 +21,7 @@ # <http://www.gnu.org/licenses/lgpl-3.0.html>. # #L% ### -model.tagValue.idGenerator=org.nuiton.jpa.api.DefaultJpaEntityIdGenerator +model.tagValue.idFactory=org.nuiton.jpa.api.DefaultJpaEntityIdFactory com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique Modified: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties 2013-06-05 14:23:54 UTC (rev 651) @@ -21,7 +21,7 @@ # <http://www.gnu.org/licenses/lgpl-3.0.html>. # #L% ### -model.tagValue.idGenerator=org.nuiton.jpa.api.DefaultJpaEntityIdGenerator +model.tagValue.idFactory=org.nuiton.jpa.api.DefaultJpaEntityIdFactory com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-06-05 14:23:54 UTC (rev 651) @@ -39,7 +39,7 @@ import org.nuiton.eugene.models.object.xml.ObjectModelAttributeImpl; import org.nuiton.jpa.api.AbstractJpaEntity; import org.nuiton.jpa.api.JpaEntities; -import org.nuiton.jpa.api.JpaEntityIdGeneratorFactory; +import org.nuiton.jpa.api.JpaEntityIdFactoryResolver; import javax.persistence.CascadeType; import javax.persistence.Entity; @@ -180,10 +180,10 @@ void.class, ObjectModelJavaModifier.PUBLIC); addAnnotation(output, operation, PrePersist.class); - addImport(output, JpaEntityIdGeneratorFactory.class); + addImport(output, JpaEntityIdFactoryResolver.class); setOperationBody(operation, "" /*{ - this.id = new JpaEntityIdGeneratorFactory().generate(this); + this.id = new JpaEntityIdFactoryResolver().newId(this); }*/ ); } Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java 2013-06-05 14:23:54 UTC (rev 651) @@ -60,7 +60,7 @@ // can't have any stuff around GeneraturValue if(JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(clazz)) { - addError(clazz,"Can't use a NotGenerated tag value when using an id generator"); + addError(clazz,"Can't use a NotGenerated tag value when using an id factory"); } } } Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-06-05 14:23:54 UTC (rev 651) @@ -30,7 +30,7 @@ import org.nuiton.eugene.models.object.ObjectModelJavaModifier; import org.nuiton.eugene.models.object.ObjectModelOperation; import org.nuiton.jpa.api.AbstractJpaPersistenceContext; -import org.nuiton.jpa.api.JpaEntityIdGenerator; +import org.nuiton.jpa.api.JpaEntityIdFactory; import javax.persistence.EntityManager; import java.util.List; @@ -180,12 +180,12 @@ output, ObjectModelJavaModifier.PUBLIC); - addParameter(constructor, JpaEntityIdGenerator.class, "idGenerator"); + addParameter(constructor, JpaEntityIdFactory.class, "jpaEntityIdFactory"); addParameter(constructor, EntityManager.class, "entityManager"); setOperationBody(constructor, "" /*{ - super(idGenerator, entityManager); + super(jpaEntityIdFactory, entityManager); }*/ ); } Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-06-05 14:23:54 UTC (rev 651) @@ -234,7 +234,7 @@ } /** - * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ID_GENERATOR} + * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ID_FACTORY} * tag value on the given model or classifier. * <p/> * It will first look on the model, and then in the given classifier. @@ -242,11 +242,11 @@ * @param model model to seek * @return the none empty value of the found tag value or {@code null} * if not found nor empty. - * @see JpaTemplatesTagValues#TAG_ID_GENERATOR + * @see JpaTemplatesTagValues#TAG_ID_FACTORY * @since 2.3 */ public static String getIdGeneratorTagValue(ObjectModel model) { - String value = findTagValue(JpaTemplatesTagValues.TAG_ID_GENERATOR, null, model); + String value = findTagValue(JpaTemplatesTagValues.TAG_ID_FACTORY, null, model); return value; } Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-06-04 13:50:10 UTC (rev 650) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-06-05 14:23:54 UTC (rev 651) @@ -88,13 +88,13 @@ String TAG_INVERSE = "inverse"; /** - * Tag value to get user defined id generator. + * Tag value to get user defined id factory. * * @see JpaTemplatesGeneratorUtil#getIdGeneratorTagValue(ObjectModel) * @since 0.1 */ @ModelPropertiesUtil.TagValueDefinition( target = {ObjectModel.class}, - documentation = "To specify a user defined id generator to use for all entities of the model") - String TAG_ID_GENERATOR = "idGenerator"; + documentation = "To specify a user defined id factory to use for all entities of the model") + String TAG_ID_FACTORY = "idFactory"; }