[Database.Persistent] Custom Id field

Hi All. I want to access database in a project where almost all objects has primary keys named idx, not Id. How can I define persistent object with key idx not Id? Another problem is that idx is not serial, just integer, and must be set explicitly. Is persistent capable for such tasks?

On Sat, Oct 22, 2011 at 10:22 AM, Konstantin Litvinenko
Hi All.
I want to access database in a project where almost all objects has primary keys named idx, not Id. How can I define persistent object with key idx not Id? Another problem is that idx is not serial, just integer, and must be set explicitly. Is persistent capable for such tasks?
For now, it looks like the Persistent codebase hardcodes the field to be "id". That should be fairly easy to change. The harder bit is dealing with the fact that it needs to be set explicitly. That means you won't be able to use the "insert" function at all, but everything else should (in theory) work. Michael
participants (2)
-
Konstantin Litvinenko
-
Michael Snoyman