cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph P. Berglund" <>
Subject non meaningful pk philosophy, and composite pk question
Date Fri, 17 Dec 2010 19:57:59 GMT
I am new to cayenne, and am enjoying it immensely! A few questions- 

A1) I understand that the use of automatically generated, non-meaningful primary keys is one
of the philosophies supported by cayenne.

In this instance, what is the best practice method of referring to a row in a web based application
when I do not have direct access to the primary key? 

I am assuming that I should create a UNIQUE attribute, like "name", that I can use to refer
to that row, but I want to make sure that is the right track.

A2) If that is the case, are there any plans to implement easy access to the object through
the data context / data object without an expression (and without me writing it in my generic
wrapper object)? I.E. it would be nice if unique, non-pk rows could be access from the object
itself... (I.e. when I need to grab a user name, performing User user = User.forName("joe")
would rock my socks)

B) Much of the data I am dealing with I have defined with composite primary keys. With web
applications, this involves me passing each key individually in an HTTP request. Is there
any easy way I can pass a record identity for a composite primary key.? I have looked at the
ObjectID, but from what I have seen, serializing/deserializing this requires more overhead
than I am comfortable with as I dont need a specific reference to the ObjectID class, but
to the row the class is identifying.

joey b.


View raw message