[jboss-user] [Beginners Corner] - Re: javax.persistence.PersistenceException: org.hibernate.ex

soundarya do-not-reply at jboss.com
Fri Sep 29 08:22:06 EDT 2006


the session bean is has these annotations.


@Stateless
public class LicenseOrganizerBean 
	
{
	@PersistenceContext
	private EntityManager entityManager;

        public License getLicense( Long id )
	{
		final List existing = 
			entityManager.createQuery( "SELECT OBJECT(o) FROM License AS o WHERE o.id=:id" )
			.setParameter("id", id )
			.getResultList();
		if( existing.size() == 0 )
		{
			return null;
		}
		return (License) existing.get( 0 );
	}
}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975133#3975133

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975133



More information about the jboss-user mailing list