Hello, 

I'm seeing an oddity.  When I execute the below namequery
(Country.findCountry) the first time one sql statement is created that
fetches all Country objects from the database.  The second time this named
query gets executed it creates a sql query per row in the database (over 200
rows).  It seems like its lazy loading the second time, any ideas on how to
fetch this eagerly or any other ideas to limit the second hit to one query? 
This is using the hibernate driver. 


@Entity
@Table(name = "COUNTRY")
@NamedQueries({...@namedquery(name = "Country.findCountry", query = "SELECT c
FROM Country c")})
public class Country implements Serializable {

   
    @Column(name = "COUNTRY_CODE")
    @Id
    private String countryCode;
    
-- 
View this message in context: 
http://n2.nabble.com/How-to-Setup-a-Named-Query-to-Use-Eager-Fetch-tp4523309p4523309.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to