Thomas,

We, as a rule, do not accept patches.  For a complete discussion, please
see:
http://groups.google.com/group/liftweb/browse_frm/thread/0c7a97cbf60780f0?hl=en#

The current state of mapper's primary key support is sub-optimal.  There
have been a couple of discussions of the issues on-list.  I am hoping to
spend some time on this issue on Thursday.  If you've got specific
requirements or specific tests, please post them.

Thanks,

David

On Mon, Sep 21, 2009 at 9:33 PM, Thomas Rampelberg <pyronic...@gmail.com>wrote:

>
> I've been working at getting MetaMapper to work with primary keys that
> aren't auto-generated (or longs). Towards this end, I've got a patch
> for MetaMapper.scala that I'd like to get in. Who could I talk about
> the process for that?
>
> In addition, as part of implementing the functionality, I ran into
> some interesting problems. The most interesting one has to do with
> dbIndexFieldIndicatesSaved_?. The default (i_is_! != defaultValue)
> works great for cases where you're using the default value for the
> actual primary key. Unfortunately, if you use something like this when
> you're actively setting the primary key yourself there are some
> unfortunate side effects (nothing gets saved to the database).
>
> To get around this, I'm doing something along these lines:
>
> class InfoHashPrimaryKey[T<:Mapper[T]] (
>  override val fieldOwner: T) extends MappedStringPrimaryKey[T] (
>    fieldOwner, 20) with LifecycleCallbacks {
>    private var _saved = false
>    override def dbIndexFieldIndicatesSaved_? = _saved
>    override def afterSave = _saved = true
>  }
>
> Would there happen to be a better way to do this? Leveraging an
> afterSave hook seems like potential overkill.
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
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