-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Annotations with JBoss 5
PostPosted: Thu May 28, 2009 7:15 am 
Newbie

Joined: Thu May 28, 2009 7:10 am
Posts: 1
Hello,

I am upgrading to JBoss AS 5 and am migrating from 4.2. I had no problem creating JDK 5 based Hibernate annotations for my POJO's and used typical JNDI to get the entity manager for these annotated pojos.

JBoss 5 changed this usage and I am no longer able to create the entity manager (code below)

Object o = getJNDIResource(entityManagerName);

if(o instanceof org.jboss.ejb3.entity.InjectedEntityManagerFactory)
{
InjectedEntityManagerFactory factory = (InjectedEntityManagerFactory)o;

entityManager = factory.getEntityManager();
}

Clearly the package structure has changed but I have had no success in obtaining an EM that will recognize the fact that the domain objects do not have backing hbm.xml constructs but are only annotated.

This code worked in getting an EM, however the query resulted in no rows:

if(o instanceof org.jboss.jpa.injection.InjectedEntityManagerFactory)
{
org.jboss.jpa.injection.InjectedEntityManagerFactory factory = (org.jboss.jpa.injection.InjectedEntityManagerFactory)o;

entityManager = factory.createEntityManager();
}

Any help is repaid with cookies.

Peter


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.