• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stop retrieving subclass instances ?  RSS feed

 
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!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!