perhaps it helps to set fetchDataRows to true http://cayenne.apache.org/doc12/data-rows.html
its just a guess
-----Ursprüngliche Nachricht-----
Von: Dave Merrin [mailto:dmerri..pasystems.co.uk]
Gesendet: Mittwoch, 6. Juni 2007 16:12
An: use..ayenne.apache.org
Betreff: Select Query on Table with no Primary Key
Hi,
I'm trying to run a SelectQuery on a table with no primary key.
Unfortunately it's not working. Can anybody help? I have no control over
the database so I can't add in primary keys.
Cheers,
Dave
INFO QueryLogger: SELECT t0.ID, t0.KIND, t0.TIMESTAMP FROM
MPS.STATETABLE_CPT t0
INFO QueryLogger: === returned 949 rows. - took 203 ms.
INFO QueryLogger: +++ transaction committed.
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
[v.2.0.3 May 6 2007] Won't be able to create ObjectId for
'StatetableCpt'. Reason: DbEntity 'STATETABLE_CPT' has no Primary Key
defined.
at
org.apache.cayenne.access.ObjectResolver.init(ObjectResolver.java:75)
at
org.apache.cayenne.access.ObjectResolver.<init>(ObjectResolver.java:57)
at
org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:319)
at
org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:116)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
at
org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
at
org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
at
org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
at
org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1376)
at
ipa.printexpress.datahelpers.Session.fetchEntityCollection(Session.java:158)
at
ipa.px.importer.abb.ABBImporterMain.main(ABBImporterMain.java:109)
This archive was generated by hypermail 2.0.0 : Wed Jun 06 2007 - 10:40:27 EDT