r668 - in nuiton-jpa: nuiton-jpa-api/src/main/java/org/nuiton/jpa/api nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates
Author: tchemit Date: 2013-06-12 10:20:19 +0200 (Wed, 12 Jun 2013) New Revision: 668 Url: http://nuiton.org/projects/sandbox/repository/revisions/668 Log: add PCS Support + clean code Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 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/JpaTemplatesStereoTypes.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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-06-12 08:20:19 UTC (rev 668) @@ -35,14 +35,13 @@ /** * This abstract class gather all code which is common to all daos for all entities. - * + * <p/> * Code included is common implementations of {@link JpaDao} interface and there is * also commun helpers methods for implementation business-specific operations * exposed as protected. * * @author bleny <leny@codelutin.com> * @author tchemit <chemit@codelutin.com> - * * @since 0.1 */ public abstract class AbstractJpaDao<E extends JpaEntity> implements JpaDao<E> { @@ -89,8 +88,7 @@ return entityManager.contains(entity); } - public E findByProperty(String propertyName, Object value) - { + public E findByProperty(String propertyName, Object value) { Map<String, Object> properties = new HashMap<String, Object>(); properties.put(propertyName, value); E result = findByProperties(properties); @@ -98,36 +96,34 @@ } public List<E> findAllByProperty(String propertyName, Object value) { - TypedQuery<E> query = createQuery(propertyName, value); + TypedQuery<E> query = createQuery(propertyName, value); List<E> result = findAll(query); return result; } - public List<E> findAllByProperties(Map<String, Object> properties) - { - TypedQuery<E> query = createQuery(properties); + public List<E> findAllByProperties(Map<String, Object> properties) { + TypedQuery<E> query = createQuery(properties); List<E> results = findAll(query); return results; } - public E findByProperties(Map<String, Object> properties) - { - TypedQuery<E> query = createQuery(properties); + public E findByProperties(Map<String, Object> properties) { + TypedQuery<E> query = createQuery(properties); E result = findAnyOrNull(query); return result; } public E findContains(String propertyName, Object property) { - TypedQuery<E> query= createQuery("From "+getEntityClass().getSimpleName()+" Where "+propertyName+" in elements(:K)"); + TypedQuery<E> query = createQuery("From " + getEntityClass().getSimpleName() + " Where " + propertyName + " In elements(:K)"); query.setParameter("K", property); return findAnyOrNull(query); } public List<E> findAllContains(String propertyName, Object property) { - TypedQuery<E> query = createQuery("From "+getEntityClass().getSimpleName()+" Where "+propertyName+" in elements(:K)"); - query.setParameter("K", property); + TypedQuery<E> query = createQuery("From " + getEntityClass().getSimpleName() + " Where " + propertyName + " In elements(:K)"); + query.setParameter("K", property); return findAll(query); } @@ -138,7 +134,7 @@ newInstance = getEntityClass().newInstance(); // TODO brendan 24/05/13 proper exception management } catch (InstantiationException e) { - throw new RuntimeException(e); + throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } @@ -160,13 +156,13 @@ } catch (ClassCastException eee) { throw new IllegalArgumentException( "Les noms des propriétés doivent être des chaines et " + - "non pas " + propertyName.getClass().getName(), + "non pas " + propertyName.getClass().getName(), eee); } catch (ArrayIndexOutOfBoundsException eee) { throw new IllegalArgumentException( "Le nombre d'argument n'est pas un nombre pair: " - + (others.length + 2) - + " La dernière propriété était: " + name, eee); + + (others.length + 2) + + " La dernière propriété était: " + name, eee); } } return createQuery(properties); @@ -191,8 +187,8 @@ } protected <E> TypedQuery<E> createQuery(Class<E> type, String propertyName, - Object propertyValue, - Object... others) { + Object propertyValue, + Object... others) { Map<String, Object> properties = new HashMap<String, Object>(); properties.put(propertyName, propertyValue); @@ -217,7 +213,7 @@ return createQuery(type, properties); } - protected <E>TypedQuery<E> createQuery(Class<E> type, Map<String, Object> properties) { + protected <E> TypedQuery<E> createQuery(Class<E> type, Map<String, Object> properties) { List<String> whereClauses = new LinkedList<String>(); for (String propertyName : properties.keySet()) { whereClauses.add(propertyName + " = :" + propertyName); @@ -235,7 +231,7 @@ return query; } - protected List<E> findAll(TypedQuery <E> query) { + protected List<E> findAll(TypedQuery<E> query) { return query.getResultList(); } @@ -246,7 +242,7 @@ protected E findAnyOrNull(TypedQuery<E> query) { List<E> all = findAll(query); E onlyElement = null; - if ( ! all.isEmpty()) { + if (!all.isEmpty()) { onlyElement = all.get(0); } return onlyElement; @@ -255,7 +251,7 @@ protected E findUniqueOrNull(TypedQuery<E> query) { List<E> all = findAll(query); E onlyElement = null; - if ( ! all.isEmpty()) { + if (!all.isEmpty()) { if (all.size() > 1) { throw new IllegalStateException( "multiple results for query = " + query 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties 2013-06-12 08:20:19 UTC (rev 668) @@ -22,6 +22,7 @@ # #L% ### model.tagValue.idFactory=true +model.tagValue.generatePropertyChangeListeners=true com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 2013-06-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 2013-06-12 08:20:19 UTC (rev 668) @@ -179,98 +179,4 @@ } return foundSerializable; } - - protected void createPropertyChangeSupport(ObjectModelClass output) { - - addAttribute(output, - "pcs", - PropertyChangeSupport.class, - "new PropertyChangeSupport(this)", - ObjectModelJavaModifier.PROTECTED, - ObjectModelJavaModifier.FINAL, - ObjectModelJavaModifier.TRANSIENT - ); - - // Add PropertyListener - - ObjectModelOperation operation; - - operation = addOperation(output, - "addPropertyChangeListener", - "void", - ObjectModelJavaModifier.PUBLIC - ); - addParameter(operation, PropertyChangeListener.class, "listener"); - setOperationBody(operation, "" - /*{ - pcs.addPropertyChangeListener(listener); - }*/ - ); - - operation = addOperation(output, - "addPropertyChangeListener", - "void", - ObjectModelJavaModifier.PUBLIC - ); - addParameter(operation, String.class, "propertyName"); - addParameter(operation, PropertyChangeListener.class, "listener"); - setOperationBody(operation, "" - /*{ - pcs.addPropertyChangeListener(propertyName, listener); - }*/ - ); - - operation = addOperation(output, - "removePropertyChangeListener", - "void", - ObjectModelJavaModifier.PUBLIC - ); - addParameter(operation, PropertyChangeListener.class, "listener"); - setOperationBody(operation, "" - /*{ - pcs.removePropertyChangeListener(listener); - }*/ - ); - - operation = addOperation(output, - "removePropertyChangeListener", - "void", - ObjectModelJavaModifier.PUBLIC - ); - addParameter(operation, String.class, "propertyName"); - addParameter(operation, PropertyChangeListener.class, "listener"); - setOperationBody(operation, "" - /*{ - pcs.removePropertyChangeListener(propertyName, listener); - }*/ - ); - - operation = addOperation(output, - "firePropertyChange", - "void", - ObjectModelJavaModifier.PROTECTED - ); - addParameter(operation, String.class, "propertyName"); - addParameter(operation, Object.class, "oldValue"); - addParameter(operation, Object.class, "newValue"); - setOperationBody(operation, "" - /*{ - pcs.firePropertyChange(propertyName, oldValue, newValue); - }*/ - ); - - operation = addOperation(output, - "firePropertyChange", - "void", - ObjectModelJavaModifier.PROTECTED - ); - addParameter(operation, String.class, "propertyName"); - addParameter(operation, Object.class, "newValue"); - setOperationBody(operation, "" - /*{ - firePropertyChange(propertyName, null, newValue); - }*/ - ); - } - } 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-06-12 08:20:19 UTC (rev 668) @@ -55,6 +55,8 @@ import javax.persistence.OneToOne; import javax.persistence.OrderColumn; import javax.persistence.PrePersist; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.util.Collection; import java.util.List; import java.util.Set; @@ -80,8 +82,6 @@ private static final Log log = LogFactory.getLog(JpaEntityTransformer.class); -// public static final String PROPERTY_ID = "id"; - @Override public void transformFromClass(ObjectModelClass input) { @@ -198,6 +198,8 @@ ); } + boolean usePCS = JpaTemplatesGeneratorUtil.useGeneratePropertyChangeListeners(getModel()); + Set<String> constantNames = addConstantsFromDependency(input, output); // Get available properties @@ -226,9 +228,15 @@ // Add properties field + javabean methods for (ObjectModelAttribute attr : properties) { - createProperty(output, attr, annotationsForAttributes.get(attr)); + createProperty(output, attr, usePCS, annotationsForAttributes.get(attr)); } + if (usePCS) { + + // Add property change support + createPropertyChangeSupport(output); + } + boolean hasAMultipleProperty = JpaTemplatesGeneratorUtil.containsMutiple(properties); @@ -403,10 +411,9 @@ protected void createProperty(ObjectModelClass output, ObjectModelAttribute attr, + boolean usePCS, Collection<String> annotations) { - boolean usePCS = false; - String attrName = JpaTemplatesGeneratorUtil.getAttributeName(attr); String attrType = JpaTemplatesGeneratorUtil.getAttributeType(attr); @@ -484,13 +491,20 @@ boolean booleanProperty = JpaTemplatesGeneratorUtil.isBooleanPrimitive(attr); + String getterPrefix; if (booleanProperty && !multiple) { + getterPrefix = JpaTemplatesGeneratorUtil.OPERATION_GETTER_BOOLEAN_PREFIX; + } else { + getterPrefix = JpaTemplatesGeneratorUtil.OPERATION_GETTER_DEFAULT_PREFIX; + } + if (booleanProperty && !multiple) { + // creates a isXXX method createGetMethod(output, attrName, attrType, - JpaTemplatesGeneratorUtil.OPERATION_GETTER_BOOLEAN_PREFIX + getterPrefix ); } @@ -499,7 +513,7 @@ ObjectModelOperation getMethod = createGetMethod(output, attrName, attrType, - JpaTemplatesGeneratorUtil.OPERATION_GETTER_DEFAULT_PREFIX + getterPrefix ); if (JpaEntity.PROPERTY_ID.equals(attrName)) { @@ -512,6 +526,7 @@ attrType, simpleType, constantName, + getterPrefix, usePCS ); @@ -820,6 +835,7 @@ String attrType, String simpleType, String constantName, + String getterPrefix, boolean usePCS) { ObjectModelOperation operation = addOperation( output, @@ -830,7 +846,7 @@ addParameter(operation, attrType, attrName); if (usePCS) { - String methodName = getJavaBeanMethodName("get", attrName); + String methodName = getJavaBeanMethodName(getterPrefix, attrName); setOperationBody(operation, "" /*{ <%=simpleType%> oldValue = <%=methodName%>(); @@ -880,4 +896,97 @@ }*/ ); } + + protected void createPropertyChangeSupport(ObjectModelClass output) { + + addAttribute(output, + "pcs", + PropertyChangeSupport.class, + "new PropertyChangeSupport(this)", + ObjectModelJavaModifier.PROTECTED, + ObjectModelJavaModifier.FINAL, + ObjectModelJavaModifier.TRANSIENT + ); + + // Add PropertyListener + + ObjectModelOperation operation; + + operation = addOperation(output, + "addPropertyChangeListener", + "void", + ObjectModelJavaModifier.PUBLIC + ); + addParameter(operation, PropertyChangeListener.class, "listener"); + setOperationBody(operation, "" + /*{ + pcs.addPropertyChangeListener(listener); + }*/ + ); + + operation = addOperation(output, + "addPropertyChangeListener", + "void", + ObjectModelJavaModifier.PUBLIC + ); + addParameter(operation, String.class, "propertyName"); + addParameter(operation, PropertyChangeListener.class, "listener"); + setOperationBody(operation, "" + /*{ + pcs.addPropertyChangeListener(propertyName, listener); + }*/ + ); + + operation = addOperation(output, + "removePropertyChangeListener", + "void", + ObjectModelJavaModifier.PUBLIC + ); + addParameter(operation, PropertyChangeListener.class, "listener"); + setOperationBody(operation, "" + /*{ + pcs.removePropertyChangeListener(listener); + }*/ + ); + + operation = addOperation(output, + "removePropertyChangeListener", + "void", + ObjectModelJavaModifier.PUBLIC + ); + addParameter(operation, String.class, "propertyName"); + addParameter(operation, PropertyChangeListener.class, "listener"); + setOperationBody(operation, "" + /*{ + pcs.removePropertyChangeListener(propertyName, listener); + }*/ + ); + + operation = addOperation(output, + "firePropertyChange", + "void", + ObjectModelJavaModifier.PROTECTED + ); + addParameter(operation, String.class, "propertyName"); + addParameter(operation, Object.class, "oldValue"); + addParameter(operation, Object.class, "newValue"); + setOperationBody(operation, "" + /*{ + pcs.firePropertyChange(propertyName, oldValue, newValue); + }*/ + ); + + operation = addOperation(output, + "firePropertyChange", + "void", + ObjectModelJavaModifier.PROTECTED + ); + addParameter(operation, String.class, "propertyName"); + addParameter(operation, Object.class, "newValue"); + setOperationBody(operation, "" + /*{ + firePropertyChange(propertyName, null, newValue); + }*/ + ); + } } \ No newline at end of file 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java 2013-06-12 08:20:19 UTC (rev 668) @@ -55,9 +55,9 @@ if (useIdGenerator) { // can't have any stuff around GeneraturValue - if(JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(clazz)) { + if (JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(clazz)) { - addError(clazz,"Can't use a NotGenerated tag value when using an id factory"); + 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-06-12 08:20:19 UTC (rev 668) @@ -117,7 +117,7 @@ // using an idGenerator - addImport(output,DefaultJpaEntityIdFactory.class); + addImport(output, DefaultJpaEntityIdFactory.class); ObjectModelOperation constructor = addConstructor( output, ObjectModelJavaModifier.PUBLIC); 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-06-12 08:20:19 UTC (rev 668) @@ -236,15 +236,13 @@ /** * 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. + * tag value on the given model. * * @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_FACTORY - * @since 2.3 + * @since 0.1 */ public static String getIdFactoryTagValue(ObjectModel model) { String value = findTagValue(JpaTemplatesTagValues.TAG_ID_FACTORY, null, model); @@ -257,6 +255,26 @@ } /** + * Obtain the value of the {@link JpaTemplatesTagValues#TAG_GENERATE_PROPERTY_CHANGE_LISTENERS} + * tag value on the given model. + * + * @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_GENERATE_PROPERTY_CHANGE_LISTENERS + * @since 0.1 + */ + public static String getGeneratePropertyChangeListenersTagValue(ObjectModel model) { + String value = findTagValue(JpaTemplatesTagValues.TAG_GENERATE_PROPERTY_CHANGE_LISTENERS, null, model); + return value; + } + + public static boolean useGeneratePropertyChangeListeners(ObjectModel model) { + String value = getGeneratePropertyChangeListenersTagValue(model); + return ObjectUtils.equals("true", value); + } + + /** * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS} * tag value on the given model or classifier. * <p/> @@ -266,7 +284,7 @@ * @param classifier classifier to seek * @return the none empty value of the found tag value or {@code null} if not found nor empty. * @see JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS - * @since 2.3 + * @since 0.1 */ public static String getEntitySuperClassTagValue(ObjectModel model, ObjectModelClassifier classifier) { String value = findTagValue(JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model); @@ -283,7 +301,7 @@ * @param classifier classifier to seek * @return the none empty value of the found tag value or {@code null} if not found nor empty. * @see JpaTemplatesTagValues#TAG_DAO_SUPER_CLASS - * @since 2.3 + * @since 0.1 */ public static String getDaoSuperClassTagValue(ObjectModel model, ObjectModelClassifier classifier) { String value = findTagValue(JpaTemplatesTagValues.TAG_DAO_SUPER_CLASS, classifier, model); @@ -297,7 +315,7 @@ * @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_PERSISTENCE_CONTEXT_SUPER_CLASS - * @since 2.3 + * @since 0.1 */ public static String getPersistenceContextSuperClassTagValue(ObjectModel model) { String value = findTagValue(JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS, null, model); Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-06-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-06-12 08:20:19 UTC (rev 668) @@ -27,7 +27,6 @@ import org.nuiton.eugene.EugeneStereoTypes; import org.nuiton.eugene.ModelPropertiesUtil; import org.nuiton.eugene.models.object.ObjectModelAttribute; -import org.nuiton.eugene.models.object.ObjectModelClass; import org.nuiton.eugene.models.object.ObjectModelClassifier; import javax.persistence.GeneratedValue; @@ -36,7 +35,7 @@ * Defines all stereotypes managed by JPA templates. * * @author tchemit <chemit@codelutin.com> - * @since 2.7 + * @since 0.1 */ public interface JpaTemplatesStereoTypes extends EugeneStereoTypes { @@ -44,6 +43,7 @@ * Stéréotype pour les collections avec unicité. * * @see JpaTemplatesGeneratorUtil#hasUniqueStereotype(ObjectModelAttribute) + * @since 0.1 */ @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelAttribute.class, documentation = "To specify that an attribute is unique (JPA mapping)") @@ -53,6 +53,7 @@ * Stéréotype pour ne pas générer l'annotation {@link GeneratedValue} sur une entité. * * @see JpaTemplatesGeneratorUtil#hasNotGeneratedValueStereotype(ObjectModelClassifier) + * @since 0.1 */ @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelClassifier.class, documentation = "To specify that an entity deal by itself with his id, the GeneratedValue annotation will not be generated then(JPA mapping)") 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-11 14:55:44 UTC (rev 667) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-06-12 08:20:19 UTC (rev 668) @@ -34,7 +34,7 @@ * Defines all tag values managed by JPA templates. * * @author tchemit <chemit@codelutin.com> - * @since 2.7 + * @since 0.1 */ public interface JpaTemplatesTagValues extends EugeneTagValues { @@ -81,7 +81,7 @@ * l'ordre alphabétique. * * @see JpaTemplatesGeneratorUtil#getInverseTagValue(ObjectModelAttribute) - * @since 2.5 + * @since 0.1 */ @ModelPropertiesUtil.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)") @@ -97,4 +97,17 @@ target = {ObjectModel.class}, documentation = "To specify a user defined id factory to use for all entities of the model") String TAG_ID_FACTORY = "idFactory"; + + /** + * Tag value to generate property change listeners on entities + * if setted to {@code true}. + * + * @see JpaTemplatesGeneratorUtil#getGeneratePropertyChangeListenersTagValue(ObjectModel) + * @since 0.1 + */ + @ModelPropertiesUtil.TagValueDefinition( + target = {ObjectModel.class}, + documentation = "Tag value to generate property change listeners on entities.") + String TAG_GENERATE_PROPERTY_CHANGE_LISTENERS = "generatePropertyChangeListeners"; + }
participants (1)
-
tchemit@users.nuiton.org