| 1 32 33 34 42 package stockonline.ejb.entity.cmp.stockitem; 43 44 import javax.ejb.*; 45 import javax.naming.*; 46 import javax.rmi.*; 47 import javax.sql.*; 48 49 import java.rmi.*; 50 import java.sql.*; 51 import java.util.*; 52 53 import stockonline.util.*; 54 import stockonline.ejb.entity.interf.*; 55 56 60 public class StockItemBean implements EntityBean 61 { 62 final static boolean verbose = false; 63 final static String BEAN_NAME = "cmpStockItem"; 64 65 public int stock_id; 67 public String name; 68 public String code; 69 public float current_val; 70 public float high_val; 71 public float low_val; 72 73 protected EntityContext ctx; 74 private transient boolean isDirty; 76 public StockItemBean() 77 { 78 if (verbose) System.out.println(BEAN_NAME + " instantiated"); 79 } 80 81 85 88 public float getCurrentValue() 89 { 90 if (verbose) 91 System.out.println(BEAN_NAME + ".getCurrentValue() called."); 92 93 return current_val; 94 } 95 96 99 public QueryResult getValues() 100 { 101 if (verbose) 102 System.out.println(BEAN_NAME + ".getValues() called."); 103 104 QueryResult result = new QueryResult(); 105 106 result.current_val = current_val; 107 result.high_val = high_val; 108 result.low_val = low_val; 109 110 return result; 111 } 112 113 117 122 126 public void setEntityContext(EntityContext ctx) 127 { 128 if (verbose) 129 System.out.println(BEAN_NAME + ".setEntityContext() called"); 130 131 this.ctx = ctx; 132 } 133 134 138 public void unsetEntityContext() 139 { 140 if (verbose) 141 System.out.println(BEAN_NAME + ".unsetEntityContext() called"); 142 143 this.ctx = null; 144 } 145 146 public StockItemPK ejbCreate() throws CreateException 147 { 148 if (verbose) 149 System.out.println(BEAN_NAME + ".ejbCreate() called."); 150 151 return null; 152 } 153 154 public void ejbPostCreate() 155 { 156 if (verbose) 157 System.out.println(BEAN_NAME + ".ejbPostCreate() called."); 158 } 159 160 163 public void ejbActivate() 164 { 165 if (verbose) 166 System.out.println(BEAN_NAME + ".ejbActivate() called."); 167 168 setModified(true); 169 } 170 171 174 public void ejbPassivate() 175 { 176 if (verbose) 177 System.out.println(BEAN_NAME + ".ejbPassivate() called."); 178 } 179 180 184 public void ejbRemove() 185 { 186 if (verbose) 187 System.out.println(BEAN_NAME + ".ejbRemove() called."); 188 } 189 190 194 public void ejbLoad() throws RemoteException 195 { 196 if (verbose) 197 System.out.println(BEAN_NAME + ".ejbLoad() called."); 198 199 setModified(false); 200 } 201 202 206 public void ejbStore() throws RemoteException 207 { 208 if (verbose) 209 System.out.println(BEAN_NAME + ".ejbStore() called."); 210 211 setModified(false); 212 } 213 214 227 232 public boolean isModified() 233 { 234 if (verbose) 235 System.out.println (BEAN_NAME + ".isModified(): isDirty = " + (isDirty ? "true" : "false")); 236 237 return isDirty; 238 } 239 240 245 public void setModified(boolean flag) 246 { 247 isDirty = flag; 248 } 249 250 254 } 255 | Popular Tags |