This content has been marked as final.
Show 2 replies
-
1. Re: error in your SQL syntax
mazz Jun 11, 2007 8:40 AM (in response to albtorresmo)Look at the name of the table its using:
'.users users0_'
See the "." right before users? I don't know for sure, but it looks to me like that is missing the schema name (not sure what MySQL calls it - database name? username?)
You probably just have to configure your persistence.xml a little more to tell Hibernate the schema name.
Just a thought - I have no idea if what I just said is right :) But for sure it seems like ".users" isn't right - table names don't have dots as their first character. -
2. Re: error in your SQL syntax
waynebaylor Jun 11, 2007 9:26 AM (in response to albtorresmo)You can't use "normal" SQL in the createQuery method, you have to use JPA QL.
So, try this:List<User> users = em.createQuery("from "+User.class).getResultList();
You'll get a list of User objects and you can filter out the usernames from that.