db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r489817 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
Date Sat, 23 Dec 2006 01:30:25 GMT
Author: arminw
Date: Fri Dec 22 17:30:24 2006
New Revision: 489817

URL: http://svn.apache.org/viewvc?view=rev&rev=489817
Log:
minor improvement, add method to lookup Item ClassDescriptor

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

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java?view=diff&rev=489817&r1=489816&r2=489817
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
Fri Dec 22 17:30:24 2006
@@ -46,6 +46,7 @@
     public static final int CASCADE_OBJECT = 23;
 
     private Class m_ClassOfItems = null;
+    private ClassDescriptor m_ClassDescriptorOfItems;
     private Vector m_ForeignKeyFields = new Vector();
     private boolean m_CascadeRetrieve = true;
     private int m_CascadeStore = CASCADE_NONE;
@@ -267,6 +268,11 @@
         return result;
     }
 
+    protected ClassDescriptor getDescriptorFor(Class aClass)
+    {
+        return getClassDescriptor().getRepository().getDescriptorFor(aClass);
+    }
+
     /**
      * Answer the ItemClass.
      */
@@ -276,6 +282,18 @@
     }
 
     /**
+    * Answer the ClassDescriptor of the ItemClass.
+    */
+   public ClassDescriptor getItemClassDescriptor()
+   {
+       if (m_ClassDescriptorOfItems == null)
+       {
+           m_ClassDescriptorOfItems = getDescriptorFor(getItemClass());
+       }
+       return m_ClassDescriptorOfItems;
+   }
+
+    /**
      * @return the fully qualified name of the item class for this descriptor.
      */
     public String getItemClassName()
@@ -289,6 +307,7 @@
      */
     public void setItemClass(Class c)
     {
+        m_ClassDescriptorOfItems = null;
         m_ClassOfItems = c;
     }
 



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