1 22 package org.jboss.test.testbeancluster.bean; 23 24 25 import javax.ejb.EntityBean ; 26 import javax.ejb.EntityContext ; 27 import javax.ejb.CreateException ; 28 import javax.ejb.RemoveException ; 29 30 import org.jboss.test.testbean.interfaces.AComplexPK; 31 import org.jboss.logging.Logger; 32 33 37 public abstract class EntityPKBean implements EntityBean 38 { 39 private static Logger log = Logger.getLogger(EntityPKBean.class); 40 41 private EntityContext entityContext; 42 43 public AComplexPK ejbCreate(boolean aBoolean, int anInt, long aLong, 44 double aDouble, String aString) 45 throws CreateException 46 { 47 log.debug("ejbCreate() called"); 48 updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString)); 49 return null; 50 } 51 52 public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt, long aLong, 53 double aDouble, String aString) 54 throws CreateException 55 { 56 log.debug("ejbCreateMETHOD() called"); 57 updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString)); 58 return null; 59 } 60 61 public void ejbPostCreate(boolean aBoolean, int anInt, long aLong, 62 double aDouble, String aString) 63 throws CreateException 64 { 65 log.debug("ejbPostCreate(pk) called"); 66 } 67 68 public void ejbPostCreateMETHOD(boolean aBoolean, int anInt, long aLong, 69 double aDouble, String aString) 70 throws CreateException 71 { 72 log.debug("ejbPostCreateMETHOD(pk) called"); 73 } 74 75 public void ejbActivate() 76 { 77 log.debug("ejbActivate() called"); 78 } 79 80 public void ejbLoad() 81 { 82 log.debug("ejbLoad() called"); 83 } 84 85 public void ejbPassivate() 86 { 87 log.debug("ejbPassivate() called"); 88 } 89 90 public void ejbRemove() throws RemoveException 91 { 92 93 log.debug("EntityPK.ejbRemove() called"); 94 } 95 public void ejbStore() 96 { 97 log.debug("ejbStore() called"); 98 } 99 100 public void setEntityContext(EntityContext context) 101 { 102 log.debug("setSessionContext() called"); 103 entityContext = context; 104 } 105 106 public void unsetEntityContext() 107 { 108 log.debug("unsetSessionContext() called"); 109 entityContext = null; 110 } 111 112 public void updateAllValues(AComplexPK aComplexPK) 113 { 114 setABoolean(aComplexPK.aBoolean); 115 setADouble(aComplexPK.aDouble); 116 setALong(aComplexPK.aLong); 117 setAnInt(aComplexPK.anInt); 118 setAString(aComplexPK.aString); 119 } 120 121 public AComplexPK readAllValues() 122 { 123 return new AComplexPK(getABoolean(), getAnInt(), getALong(), getADouble(), 124 getAString()); 125 } 126 127 public abstract boolean getABoolean(); 128 public abstract void setABoolean(boolean value); 129 130 public abstract double getADouble(); 131 public abstract void setADouble(double value); 132 133 public abstract long getALong(); 134 public abstract void setALong(long value); 135 136 public abstract int getAnInt(); 137 public abstract void setAnInt(int value); 138 139 public abstract String getAString(); 140 public abstract void setAString(String value); 141 142 public abstract int getOtherField(); 143 public abstract void setOtherField(int newValue); 144 145 } 146 | Popular Tags |