empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1291836 - /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java
Date Tue, 21 Feb 2012 15:02:16 GMT
Author: doebele
Date: Tue Feb 21 15:02:15 2012
New Revision: 1291836

URL: http://svn.apache.org/viewvc?rev=1291836&view=rev
Log:
EMPIREDB-126
ItemNotFoundException

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java?rev=1291836&r1=1291835&r2=1291836&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java Tue Feb
21 15:02:15 2012
@@ -30,6 +30,7 @@ import org.apache.empire.commons.StringU
 import org.apache.empire.data.ColumnExpr;
 import org.apache.empire.data.RecordData;
 import org.apache.empire.exceptions.BeanPropertySetException;
+import org.apache.empire.exceptions.ItemNotFoundException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
@@ -76,7 +77,10 @@ public abstract class DBRecordData exten
      */
     public final Object getValue(ColumnExpr column)
     {
-        return getValue(getFieldIndex(column));
+        int index = getFieldIndex(column);
+        if (index<0)
+            throw new ItemNotFoundException(column.getName()); 
+        return getValue(index);
     }
 
     /**



Mime
View raw message