On Fri, Oct 9, 2009 at 1:17 AM, Peter Robinett <[email protected]>wrote:
> > Hi Harry, > > I think you also need to set override def dbAutogenerated_? = false > > I've used dbAutogenerated_? and writePermission_? with > MappedStringIndex but I also had to redefine dirty_?, which hopefully > you won't have to do. If you do a search through this group you can > find my thread on it. However, my solution isn't complete, as Mapper > always tries to INSERT a row instead of UPDATE, the exact inverse of > your problem! > > See ticket #90 http://github.com/dpp/liftweb/issues#issue/90 There's a patch on dpp_wip_issue_90 > Peter > > On Oct 8, 11:28 pm, harryh <[email protected]> wrote: > > LongKeyedMapper object where I can set the id. > > > > I want a database object where I set the primary key myself (rather > > than having it be sequentially by the database). I thought I could do > > this: > > > > class Tombstone extends LongKeyedMapper[Tombstone] { > > def getSingleton = Tombstone > > > > def primaryKeyField = id > > object id extends MappedLongIndex(this) { > > override def writePermission_? = true > > } > > > > } > > > > object Tombstone extends Tombstone with LongKeyedMetaMapper[Tombstone] > > { > > override def dbTableName = "tombstones" > > > > } > > > > But when I do Tombstone.create.id(12).save it does an UPDATE instead > > of an INSERT. Is there any good way to do what I want here? > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
