1 28 29 30 package org.objectweb.jonas_ejb.container.jorm; 31 32 import javax.ejb.EntityBean ; 33 34 import org.objectweb.jonas_ejb.container.JEntityFactory; 35 import org.objectweb.jorm.naming.api.PName; 36 37 44 public class JEntityContext 45 extends org.objectweb.jonas_ejb.container.JEntityContext { 46 47 public JEntityContext(JEntityFactory bf, EntityBean eb) { 48 super(bf, eb); 49 } 50 51 59 public Object getPrimaryKey() throws IllegalStateException { 60 PName pn = (PName) super.getPrimaryKey(); 61 Coder c = (Coder) bf.getLocalHome(); 62 if (c==null) { 63 c = (Coder) bf.getHome(); 64 } 65 try { 66 return c.encode(pn); 67 } 68 catch (Exception e) { 69 throw new IllegalStateException ("Inner: Encoding error:" 70 + e.getMessage()); 71 } 72 } 73 } 74 | Popular Tags |