ObjectInputStream ois,
byte[] object,
ClassLoader classloader) throws IOException,
ClassNotFoundException {
DroolsObjectInputStream is = new DroolsObjectInputStream( new ByteArrayInputStream( object ), classloader );
String canonicalName = is.readUTF();
Object id = is.readObject();
EntityManagerFactory emf = (EntityManagerFactory) env.get(EnvironmentName.ENTITY_MANAGER_FACTORY);
EntityManager em = emf.createEntityManager();
return em.find(Class.forName(canonicalName), id);
}