db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions Object2ByteArrUncompressedFieldConversion.java Object2ByteArrFieldConversion.java
Date Sat, 02 Apr 2005 16:55:57 GMT
arminw      2005/04/02 08:55:57

  Modified:    src/java/org/apache/ojb/broker/accesslayer/conversions Tag:
                        OJB_1_0_RELEASE Object2ByteArrFieldConversion.java
  Added:       src/java/org/apache/ojb/broker/accesslayer/conversions Tag:
                        OJB_1_0_RELEASE
                        Object2ByteArrUncompressedFieldConversion.java
  Log:
  add FieldConversion for objct<-->byte[] conversion without compression
  return null in javaToSql if the byte[] is null
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.6.2.1   +12 -4     db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions/Object2ByteArrFieldConversion.java
  
  Index: Object2ByteArrFieldConversion.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions/Object2ByteArrFieldConversion.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- Object2ByteArrFieldConversion.java	4 Apr 2004 23:53:32 -0000	1.6
  +++ Object2ByteArrFieldConversion.java	2 Apr 2005 16:55:57 -0000	1.6.2.1
  @@ -22,12 +22,18 @@
   import java.util.zip.GZIPInputStream;
   import java.util.zip.GZIPOutputStream;
   
  +import org.apache.ojb.broker.OJBRuntimeException;
  +
   /**
  - * this implementation of the FieldConversion interface converts
  + * This implementation of the FieldConversion interface converts
    * between java.lang.Objects values and byte[] values in the rdbms.
    * This conversion is useful to store serialized objects in database
  - * columns. For an example have a look at the mapping of 
  - * org.apache.ojb.odmg.collections.DlistEntry.
  + * columns.
  + * <p/>
  + * NOTE: This implementation use {@link java.util.zip.GZIPOutputStream} and
  + * {@link java.util.zip.GZIPInputStream} to compress data.
  + *
  + * @see Object2ByteArrUncompressedFieldConversion
    * @author Thomas Mahler
    * @version $Id$
    */
  @@ -39,6 +45,8 @@
        */
       public Object javaToSql(Object source)
       {
  +        if (source == null)
  +            return null;
           try
           {
               ByteArrayOutputStream bao = new ByteArrayOutputStream();
  
  
  
  No                   revision
  
  Index: Object2ByteArrFieldConversion.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions/Object2ByteArrFieldConversion.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- Object2ByteArrFieldConversion.java	4 Apr 2004 23:53:32 -0000	1.6
  +++ Object2ByteArrFieldConversion.java	2 Apr 2005 16:55:57 -0000	1.6.2.1
  @@ -22,12 +22,18 @@
   import java.util.zip.GZIPInputStream;
   import java.util.zip.GZIPOutputStream;
   
  +import org.apache.ojb.broker.OJBRuntimeException;
  +
   /**
  - * this implementation of the FieldConversion interface converts
  + * This implementation of the FieldConversion interface converts
    * between java.lang.Objects values and byte[] values in the rdbms.
    * This conversion is useful to store serialized objects in database
  - * columns. For an example have a look at the mapping of 
  - * org.apache.ojb.odmg.collections.DlistEntry.
  + * columns.
  + * <p/>
  + * NOTE: This implementation use {@link java.util.zip.GZIPOutputStream} and
  + * {@link java.util.zip.GZIPInputStream} to compress data.
  + *
  + * @see Object2ByteArrUncompressedFieldConversion
    * @author Thomas Mahler
    * @version $Id$
    */
  @@ -39,6 +45,8 @@
        */
       public Object javaToSql(Object source)
       {
  +        if (source == null)
  +            return null;
           try
           {
               ByteArrayOutputStream bao = new ByteArrayOutputStream();
  
  
  
  No                   revision
  
  Index: Object2ByteArrFieldConversion.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions/Object2ByteArrFieldConversion.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- Object2ByteArrFieldConversion.java	4 Apr 2004 23:53:32 -0000	1.6
  +++ Object2ByteArrFieldConversion.java	2 Apr 2005 16:55:57 -0000	1.6.2.1
  @@ -22,12 +22,18 @@
   import java.util.zip.GZIPInputStream;
   import java.util.zip.GZIPOutputStream;
   
  +import org.apache.ojb.broker.OJBRuntimeException;
  +
   /**
  - * this implementation of the FieldConversion interface converts
  + * This implementation of the FieldConversion interface converts
    * between java.lang.Objects values and byte[] values in the rdbms.
    * This conversion is useful to store serialized objects in database
  - * columns. For an example have a look at the mapping of 
  - * org.apache.ojb.odmg.collections.DlistEntry.
  + * columns.
  + * <p/>
  + * NOTE: This implementation use {@link java.util.zip.GZIPOutputStream} and
  + * {@link java.util.zip.GZIPInputStream} to compress data.
  + *
  + * @see Object2ByteArrUncompressedFieldConversion
    * @author Thomas Mahler
    * @version $Id$
    */
  @@ -39,6 +45,8 @@
        */
       public Object javaToSql(Object source)
       {
  +        if (source == null)
  +            return null;
           try
           {
               ByteArrayOutputStream bao = new ByteArrayOutputStream();
  
  
  
  1.1.2.1   +65 -0     db-ojb/src/java/org/apache/ojb/broker/accesslayer/conversions/Attic/Object2ByteArrUncompressedFieldConversion.java
  
  
  
  

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