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!

Peter

On Oct 8, 11:28 pm, harryh <har...@gmail.com> 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to