From: Luke O. <lu...@me...> - 2003-04-30 20:39:53
|
I'd be mighty surprised if this worked, SQLObject makes some fundamental assumptions about having a single column integer key field to uniquely identify objects. "keyless" tables can more easily thought of as composite key tables (for me), and supporting such things in SQLObject would require major modification. (In this case, a composite of person_id and phone_number uniquely identify a record.) Is there a reason you can't add an artificial surrogate key? (Specifically addressing Joins, the query may work but it will then attempt to create PhoneNumber objects for every 'id' returned, as PhoneNumber(id) (really cls(id) ), and this will surely fail. :)) - Luke > How do you create a class that accesses a table with no key? For > example, a Person table references a PhoneNumber where the only 2 > columns are person_id and phone_number (not a reference to another > table > but a phone number)? Currently, you can fudge the values of a > RelatedJoin for the correct query to be generated, e.g. > otherClass=intermediateTable and joinColumn=otherColumn, but are > the > returned values correct? Will operations work correctly? |