Link to home
Start Free TrialLog in
Avatar of prain
prainFlag for United States of America

asked on

EntityManager Query Question

I am learing JPA queries...

In a query like this....

Query q = em.createQuery("Select p from Person p where p.personName = John");

What is p ?

is p a place holder for a column name?

Why is it says Person p - I am confused with that
ASKER CERTIFIED SOLUTION
Avatar of John_Vidmar
John_Vidmar
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prain

ASKER

So what's point of the alias even we have multiple tables involved?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prain

ASKER

so when you say (using above example) p.personName I belive p referes to an object (or an entity). If so personName is the property defined in the Person class. Is that correct?