geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Radu Dumitrescu" <...@pss.ro>
Subject Help with finder method
Date Thu, 22 Feb 2007 10:09:53 GMT
Hello,

I have a problem with a findAll method. I will describe the context of the application:
I have a Customer CMP and an Account CMP that have one to many relationship (a customer can
have multiple accounts). The Account table has a foreign key field that links it to the Customer
table. The Account CMP has a field customer linked with the Customer CMP. I have a finder
findAll method in Account bean. 
When I try to call the findAll I get an SQL exception: An attempt was made to get a data value
of type 'java.io.InputStream' from a data value of type 'INTEGER'. I think it tries to load
the whole Customer data from the foreign key field ...
The findByPrimaryKey from the Account CMP works perfect and loads the customer field with
correct data, so I belive the relationship between Account and Customer works. I use XDoclet
to generate my beans and this is how findAll method is defined:

* @ejb.finder 
 *    query="SELECT OBJECT(account) FROM EstimateSCHEMA as account"  
 *    signature="java.util.Collection findAll()"

Thanks,
Radu Dumitrescu
Mime
View raw message