[cvs] expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj MultiDBObject.java

JCorporate Ltd jcorp at jcorp2.servlets.net
Tue Aug 24 12:23:39 PDT 2004


Update of /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj
In directory jcorp2.servlets.net:/tmp/cvs-serv1642/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj

Modified Files:
	MultiDBObject.java 
Log Message:
copy nulls if source field is null


Index: MultiDBObject.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/MultiDBObject.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** MultiDBObject.java	23 Aug 2004 19:31:19 -0000	1.46
--- MultiDBObject.java	24 Aug 2004 19:23:37 -0000	1.47
***************
*** 2280,2284 ****
              DBField oneField = (DBField) iterator.next();
              try {
!                 result.setField(oneField.getName(), this.getField(shortName, oneField.getName()));
              } catch (DBException e) {
                  // we don't care if getField throws; it will do so if there is nothing retrieved for this field
--- 2280,2289 ----
              DBField oneField = (DBField) iterator.next();
              try {
!                 String fieldName = oneField.getName();
!                 if (isFieldNull(shortName, fieldName)) {
!                     result.setField(fieldName, (String) null);
!                 } else {
!                     result.setField(fieldName, getField(shortName, fieldName));
!                 }
              } catch (DBException e) {
                  // we don't care if getField throws; it will do so if there is nothing retrieved for this field
***************
*** 2325,2328 ****
--- 2330,2343 ----
          return oneObj.getJDBCMetaData().getTargetTable();
      }
+ 
+     /**
+      * @return true if the given field is null
+      */
+     public boolean isFieldNull(String shortName, String fieldName)
+             throws DBException {
+         return getByShortName(shortName).isFieldNull(fieldName);
+     }
+ 
+ 
  } /* MultiDBObject */
  



More information about the cvs mailing list