File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Stop retrieving subclass instances ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Stop retrieving subclass instances ? " Watch "Stop retrieving subclass instances ? " New topic
Author

Stop retrieving subclass instances ?

david zhang
Greenhorn

Joined: Oct 12, 2003
Posts: 27
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!
 
 
subject: Stop retrieving subclass instances ?
 
Threads others viewed
Hibernate- why my query results are caching?
Steps to execute a query
java report data grouping
show query
Deleting Record in a Web Application.
IntelliJ Java IDE