db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r489533 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
Date Fri, 22 Dec 2006 01:03:24 GMT
Author: arminw
Date: Thu Dec 21 17:03:23 2006
New Revision: 489533

URL: http://svn.apache.org/viewvc?view=rev&rev=489533
Log:
change Platform instance lookup, explicit lookup of PK fields to extract PK ValueContainer

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java?view=diff&rev=489533&r1=489532&r2=489533
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
Thu Dec 21 17:03:23 2006
@@ -35,7 +35,6 @@
 import org.apache.ojb.broker.metadata.ProcedureDescriptor;
 import org.apache.ojb.broker.platforms.Platform;
 import org.apache.ojb.broker.platforms.PlatformException;
-import org.apache.ojb.broker.platforms.PlatformFactory;
 import org.apache.ojb.broker.query.BetweenCriteria;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.ExistsCriteria;
@@ -67,7 +66,7 @@
     {
         this.m_broker = pBroker;
         this.m_conMan = m_broker.serviceConnectionManager();
-        m_platform = PlatformFactory.getPlatformFor(m_conMan.getConnectionDescriptor());
+        m_platform = m_conMan.getConnectionDescriptor().getPlatform();
     }
 
     public void closeResources(Statement stmt, ResultSet rs)
@@ -641,7 +640,10 @@
      */
     protected ValueContainer[] getKeyValues(PersistenceBroker broker, ClassDescriptor cld,
Object obj) throws PersistenceBrokerException
     {
-        return broker.serviceBrokerHelper().getKeyValues(cld, obj);
+        //return broker.serviceBrokerHelper().getKeyValues(cld, obj);
+        // use the PK fields of the specified CLD, this is mandatory when using "table per
subclass" inheritance
+        // cause in this case the PK fields can be differ.
+        return broker.serviceBrokerHelper().getValuesForObject(cld.getPkFields(), obj, true,
false);
     }
 
     /**
@@ -682,7 +684,7 @@
 
         // Figure out if we are using a callable statement.  If we are, then we
         // will need to register one or more output parameters.
-        CallableStatement callable = null;
+        CallableStatement callable;
         try
         {
             callable = (CallableStatement) stmt;



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message