[hibernate-commits] Hibernate SVN: r19638 - in branches/Branch_3_2/HibernateExt/tools/src: test/org/hibernate/tool/hbm2x/hbm2hbmxml and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Jun 1 05:59:50 EDT 2010


Author: dgeraskov
Date: 2010-06-01 05:59:49 -0400 (Tue, 01 Jun 2010)
New Revision: 19638

Modified:
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/any.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest.java
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest.java
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest.java
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/PersonAddressOneToOnePrimaryKey.hbm.xml
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Properties.hbm.xml
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Search.hbm.xml
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest.java
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/UserGroup2.hbm.xml
Log:
https://jira.jboss.org/browse/JBIDE-6349
Added "access" attribute to export for: any, component, map, set bag, idbag, list, array, primitive-array elements. 

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/any.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/any.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/any.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -4,6 +4,9 @@
 		meta-type="${value.getMetaType()}"
 		<#if property.cascade != "none">
         cascade="${property.cascade}"
+		</#if>
+		<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
 		</#if>>
 	    	<#assign metaattributable=property>
 		<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,6 +10,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
  	<#assign metaattributable=property>
  	<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,6 +10,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
 	 <#assign metaattributable=property>
 	 	<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -1,7 +1,10 @@
 
 <component
     name="${property.name}"
-    class="${property.value.componentClassName}">
+    class="${property.value.componentClassName}"
+    <#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>>
     <#assign metaattributable=property>
 	<#include "meta.hbm.ftl">
 	<#foreach property in c2h.getProperties(property.value)>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -9,6 +9,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
 	 <#assign metaattributable=property>
 	 	<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,7 +10,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
-		
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>	
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
 		<#assign metaattributable=property>
 		<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,6 +10,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
 		<#assign metaattributable=property><#include "meta.hbm.ftl">
 		<#-- TODO table attributes-->

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -2,7 +2,10 @@
 <#assign table = value.collectionTable.name>
 <#assign dependentValue = value.getKey()>
 
-<primitive-array name="${property.name}" table="${table}">
+<primitive-array name="${property.name}" table="${table}"
+<#if !property.basicPropertyAccessor>
+    access="${property.propertyAccessorName}"
+</#if>>
  <#assign metaattributable=property>
  <#include "meta.hbm.ftl">
  <key>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,6 +10,9 @@
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+	<#if !property.basicPropertyAccessor>
+        access="${property.propertyAccessorName}"
+	</#if>
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>
 	>
 		<#assign metaattributable=property>

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest.java	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest.java	2010-06-01 09:59:49 UTC (rev 19638)
@@ -85,6 +85,7 @@
 			assertEquals(node.attribute( "table" ).getText(),"`UserGroups`");
 			assertEquals(node.attribute( "name" ).getText(),"groups");
 			assertEquals(node.attribute( "lazy" ).getText(),"false");
+			assertEquals(node.attribute( "access" ).getText(),"field");
 		} catch (DocumentException e) {
 			fail("Can't parse file " + outputXml.getAbsolutePath());
 		}		

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest.java	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest.java	2010-06-01 09:59:49 UTC (rev 19638)
@@ -95,6 +95,7 @@
 		assertEquals(node.attribute( "id-type" ).getText(),"long");
 		assertEquals(node.attribute( "meta-type" ).getText(),"string");
 		assertEquals(node.attribute( "cascade" ).getText(), "all");
+		assertEquals(node.attribute( "access" ).getText(), "field");
 
 		list = node.elements("column");
 		assertEquals("Expected to get two column elements", 2, list.size());
@@ -148,8 +149,8 @@
 		assertEquals(node.attribute( "table" ).getText(),"T_GEN_PROPS");
 		assertEquals(node.attribute( "lazy" ).getText(),"true");
 		assertEquals(node.attribute( "cascade" ).getText(), "all");
+		assertEquals(node.attribute( "access" ).getText(), "field");
 
-
 		list = node.elements("key");
 		assertEquals("Expected to get one key element", 1, list.size());
 

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest.java	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest.java	2010-06-01 09:59:49 UTC (rev 19638)
@@ -20,12 +20,9 @@
 import org.dom4j.XPath;
 import org.dom4j.io.SAXReader;
 import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
 import org.hibernate.tool.NonReflectiveTestCase;
