1 25 26 package org.objectweb.jonas.jtests.beans.sequence; 27 28 import javax.ejb.CreateException ; 29 import javax.ejb.EntityBean ; 30 import javax.ejb.EntityContext ; 31 import javax.ejb.RemoveException ; 32 33 34 38 public abstract class SequenceEC2 implements EntityBean { 39 40 protected EntityContext entCtx; 41 42 49 public String ejbCreate(String id, int firstNumber) throws CreateException { 50 setId(id); 51 setNextNumber(firstNumber); 52 return null; 53 } 54 55 60 public void ejbPostCreate(String id, int firstNumber) { 61 } 62 63 67 public void ejbRemove() throws RemoveException { 68 } 69 70 74 public abstract String getId(); 75 76 80 public abstract void setId(String id); 81 82 86 public abstract int getNextNumber(); 87 88 92 public abstract void setNextNumber(int nextNumber); 93 94 97 public void ejbActivate() { 98 99 } 100 101 104 public void ejbPassivate() { 105 106 } 107 108 111 public void ejbLoad() { 112 } 113 114 117 public void ejbStore() { 118 119 } 120 121 125 public void setEntityContext(EntityContext entCtx) { 126 this.entCtx = entCtx; 127 } 128 129 132 public void unsetEntityContext() { 133 this.entCtx = null; 134 } 135 136 139 public int getUniqPk() { 140 int ret = getNextNumber(); 141 setNextNumber(++ret); 142 return ret; 143 } 144 145 } 146 147 | Popular Tags |