openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Beer <david.m.b...@btinternet.com>
Subject @OneToMany Strange Behaviour
Date Sun, 10 Feb 2008 23:46:25 GMT
Hi All

I am using the following code to set my OneToMany relationship,

@OneToMany(cascade=CascadeType.ALL)
private List<AdditionalInformation> addInfo;

I am able to persist the data properly to the database, the problem is 
that when I run the following query, Query query = 
manager.createQuery("SELECT a FROM Entry a"); I get List of all results 
as expected, but the addInfo value is empty even though there is data 
associated with that result in the database.

Tables

ENTRY - contains all data
ADDITIONALINFORMATION
ENTRY_ADDITIONALINFORMATION - conatains IDs of both ENTRY and 
ADDITIONALINFORMATION

When I retrieve data from ENTRY there is no id or link to any other 
table. How am I supposed to find out if an Entry has any 
ADDITIONALINFORMATION.

Thanks

David

Mime
View raw message