Author: hardy.ferentschik
Date: 2009-07-09 07:55:33 -0400 (Thu, 09 Jul 2009)
New Revision: 17058
Modified:
jpamodelgen/trunk/generator/src/main/java/org/hibernate/jpa/metamodel/ap/xml/XmlMetaEntity.java
jpamodelgen/trunk/test/src/main/resources/META-INF/building.xml
Log:
added onetoone mapping
Modified:
jpamodelgen/trunk/generator/src/main/java/org/hibernate/jpa/metamodel/ap/xml/XmlMetaEntity.java
===================================================================
---
jpamodelgen/trunk/generator/src/main/java/org/hibernate/jpa/metamodel/ap/xml/XmlMetaEntity.java 2009-07-09
11:45:57 UTC (rev 17057)
+++
jpamodelgen/trunk/generator/src/main/java/org/hibernate/jpa/metamodel/ap/xml/XmlMetaEntity.java 2009-07-09
11:55:33 UTC (rev 17058)
@@ -40,6 +40,7 @@
import org.hibernate.jpa.metamodel.xml.jaxb.ManyToOne;
import org.hibernate.jpa.metamodel.xml.jaxb.MappedSuperclass;
import org.hibernate.jpa.metamodel.xml.jaxb.OneToMany;
+import org.hibernate.jpa.metamodel.xml.jaxb.OneToOne;
/**
* @author Hardy Ferentschik
@@ -106,6 +107,11 @@
members.add( attribute );
}
+ for ( OneToOne oneToOne : attributes.getOneToOne() ) {
+ attribute = new XmlMetaSingleAttribute( this, oneToOne.getName(), getType(
oneToOne.getName() ) );
+ members.add( attribute );
+ }
+
XmlMetaCollection metaCollection;
for ( OneToMany oneToMany : attributes.getOneToMany() ) {
String[] types = getCollectionType( oneToMany.getName() );
@@ -222,6 +228,11 @@
members.add( attribute );
}
+ for ( OneToOne oneToOne : attributes.getOneToOne() ) {
+ attribute = new XmlMetaSingleAttribute( this, oneToOne.getName(), getType(
oneToOne.getName() ) );
+ members.add( attribute );
+ }
+
XmlMetaCollection metaCollection;
for ( OneToMany oneToMany : attributes.getOneToMany() ) {
String[] types = getCollectionType( oneToMany.getName() );
Modified: jpamodelgen/trunk/test/src/main/resources/META-INF/building.xml
===================================================================
--- jpamodelgen/trunk/test/src/main/resources/META-INF/building.xml 2009-07-09 11:45:57
UTC (rev 17057)
+++ jpamodelgen/trunk/test/src/main/resources/META-INF/building.xml 2009-07-09 11:55:33
UTC (rev 17058)
@@ -10,7 +10,7 @@
<!-- default package -->
<mapped-superclass class="Building" access="FIELD"
metadata-complete="true"> <!--means ignore annotations-->
<attributes>
- <many-to-one name="address" fetch="LAZY"/>
+ <one-to-one name="address" fetch="LAZY"/>
</attributes>
</mapped-superclass>
</entity-mappings>
Show replies by date