Hi guys,
I'm using hibernate to connect MySQL DB, I made a persistence-unit like below and added my class in it:
in my config file, I made an entity manager factory bean and added the data source in it:
The person class in an entity and a table.
now... when I wanna run this Query, I see an exception:
the exception is:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [SELECT * FROM com.example.domain.Person P WHERE P.userName = UserName]
my Query is right.. why I see this exception?!
I changed my Query to this:
then I saw this:
org.hibernate.QueryException: could not resolve property: FirstName of: com.example.domain.Person [SELECT P.userName, P.password, P.FirstName, P.LastName FROM com.example.domain.Person P WHERE P.userName = UserName]
my domain class is:
what should I do?! please help me