ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r530717 - /incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java
Date Fri, 20 Apr 2007 09:36:10 GMT
Author: gnodet
Date: Fri Apr 20 02:36:09 2007
New Revision: 530717

URL: http://svn.apache.org/viewvc?view=rev&rev=530717
Log:
The partner link is not retrieved from the list associated to this scope, so the first partner
link with the same id is returned which leads to an horrible mess :-(  But this is now fixed
:-)

Modified:
    incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java

Modified: incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java?view=diff&rev=530717&r1=530716&r2=530717
==============================================================================
--- incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java (original)
+++ incubator/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ScopeDAOImpl.java Fri
Apr 20 02:36:09 2007
@@ -48,7 +48,6 @@
 @Entity
 @Table(name="ODE_SCOPE")
 @NamedQueries({
-    @NamedQuery(name="PLinkByModelId", query="SELECT pl FROM PartnerLinkDAOImpl as pl WHERE
pl._partnerLinkModelId = :mid"),
     @NamedQuery(name="ScopeEvents", query="SELECT se FROM EventDAOImpl as se WHERE se._scopeId
= :sid")
         })
 public class ScopeDAOImpl extends OpenJPADAO implements ScopeDAO {
@@ -137,9 +136,12 @@
 	}
 
 	public PartnerLinkDAO getPartnerLink(int plinkModelId) {
-        Query qry = getEM().createNamedQuery("PLinkByModelId");
-        qry.setParameter("mid", plinkModelId);        
-        return getSingleResult(qry);
+        for (PartnerLinkDAO pLink : getPartnerLinks()) {
+            if (pLink.getPartnerLinkModelId() == plinkModelId) {
+                return pLink;
+            }
+        }
+        return null;
 	}
 
 	public Collection<PartnerLinkDAO> getPartnerLinks() {



Mime
View raw message