trait Foo[A <: Mapper[A]] { self: MetaMapper[A] => }
On Wed, Jul 29, 2009 at 1:38 PM, fbettag <fr...@bett.ag> wrote: > > Yes thanks, it gives me an idea of the issue which i now see. > Could you provide a very simple example on how you would make the Meta- > Mixin? > That would be very good > > best regards > > > On 29 Jul., 21:55, David Pollak <feeder.of.the.be...@gmail.com> wrote: > > On Tue, Jul 28, 2009 at 5:12 PM, fbettag <fr...@bett.ag> wrote: > > > > > So far it looks like this: > > > > > trait Stamped[OwnerType <: Stamped[OwnerType] with LongKeyedMapper > > > [OwnerType] with IdPK] { > > > this: OwnerType => > > > > > private val thisTyped = this.asInstanceOf[MapperType] > > > > > override def afterSave { > > > createActionLog("create", this.getClass.toString, > this.id) > > > } > > > > There's no afterSave method on Mapper... that method is on MetaMapper. > > > > You need to split your trait into two pieces... one that will be mixed > into > > the model instances and one that'll be mixed into the Meta model > singleton > > (or perhaps just one mixed into the Meta). > > > > In terms of the afterSave (and other before and after stuff) method on > > MetaMapper, that method returns a List of functions that take the > instance > > as a model that's being saved and does something. I've changed the > > signature to List[A => Unit] rather than List[A => Any] to avoid > confusion > > about the fact that the functions are not meant to return anything. > > > > Does this help? > > > > -- 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 -~----------~----~----~----~------~----~------~--~---