db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r474572 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java
Date Mon, 13 Nov 2006 23:29:34 GMT
Author: arminw
Date: Mon Nov 13 15:29:34 2006
New Revision: 474572

URL: http://svn.apache.org/viewvc?view=rev&rev=474572
Log:
cache full column name

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

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java?view=diff&rev=474572&r1=474571&r2=474572
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java
Mon Nov 13 15:29:34 2006
@@ -55,6 +55,7 @@
 
     private int m_ColNo;
     private String m_ColumnName;
+    private String m_FullColumnName;
     private String m_ColumnType;
     private boolean m_IsKeyField = false;
     private boolean indexed = false;
@@ -121,6 +122,12 @@
         m_ColNo = id;
     }
 
+    public void setClassDescriptor(ClassDescriptor classDescriptor)
+    {
+        super.setClassDescriptor(classDescriptor);
+        m_FullColumnName = null;
+    }
+
     /**
      * Return the name of the mapped database column.
      *
@@ -141,7 +148,11 @@
      */
     public String getFullColumnName()
     {
-        return getClassDescriptor().getFullTableName() + "." + getColumnName();
+        if(m_FullColumnName == null)
+        {
+            m_FullColumnName = getClassDescriptor().getFullTableName() + "." + getColumnName();
+        }
+        return m_FullColumnName;
     }
 
     public void setColumnName(String str)
@@ -554,17 +565,17 @@
      * Reads in the value of the field/column represented by this <code>FieldDescriptor</code>.
      *
      * @param rs_stmt The current used {@link org.apache.ojb.broker.accesslayer.ResultSetAndStatement}
instance.
-     * @param convert If set <em>true</em> a
+     * @param convertToJava If set <em>true</em> a
      * {@link org.apache.ojb.broker.accesslayer.conversions.FieldConversion#sqlToJava(Object)}
conversion call
      * is done.
      * @return The read in value of this field.
      * @throws SQLException
      */
-    public Object readValue(final ResultSetAndStatement rs_stmt, boolean convert)
+    public Object readValue(final ResultSetAndStatement rs_stmt, boolean convertToJava)
             throws SQLException
     {
         int idx = rs_stmt.m_sql.getColumnIndex(this);
-        return readValue(rs_stmt, idx, convert);
+        return readValue(rs_stmt, idx, convertToJava);
     }
 
     /**
@@ -572,18 +583,18 @@
      *
      * @param rs_stmt The current used {@link org.apache.ojb.broker.accesslayer.ResultSetAndStatement}
instance.
      * @param index The result set column index.
-     * @param convert If set <em>true</em> a
+     * @param convertToJava If set <em>true</em> a
      * {@link org.apache.ojb.broker.accesslayer.conversions.FieldConversion#sqlToJava(Object)}
conversion call
      * is done.
      * @return The read in value of this field.
      * @throws SQLException
      */
-    public Object readValue(final ResultSetAndStatement rs_stmt, int index, boolean convert)
+    public Object readValue(final ResultSetAndStatement rs_stmt, int index, boolean convertToJava)
             throws SQLException
     {
         Object val = getJdbcType().getObjectFromColumn(rs_stmt.m_rs, null, getColumnName(),
index);
         val = rs_stmt.m_platform.postPrepareReadInValue(this, val);
-        if(convert) val = getFieldConversion().sqlToJava(val);
+        if(convertToJava) val = getFieldConversion().sqlToJava(val);
         if(isLobFieldType())
         {
             val = rs_stmt.m_broker.serviceLobHelper().wrapLobField(this, val);



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