1 25 26 package org.objectweb.jonas.jtests.beans.relation.s2pkcomp; 27 28 import org.objectweb.util.monolog.api.Logger; 29 import org.objectweb.util.monolog.api.BasicLevel; 30 import org.objectweb.jonas.common.Log; 31 32 import javax.ejb.EntityContext ; 33 import javax.ejb.CreateException ; 34 import javax.ejb.DuplicateKeyException ; 35 import javax.ejb.RemoveException ; 36 37 40 public abstract class BEC2 implements javax.ejb.EntityBean { 41 42 public abstract String getId1(); 46 public abstract void setId1(String id1); 47 public abstract int getId2(); 48 public abstract void setId2(int id2); 49 public abstract ALocal getA(); 50 public abstract void setA(ALocal al); 51 52 56 static protected Logger logger = null; 57 EntityContext ejbContext; 58 59 public void m1(){ 60 } 61 62 public Pk getId(){ 63 return (Pk) ejbContext.getPrimaryKey(); 64 } 65 66 72 public Pk ejbCreate(String id1, int id2) throws CreateException , DuplicateKeyException { 73 logger.log(BasicLevel.DEBUG, ""); 74 75 setId1(id1); 77 setId2(id2); 78 79 return null; 81 } 82 83 93 public void setEntityContext(EntityContext ctx) { 94 if (logger == null) 95 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 96 logger.log(BasicLevel.DEBUG, ""); 97 ejbContext = ctx; 98 } 99 100 111 public void unsetEntityContext() { 112 logger.log(BasicLevel.DEBUG, ""); 113 ejbContext = null; 114 } 115 116 public Pk retrieveA() { 117 ALocal lejbA = getA(); 118 if (lejbA==null) 119 return null; 120 else 121 return lejbA.getId(); 122 } 123 124 public Pk retrieveAInNewTx() { 125 return retrieveA(); 126 } 127 128 141 public void ejbRemove() throws RemoveException { 142 logger.log(BasicLevel.DEBUG, ""); 143 } 144 145 153 public void ejbLoad() { 154 logger.log(BasicLevel.DEBUG, ""); 155 } 156 157 165 public void ejbStore() { 166 logger.log(BasicLevel.DEBUG, ""); 167 } 168 169 174 public void ejbPostCreate(String id1, int id2) throws CreateException { 175 logger.log(BasicLevel.DEBUG, "id1="+id1+", id2="+id2); 176 } 177 178 182 public void ejbPassivate() { 183 logger.log(BasicLevel.DEBUG, ""); 184 } 185 186 191 public void ejbActivate() { 192 logger.log(BasicLevel.DEBUG, ""); 193 } 194 195 } 196 197 | Popular Tags |