1 22 package org.jboss.test.dbtest.bean; 23 24 import java.rmi.*; 25 import javax.ejb.*; 26 import java.util.Collection ; 27 import java.util.ArrayList ; 28 29 import javax.naming.Context ; 30 import javax.naming.InitialContext ; 31 import java.sql.Date ; 32 import java.sql.Time ; 33 import java.sql.Timestamp ; 34 import org.jboss.test.dbtest.interfaces.MyObject; 35 36 37 public class AllTypesBean implements EntityBean { 38 public boolean aBoolean; 39 public byte aByte; 40 public short aShort; 41 public int anInt; 42 public long aLong; 43 public float aFloat; 44 public double aDouble; 45 public String aString; 47 public Date aDate; 48 public Time aTime; 49 public Timestamp aTimestamp; 50 51 public MyObject anObject; 52 53 public Collection aList; 54 55 private EntityContext entityContext; 56 57 58 public String ejbCreate(String pk) throws RemoteException, CreateException { 59 return ejbCreate(true, (byte)1, (short)2, (int)3, (long)4, (float)5.6, 60 (double)7.8, pk, new Date (System.currentTimeMillis()), 61 new Time (System.currentTimeMillis()), 62 new Timestamp (System.currentTimeMillis()), new MyObject()); 63 } 64 65 public void ejbPostCreate(String pk) 66 throws RemoteException, CreateException {} 67 68 69 public String ejbCreate(boolean aBoolean, byte aByte, short aShort, int anInt, 70 long aLong, float aFloat, double aDouble, String aString, 71 Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject ) 72 73 throws RemoteException, CreateException { 74 75 this.aBoolean = aBoolean; 76 this.aByte = aByte; 77 this.aShort = aShort; 78 this.anInt = anInt; 79 this.aLong = aLong; 80 this.aFloat = aFloat; 81 this.aDouble = aDouble; 82 this.aString = aString; 84 this.aDate = aDate; 85 this.aTime = aTime; 86 this.aTimestamp = aTimestamp; 87 this.anObject = anObject; 88 89 aList = new ArrayList (); 90 91 return null; 92 } 93 94 95 public void ejbPostCreate(boolean aBoolean, byte aByte, short aShort, int anInt, 96 long aLong, float aFloat, double aDouble, String aString, 97 Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject ) 98 99 throws RemoteException, CreateException {} 100 101 public void ejbActivate() throws RemoteException {} 102 103 public void ejbLoad() throws RemoteException {} 104 105 public void ejbPassivate() throws RemoteException {} 106 107 public void ejbRemove() throws RemoteException, RemoveException {} 108 109 public void ejbStore() throws RemoteException {} 110 111 112 public void setEntityContext(EntityContext context) throws RemoteException { 113 entityContext = context; 114 } 115 116 public void unsetEntityContext() throws RemoteException { 117 entityContext = null; 118 } 119 120 121 public void updateAllValues(boolean aBoolean, byte aByte, short aShort, int anInt, 122 long aLong, float aFloat, double aDouble, String aString, 123 Date aDate, Time aTime, Timestamp aTimestamp, MyObject anObject ) { 124 125 this.aBoolean = aBoolean; 126 this.aByte = aByte; 127 this.aShort = aShort; 128 this.anInt = anInt; 129 this.aLong = aLong; 130 this.aFloat = aFloat; 131 this.aDouble = aDouble; 132 this.aString = aString; 134 this.aDate = aDate; 135 this.aTime = aTime; 136 this.aTimestamp = aTimestamp; 137 this.anObject = anObject; 138 139 } 140 141 public void addObjectToList(Object anObject) throws RemoteException { 142 aList.add(anObject); 143 } 144 145 public void removeObjectFromList(Object anObject) throws RemoteException { 146 aList.remove(anObject); 147 } 148 149 public Collection getObjectList() throws RemoteException { return aList; } 150 151 public boolean getBoolean() throws RemoteException { return aBoolean; } 152 public byte getByte() throws RemoteException { return aByte; } 153 public short getShort() throws RemoteException { return aShort; } 154 public int getInt() throws RemoteException { return anInt; } 155 public long getLong() throws RemoteException { return aLong; } 156 public float getFloat() throws RemoteException { return aFloat; } 157 public double getDouble() throws RemoteException { return aDouble; } 158 public String getString() throws RemoteException { return aString; } 160 public Date getDate() throws RemoteException { return aDate; } 161 public Time getTime() throws RemoteException { return aTime; } 162 public Timestamp getTimestamp() throws RemoteException { return aTimestamp; } 163 164 public MyObject getObject() throws RemoteException { return anObject; } 165 166 public void setByte(byte b) {aByte = b;} 167 public void setShort(short s) {aShort = s;} 168 public void setInt(int i) {anInt = i;} 169 public void setLong(long l) {aLong = l;} 170 public void setFloat(float f) {aFloat = f;} 171 public void setDouble(double d) {aDouble = d;} 172 } 173 | Popular Tags |