Possible to not use ID field but another column name? in Lift

Posted by bstevens90 on Stack Overflow See other posts from Stack Overflow or by bstevens90
Published on 2010-06-10T21:47:13Z Indexed on 2010/06/10 21:53 UTC
Read the original article Hit count: 182

Filed under:
|

I am connected to a oracle database from a scala/lift webapp. I have been able to successfully pull information from the database as I wished but am having one issue.

For each table I want to access I am required to add an ID field so that the app will work with the trait IdPK.

What mapper class or trait can I use to override this? I have been trying to find one but been unable to locate it. Figured people have not always had an ID field on every table they make that is just called ID...

class DN_REC extends LongKeyedMapper[DN_REC] with IdPK { 
 def getSingleton = DN_REC 

 object dn_rec_id extends MappedInt(this){
 }

This is what I am talking about. I would like to use the dn_rec_id as my primary key as it is on the table.

Thanks

© Stack Overflow or respective owner

Related posts about scala

Related posts about lift