-import org.hibernate.tool.hbm2ddl.SchemaValidator;
 import org.hibernate.tool.hbm2x.Exporter;
 import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-import org.hibernate.util.DTDEntityResolver;
 
 
 
@@ -86,8 +83,8 @@
 		node = (Element) list.get(0);
 		assertEquals(node.attribute( "name" ).getText(),"person");
 		assertEquals(node.attribute( "constrained" ).getText(),"true");
+		assertEquals(node.attribute( "access" ).getText(), "field");
 		
-		
 	}
 
 	private Document getXMLDocument(String location) throws DocumentException {

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/PersonAddressOneToOnePrimaryKey.hbm.xml
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/PersonAddressOneToOnePrimaryKey.hbm.xml	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/PersonAddressOneToOnePrimaryKey.hbm.xml	2010-06-01 09:59:49 UTC (rev 19638)
@@ -19,6 +19,6 @@
         </generator>
     </id>
     <one-to-one name="person" 
-        constrained="true"/>
+        constrained="true" access="field"/>
 </class>
 </hibernate-mapping>
\ No newline at end of file

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Properties.hbm.xml
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Properties.hbm.xml	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Properties.hbm.xml	2010-06-01 09:59:49 UTC (rev 19638)
@@ -10,14 +10,14 @@
             <generator class="increment"/>
         </id>
         <property name="name" column="NAME" type="string"/>
-        <any name="someSpecificProperty" id-type="long" meta-type="string" cascade="all">
+        <any name="someSpecificProperty" id-type="long" meta-type="string" cascade="all" access="field">
             <meta-value value="I" class="IntegerPropertyValue"/>
             <meta-value value="S" class="StringPropertyValue"/>
             <meta-value value="C" class="ComplexPropertyValue" />
             <column name="S_S_PROP_TYPE"/>
             <column name="S_S_PROP_ID"/>
         </any>
-        <map name="generalProperties" table="T_GEN_PROPS" lazy="true" cascade="all">
+        <map name="generalProperties" table="T_GEN_PROPS" lazy="true" cascade="all" access="field">
             <key column="PROP_SET_ID"/>
             <map-key type="string" column="GEN_PROP_NAME"/>
             <many-to-any id-type="long" meta-type="string">

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Search.hbm.xml
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Search.hbm.xml	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/Search.hbm.xml	2010-06-01 09:59:49 UTC (rev 19638)
@@ -11,7 +11,7 @@
 	
 	<class name="Search">
 		<id name="searchString"/>
-		<set name="searchResults" sort="natural">
+		<set name="searchResults" sort="natural" access="field">
 			<key column="searchString"/>
 			<element column="text" type="string"/>
 		</set>

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest.java	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest.java	2010-06-01 09:59:49 UTC (rev 19638)
@@ -16,7 +16,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.dom4j.Attribute;
 import org.dom4j.Document;
 import org.dom4j.DocumentException;
 import org.dom4j.DocumentHelper;
@@ -27,7 +26,6 @@
 import org.hibernate.tool.NonReflectiveTestCase;
 import org.hibernate.tool.hbm2x.Exporter;
 import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-import org.hibernate.util.DTDEntityResolver;
 
 /**
  * @author Dmitry Geraskov
@@ -105,8 +103,8 @@
 		assertEquals("Expected to get one set element", 1, list.size());
 		Element node = (Element) list.get(0);
 		assertEquals(node.attribute( "name" ).getText(),"searchResults");
+		assertEquals(node.attribute( "access" ).getText(),"field");
 
-
 		xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/element");
 		list = xpath.selectNodes(document);
 		assertEquals("Expected to get one element 'element'", 1, list.size());

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/UserGroup2.hbm.xml
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/UserGroup2.hbm.xml	2010-05-31 14:55:26 UTC (rev 19637)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/UserGroup2.hbm.xml	2010-06-01 09:59:49 UTC (rev 19638)
@@ -18,7 +18,7 @@
 		
 		<idbag name="groups" 
 				order-by="groupName asc" 
-				table="`UserGroups`" lazy="false">
+				table="`UserGroups`" lazy="false" access="field">
 			<collection-id column="userGroupId" 
 					type="long">
 				<generator class="increment"/>



More information about the hibernate-commits mailing list