db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r489527 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java
Date Fri, 22 Dec 2006 00:46:28 GMT
Author: arminw
Date: Thu Dec 21 16:46:27 2006
New Revision: 489527

URL: http://svn.apache.org/viewvc?view=rev&rev=489527
Log:
associate Platform class instance with current JDBCConnectionDescriptor

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java?view=diff&rev=489527&r1=489526&r2=489527
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/JdbcConnectionDescriptor.java
Thu Dec 21 16:46:27 2006
@@ -15,24 +15,23 @@
  * limitations under the License.
  */
 
-import java.io.Serializable;
-import java.util.Properties;
-
 import javax.sql.DataSource;
+import java.io.Serializable;
 
-import org.apache.ojb.broker.util.logging.Logger;
-import org.apache.ojb.broker.util.logging.LoggerFactory;
-import org.apache.ojb.broker.util.XmlHelper;
-import org.apache.ojb.broker.PBKey;
+import org.apache.commons.lang.SystemUtils;
 import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.ojb.broker.PBKey;
+import org.apache.ojb.broker.platforms.Platform;
+import org.apache.ojb.broker.platforms.PlatformFactory;
+import org.apache.ojb.broker.util.XmlHelper;
+import org.apache.ojb.broker.util.logging.Logger;
+import org.apache.ojb.broker.util.logging.LoggerFactory;
 
 /**
  * JdbcConnectionDescriptor describes all relevant parameters of
  * JDBC Connections used by the PersistenceBroker.
  *
- * @author <a href="mailto:thma@apache.org">Thomas Mahler<a>
  * @version $Id$
  */
 public class JdbcConnectionDescriptor extends DescriptorBase implements Serializable, XmlCapable
@@ -63,7 +62,9 @@
     private ConnectionPoolDescriptor cpd;
     private SequenceDescriptor sequenceDescriptor;
     private ObjectCacheDescriptor objectCacheDescriptor;
+
     private transient DataSource dataSource;
+    private transient Platform platform;
 
     /**
      * Constructor declaration
@@ -412,6 +413,16 @@
     public void setBatchMode(boolean flag)
     {
     	m_batchMode = flag;
+    }
+
+    public Platform getPlatform()
+    {
+        // no need to synchronize, dosen't matter if we use different instances
+        if(platform == null)
+        {
+            platform = PlatformFactory.getPlatformFor(this);
+        }
+        return platform;
     }
 
     /**



---------------------------------------------------------------------
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