Author: epbernard
Date: 2007-02-13 21:39:17 -0500 (Tue, 13 Feb 2007)
New Revision: 11204
Modified:
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationConfiguration.java
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/Party.java
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/PartyAffiliate.java
Log:
ANN-556 make one to one bidir safe regarding alphabetical order
Modified:
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java 2007-02-14
01:17:31 UTC (rev 11203)
+++
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java 2007-02-14
02:39:17 UTC (rev 11204)
@@ -1986,7 +1986,7 @@
}
else {
mappings.addSecondPass(
- secondPass
+ secondPass, BinderHelper.isDefault( mappedBy )
);
}
}
Modified:
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationConfiguration.java
===================================================================
---
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2007-02-14
01:17:31 UTC (rev 11203)
+++
branches/Branch_3_2/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2007-02-14
02:39:17 UTC (rev 11204)
@@ -297,6 +297,17 @@
iter.remove();
}
}
+
+ //process OneToManySecondPass in order: first
+ iter = secondPasses.iterator();
+ while ( iter.hasNext() ) {
+ SecondPass sp = (SecondPass) iter.next();
+
+ if ( sp instanceof CreateKeySecondPass ) {
+ sp.doSecondPass( classes );
+ iter.remove();
+ }
+ }
super.secondPassCompile();
inSecondPass = false;
Iterator tables = (Iterator<Map.Entry<Table, List<String[]>>>)
tableUniqueConstraints.entrySet().iterator();
Modified:
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/Party.java
===================================================================
---
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/Party.java 2007-02-14
01:17:31 UTC (rev 11203)
+++
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/Party.java 2007-02-14
02:39:17 UTC (rev 11204)
@@ -4,6 +4,7 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
+import javax.persistence.PrimaryKeyJoinColumn;
/**
* @author Emmanuel Bernard
@@ -13,6 +14,7 @@
@Id
String partyId;
- @OneToOne(mappedBy = "party")
+ @OneToOne
+ @PrimaryKeyJoinColumn
PartyAffiliate partyAffiliate;
}
Modified:
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/PartyAffiliate.java
===================================================================
---
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/PartyAffiliate.java 2007-02-14
01:17:31 UTC (rev 11203)
+++
branches/Branch_3_2/HibernateExt/annotations/src/test/org/hibernate/test/annotations/onetoone/PartyAffiliate.java 2007-02-14
02:39:17 UTC (rev 11204)
@@ -14,8 +14,7 @@
@Id
String partyId;
- @OneToOne
- @PrimaryKeyJoinColumn
+ @OneToOne(mappedBy="partyAffiliate")
Party party;
String affiliateName;
Show replies by date