Author: vyemialyanchyk
Date: 2008-11-21 11:31:44 -0500 (Fri, 21 Nov 2008)
New Revision: 11954
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
Log:
JBIDE-3033
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2008-11-21
16:21:06 UTC (rev 11953)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2008-11-21
16:31:44 UTC (rev 11954)
@@ -272,6 +272,14 @@
pi.refEntityInfo2.mappedBy = pi.fieldId;
}
}
+ else if (pi.refEntityInfo.refType == RefType.MANY2ONE) {
+ if (pi.refEntityInfo2.refType == RefType.MANY2ONE) {
+ pi.refEntityInfo.refType = RefType.ONE2ONE;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.ONE2ONE;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
}
return true;
}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java 2008-11-21
16:21:06 UTC (rev 11953)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java 2008-11-21
16:31:44 UTC (rev 11954)
@@ -13,7 +13,7 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
@Entity
public class Foto {
@@ -23,7 +23,7 @@
@Id @GeneratedValue
protected Short id;
- @ManyToOne
+ @OneToOne(mappedBy="foto")
protected Person person;
protected Short width_IDtest;
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java 2008-11-21
16:21:06 UTC (rev 11953)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java 2008-11-21
16:31:44 UTC (rev 11954)
@@ -15,8 +15,8 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
+import javax.persistence.OneToOne;
import javax.persistence.OneToMany;
-import javax.persistence.ManyToOne;
@Entity
public class Person {
@@ -27,7 +27,7 @@
@OneToMany(mappedBy="documentOwner")
protected Set<Document> documents;
- @ManyToOne
+ @OneToOne(mappedBy="person")
protected Foto foto;
protected Set someTestSet;
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2008-11-21
16:21:06 UTC (rev 11953)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2008-11-21
16:31:44 UTC (rev 11954)
@@ -101,6 +101,10 @@
"test.annotated.Passport"); //$NON-NLS-1$
ICompilationUnit icu2 = Utils.findCompilationUnit(javaProject,
"test.annotated.Staff"); //$NON-NLS-1$
+ //ICompilationUnit icu = Utils.findCompilationUnit(javaProject,
+ // "test.annotated.Foto"); //$NON-NLS-1$
+ //ICompilationUnit icu2 = Utils.findCompilationUnit(javaProject,
+ // "test.annotated.Person"); //$NON-NLS-1$
assertNotNull(icu);
assertNotNull(icu2);
collector.initCollector(javaProject);
Show replies by date