User: mulder  
  Date: 00/10/19 12:56:28

  Modified:    src/main/org/jboss/test/dbtest/bean AllTypesBean.java
  Log:
   - Add a variable of type Time
   - Add checks for min/max values for numeric types.  Many DBs cannot
     accurately represent floats, doubles, or longs.  This is not
     considered to be a failure, since it's a limitation of the DB not
     the jBoss configuration or JAWS mapping.
   - Change "Oracle" mapping to "Oracle 7".  There's an "Oracle 8" mapping
     forthcoming.  In 7, you can only have one serialized Java object
     per table, since they map to DB type long.  In 8, we may be able to
     get around that.
  
  Revision  Changes    Path
  1.2       +41 -28    jbosstest/src/main/org/jboss/test/dbtest/bean/AllTypesBean.java
  
  Index: AllTypesBean.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbosstest/src/main/org/jboss/test/dbtest/bean/AllTypesBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AllTypesBean.java 2000/10/09 18:07:14     1.1
  +++ AllTypesBean.java 2000/10/19 19:56:27     1.2
  @@ -8,6 +8,7 @@
   import javax.naming.Context;
   import javax.naming.InitialContext;
   import java.sql.Date;
  +import java.sql.Time;
   import java.sql.Timestamp;
   import org.jboss.test.dbtest.interfaces.MyObject;
   
  @@ -23,29 +24,31 @@
   //    public char aChar;
       public String aString;
       public Date aDate;
  +    public Time aTime;
        public Timestamp aTimestamp;
  -     
  +
        public MyObject anObject;
  -     
  +
        public Collection aList;
  -     
  +
        private EntityContext entityContext;
   
  -    
  +
       public String ejbCreate(String pk) throws RemoteException, CreateException {
  -             return ejbCreate(true, (byte)1, (short)2, (int)3, (long)4, (float)5.6, 
  +             return ejbCreate(true, (byte)1, (short)2, (int)3, (long)4, (float)5.6,
                        (double)7.8, /*'9',*/ pk, new Date(System.currentTimeMillis()),
  -             new Timestamp(System.currentTimeMillis()), new MyObject());
  +             new Time(System.currentTimeMillis()),
  +            new Timestamp(System.currentTimeMillis()), new MyObject());
        }
   
  -    public void ejbPostCreate(String pk)              
  +    public void ejbPostCreate(String pk)
                throws RemoteException, CreateException {}
  -             
  +
   
  -    public String ejbCreate(boolean aBoolean, byte aByte, short aShort, int anInt, 
  -             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString, 
  -             Date aDate, Timestamp aTimestamp, MyObject anObject ) 
  -             
  +    public String ejbCreate(boolean aBoolean, byte aByte, short aShort, int anInt,
  +             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString,
  +             Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject )
  +
                throws RemoteException, CreateException {
   
           this.aBoolean = aBoolean;
  @@ -58,19 +61,20 @@
                //this.aChar = aChar;
           this.aString = aString;
                this.aDate = aDate;
  +        this.aTime = aTime;
                this.aTimestamp = aTimestamp;
                this.anObject = anObject;
  -             
  +
                aList = new ArrayList();
  -             
  +
           return null;
       }
   
  +
  +    public void ejbPostCreate(boolean aBoolean, byte aByte, short aShort, int anInt,
  +             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString,
  +             Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject )
   
  -    public void ejbPostCreate(boolean aBoolean, byte aByte, short aShort, int 
anInt, 
  -             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString, 
  -             Date aDate, Timestamp aTimestamp, MyObject anObject ) 
  -              
                throws RemoteException, CreateException {}
   
       public void ejbActivate() throws RemoteException {}
  @@ -92,11 +96,11 @@
           entityContext = null;
       }
   
  -             
  -    public void updateAllValues(boolean aBoolean, byte aByte, short aShort, int 
anInt, 
  -             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString, 
  -             Date aDate, Timestamp aTimestamp, MyObject anObject ) {
   
  +    public void updateAllValues(boolean aBoolean, byte aByte, short aShort, int 
anInt,
  +             long aLong, float aFloat, double aDouble, /*char aChar,*/ String 
aString,
  +             Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject ) {
  +
           this.aBoolean = aBoolean;
                this.aByte = aByte;
                this.aShort = aShort;
  @@ -107,21 +111,22 @@
                //this.aChar = aChar;
           this.aString = aString;
                this.aDate = aDate;
  +        this.aTime = aTime;
                this.aTimestamp = aTimestamp;
                this.anObject = anObject;
  -             
  +
       }
  -     
  +
        public void addObjectToList(Object anObject) throws RemoteException {
                aList.add(anObject);
        }
  -    
  +
        public void removeObjectFromList(Object anObject) throws RemoteException {
                aList.remove(anObject);
        }
  -     
  +
       public Collection getObjectList() throws RemoteException { return aList; }
  -    
  +
        public boolean getBoolean() throws RemoteException { return aBoolean; }
       public byte getByte() throws RemoteException { return aByte; }
        public short getShort() throws RemoteException { return aShort; }
  @@ -132,7 +137,15 @@
        //public char getChar() throws RemoteException { return aChar; }
        public String getString() throws RemoteException { return aString; }
        public Date getDate() throws RemoteException { return aDate; }
  +     public Time getTime() throws RemoteException { return aTime; }
        public Timestamp getTimestamp() throws RemoteException { return aTimestamp; }
  -     
  +
        public MyObject getObject() throws RemoteException { return anObject; }
  +
  +    public void setByte(byte b) {aByte = b;}
  +    public void setShort(short s) {aShort = s;}
  +    public void setInt(int i) {anInt = i;}
  +    public void setLong(long l) {aLong = l;}
  +    public void setFloat(float f) {aFloat = f;}
  +    public void setDouble(double d) {aDouble = d;}
   }
  
  
  

Reply via email to