I've not used SQLTemplate, but it looks to me like you have a List of
faults. Trying to do something with those 10 Company objects will
probably fault them in from the database.
/dev/mrg
-----Original Message-----
From: news [mailto:new..ea.gmane.org] On Behalf Of Bryan Lewis
Sent: Thursday, September 09, 2004 12:07 PM
To: cayenne-use..bjectstyle.org
Subject: how to use SQLTemplate
I must be missing something about SQLTemplate. I updated to version
1.1B2 and tried a simple example like the one in the User Guide:
String sql = "SELECT * FROM COMPANY";
SQLTemplate query = new SQLTemplate(Company.class, sql, true);
query.setFetchLimit(10);
List companies = dataContext.performQuery(query);
log.debug("companies = " + companies);
I get a list of 10 empty objects.
companies = [{[]<oid: model.Company: <Company_ID: null>; state: hollow>}
, {[]<oid: model.Company: <Company_ID: null>; state:
hollow>}
...
I see that other people are using SQLTemplate; what am I missing?
Thanks,
Bryan
This archive was generated by hypermail 2.0.0 : Thu Sep 09 2004 - 13:34:07 EDT