[jboss-user] [EJB 3.0] - EJB3 query language

thanukshad do-not-reply at jboss.com
Tue Nov 27 23:49:49 EST 2007


is there a specific way to write sql queries in entity beans in ejb spec 3 rather than normal sql query?

i have defined namedquery as follow.
@NamedQueries( {@NamedQuery(name = "Language.findByAgentCode",
			query = "SELECT l FROM Language l WHERE l.AgentCode = :agentcode")})

but when deploying following exception is thrown

2007-11-28 10:03:31,237 WARN  [org.jboss.system.ServiceController] Problem starting service persistence.units:ear=sdb.ear,jar=sdb3.jar,unitName=Language
javax.persistence.PersistenceException: org.hibernate.HibernateException: Errors in named queries: Language.findByAgentCode
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
	at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

pls help me to solve this problem

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

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



More information about the jboss-user mailing list