Author: faywang
Date: Thu Sep 24 16:12:09 2009
New Revision: 818531

URL: http://svn.apache.org/viewvc?rev=818531&view=rev
Log:
OPENJPA-1253: clean up code for uni-directional one-to-many Map using foreign 
key strategy

Modified:
    
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerRelationMapTableFieldStrategy.java

Modified: 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerRelationMapTableFieldStrategy.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerRelationMapTableFieldStrategy.java?rev=818531&r1=818530&r2=818531&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerRelationMapTableFieldStrategy.java
 (original)
+++ 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerRelationMapTableFieldStrategy.java
 Thu Sep 24 16:12:09 2009
@@ -89,11 +89,11 @@
                 if (isUni1ToMFK()) {
                     
sel.whereForeignKey(field.getElementMapping().getForeignKey(),
                         sm.getObjectId(), 
field.getElementMapping().getDeclaredTypeMapping(), store);
+                    sel.select(vals[idx], field.getElementMapping().
+                            getSelectSubclasses(), store, fetch, eagerMode, 
null);
                 } else {
                     sel.whereForeignKey(field.getJoinForeignKey(),
                         sm.getObjectId(), field.getDefiningMapping(), store);
-                }
-                if (!isUni1ToMFK()) {
                     Joins joins = joinValueRelation(sel.newJoins(), vals[idx]);
                     sel.select(vals[idx], field.getElementMapping().
                         getSelectSubclasses(), store, fetch, eagerMode, joins);
@@ -102,10 +102,7 @@
                     //### thus we can use first mapping of union only
                     if (idx == 0)
                         resJoins[1] = joins;
-                } else {
-                    sel.select(vals[idx], field.getElementMapping().
-                        getSelectSubclasses(), store, fetch, eagerMode, null);
-                }
+               }
             }
         });
         Result res = union.execute(store, fetch);


Reply via email to