From: Seaman, S. <Slo...@pt...> - 2004-09-15 18:57:06
|
I have a view in a database that does not have a defined primary key (it's a legacy db schema... real ugly) and I want to just get data from it (read-only). If I don't define one of the columns as a primary key I get : javax.jdo.JDOFatalUserException: No primary key has been set for table specinfo.well_dump. XORM requires a primary key column in order to map a Java class to this table. To get around this I set the column TISSUEID as the primary key I query the view like so: select * from specinfo.well_dump where TISSUEID = 'WE337001' I expect to get back 627 rows, which I do. But when I go through the collection returned from the query, it is the same object 627 times! I assume this is some sort of caching thing in XORM, but all of the other fields occur at least once as well. How do I then get around the Primary Key error? Here is my table definition (w/o primary key) : <table name="specinfo.well_dump"> <column name="TISSUEID" type="java.lang.String" read-only="true"/> <column name="PLATE_ID" type="int" read-only="true"/> <column name="PLATE_LABEL" type="java.lang.String" read-only="true"/> <column name="WELL" type="java.lang.String" read-only="true"/> <column name="CELL_COUNT" type="int" read-only="true"/> </table> -- Sloan |