> Sorry, just noticed that you are calling createNativeQuery so ignore my last comment.
> can you execute the query directly in a SQL client?
> On 15 Mar 2012, at 19:41, Stikkos wrote:
>> Do you have a property called skill_id or user_id in the UserHasSkills entity? Or are these the name of the database column?
>> In your query you need to use the entity parameter names (and not the DB column names).
>> On 15 Mar 2012, at 19:23, Ferreira wrote:
>>> Hi, can some one tell me why this doen't work?
>>> thanks in advance
>>> this works fine but is to much information
>>> String queryString="SELECT FROM User as u INNER JOIN Skill as sk";
>>> List<Object[]> list = JPA.em().createNativeQuery(queryString).getResultList();
>>> but when i try to get just from a user, it doesn't work
>>> Execution exception
>>> PersistenceException occured : org.hibernate.exception.SQLGrammarException: could not execute query
>>> String queryString ="SELECT uhs.*, sk.* FROM UserHasSkills uhs"+
>>> "LEFT JOIN User us ON us.id = uhs.id"+
>>> "LEFT JOIN skill sk ON sk.id = uhs.skill_id"+
>>> "WHERE uhs.user_id=1";
>>> List<Object[]> list = JPA.em().createNativeQuery(queryString).getResultList();
>>> --
>>> You received this message because you are subscribed to the Google Groups "play-framework" group.
>>> To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/OAXtSiHfWDkJ.
>>> To post to this group, send email to play-framework@googlegroups.com.
>>> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.