Possible to not use ID field but another column name? in Lift
- by bstevens90
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