users@glassfish.java.net

Different Results: NativeQuery vs NamedQuery

From: Dennis Gesker <dennis_at_gesker.com>
Date: Wed, 24 Sep 2008 08:45:36 -0600

I have an Entity (Pole) that contains a number of ManyToOne relationships.

When I use the autogenerated "Pole.findAll" named query all the results in
the table are returned. When I used a nativequery [SELECT * FROM pole] only
a few records are returned. Also, when the collection is returned from the
session bean to my backing bean for display in a JSF page the results appear
empty.

Why would the number of records returned be different?


Dennis