db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r538368 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldFactory.java
Date Tue, 15 May 2007 23:04:50 GMT
Author: arminw
Date: Tue May 15 16:04:49 2007
New Revision: 538368

URL: http://svn.apache.org/viewvc?view=rev&rev=538368
Log:
add shortcut name support

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

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldFactory.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldFactory.java?view=diff&rev=538368&r1=538367&r2=538368
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldFactory.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldFactory.java
Tue May 15 16:04:49 2007
@@ -15,16 +15,16 @@
  * limitations under the License.
  */
 
-import org.apache.ojb.broker.core.PersistenceBrokerConfiguration;
 import org.apache.ojb.broker.metadata.MetadataException;
 import org.apache.ojb.broker.util.ClassHelper;
+import org.apache.ojb.broker.util.ShortcutMapper;
+import org.apache.ojb.broker.util.configuration.Configuration;
 import org.apache.ojb.broker.util.configuration.ConfigurationException;
 import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
 
 /**
- * @author <a href="mailto:thma@apache.org">Thomas Mahler<a>
  * @version $Id$
  */
 
@@ -56,8 +56,9 @@
                     persistentFieldClassName = getDefaultPersistentFieldClassName();
                 }
             }
+            Class tmp = ShortcutMapper.resolve(persistentFieldClassName, PersistentField.class);
             Object[] args = {attributeType, attributeName};
-            return (PersistentField) ClassHelper.newInstance(persistentFieldClassName, METHOD_PARAMETER_TYPES,
args);
+            return (PersistentField) ClassHelper.newInstance(tmp, METHOD_PARAMETER_TYPES,
args);
             
         }
         catch (Exception ex)
@@ -98,12 +99,8 @@
     {
         try
         {
-            PersistenceBrokerConfiguration config =
-                    (PersistenceBrokerConfiguration) OjbConfigurator.getInstance().getConfigurationFor(
-                            null);
-
-            Class clazz = config.getPersistentFieldClass();
-            return clazz.getName();
+            Configuration config = OjbConfigurator.getInstance().getConfigurationFor(null);
+            return config.getString("PersistentFieldClass", PersistentFieldDirectImpl.class.getName());
         }
         catch (ConfigurationException e)
         {



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