Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stop retrieving subclass instances ?

 
david zhang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a named query as follows:

@NamedQuery (name="emp", query="from Employee")

Employee has subclasses such PartTimeEmployee.

When I run the above query, the results contain instances from PartTimeEmployee table.

How can I retrieve only instances from Employee, not PartTimeEmployee?

I am new in JPA. Thanks for help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic