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

mazz@jboss.com do-not-reply at jboss.com
Wed Nov 28 01:42:22 EST 2007


I see.  You are thinking too much in the SQL world - you're in the land of JPA now :) Must think in terms of the JPQL query language.  @NamedQueries are written in JPQL, not SQL.

Your table name is Language but your entity is "Language3".  Your column is "AgentCode" but you mapped the field "agentCode" (again, on this point I am not sure - does case matter?  I am not sure but I would assume case-sensitivity just to be sure and use agentCode in your query).

Your named query should be:

SELECT L FROM Language3 L WHERE L.agentCode = :agentCode

I suggest you go through some EJB3/JPA tutorials, specifically those that introduce the JPA querying concepts and JPQL.

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

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



More information about the jboss-user mailing list