Author: tchemit Date: 2012-05-10 10:10:58 +0200 (Thu, 10 May 2012) New Revision: 2468 Url: http://nuiton.org/repositories/revision/topia/2468 Log: refs #353: use JPA api (continue new jpa mapping generator) Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityJPAMappingGenerator.java Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityJPAMappingGenerator.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityJPAMappingGenerator.java 2012-05-10 07:25:37 UTC (rev 2467) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/generator/EntityJPAMappingGenerator.java 2012-05-10 08:10:58 UTC (rev 2468) @@ -169,7 +169,7 @@ public void generateFromClass(Writer output, ObjectModelClass input) throws IOException { - xmlLevel=0; + xmlLevel = 0; String persistenceType = TopiaGeneratorUtil.getPersistenceType(input); if (!TopiaGeneratorUtil.isEntity(input) && @@ -320,18 +320,19 @@ <%=closeTag(TAG_ID)%> }*/ // add topiaCreateDate - /** - * <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/> - */ + addAttribute(xmlAttributes, ATTRIBUTE_NAME, TopiaEntity.TOPIA_CREATE_DATE); - +/*{<%=flushTag(TAG_BASIC, xmlAttributes)%> +<%=flushTag(TAG_TEMPORAL, javax.persistence.TemporalType.TIMESTAMP.name())%><%=closeStrictTag(TAG_TEMPORAL)%> +<%=closeTag(TAG_BASIC)%> +}*/ } // generate basic attributes Collection<ObjectModelAttribute> basicAttributes = attributesByType.get(PROPERTY_TYPE.BASIC); for (ObjectModelAttribute attribute : basicAttributes) { - generateBasicAttribute(output, input, attribute, xmlAttributes); + generateBasicAttribute(output, input, attribute); } if (mainEntity) { @@ -382,9 +383,9 @@ private void generateBasicAttribute(Writer output, ObjectModelClass input, - ObjectModelAttribute attr, - Map<String, String> xmlAttributes) throws IOException { + ObjectModelAttribute attr) throws IOException { + Map<String, String> xmlAttributes = Maps.newTreeMap(); Map<String, String> columnAttributes = Maps.newTreeMap(); String attrType = getType(attr); String attrName = attr.getName();