[Lift] Re: Stamped Trait question

2009-07-30 Thread fbettag
Thank you very much. It works great now :) On 30 Jul., 04:43, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 29, 2009 at 5:54 PM, fbettag fr...@bett.ag wrote: Now the last and final question: how would i go about and add this to the trait: object test extends

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
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

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
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

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
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

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
Hm. i changed it to this: trait Stamped[OwnerType : Mapper[OwnerType] with IdPK] { self: MetaMapper[OwnerType] = private val thisTyped = this.asInstanceOf[MapperType] override def afterSave: List[Any] = { createActionLog(create, this.getClass.toString,

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
It's not pretty, but: trait MyLogger[A : KeyedMapper[K, A], K] extends KeyedMetaMapper[K,A] { self: A with MetaMapper[A] with KeyedMapper[K, A] = override def afterSave = doSomething _ :: super.afterSave private def doSomething(in: A) { println(Got +in) } } On Wed, Jul 29, 2009

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
how would i use that trait? with MyLogger[MyModel, MyModel] ? What is A and what is K supposed to be? On 30 Jul., 00:55, David Pollak feeder.of.the.be...@gmail.com wrote: It's not pretty, but: trait MyLogger[A : KeyedMapper[K, A], K] extends KeyedMetaMapper[K,A] {    self: A  with

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
Btw. the docs for KeyedMapper don't work.. http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/KeyedMapper.html when i click on KeyType or OwnerType it gives me a 404.. On 30 Jul., 00:55, David Pollak feeder.of.the.be...@gmail.com wrote: It's not pretty, but: trait MyLogger[A :

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
On Wed, Jul 29, 2009 at 4:21 PM, fbettag fr...@bett.ag wrote: Btw. the docs for KeyedMapper don't work.. http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/KeyedMapper.html when i click on KeyType or OwnerType it gives me a 404.. This is a limitation of vscaladoc... sorry.

[Lift] Re: Stamped Trait question

2009-07-29 Thread Kevin Wright
On Thursday, July 30, 2009, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 29, 2009 at 4:21 PM, fbettag fr...@bett.ag wrote: Btw. the docs for KeyedMapper don't work.. http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/KeyedMapper.html when i click on KeyType

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
K is the type of the primary key: object MyModel extends MyModel with KeyedMetaMapper[Long, MyModel] with MyLogger[MyModel, Long] On Wed, Jul 29, 2009 at 4:18 PM, fbettag fr...@bett.ag wrote: how would i use that trait? with MyLogger[MyModel, MyModel] ? What is A and what is K supposed to

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
Okay i got this so far, only one tiny thing i can't get to work now: trait Stamped[A : LongKeyedMapper[A]] extends KeyedMetaMapper[Long, A] { self: A with MetaMapper[A] with KeyedMapper[Long, A] = private val thisTyped = this.asInstanceOf[MapperType] override def

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
trait Stamped[A : LongKeyedMapper[A] with IdPK] extends KeyedMetaMapper[Long, A] { self: A with MetaMapper[A] with KeyedMapper[Long, A] = override def afterSave = createSaveLog _ :: super.afterSave override def afterUpdate = createUpdateLog _ :: super.afterSave

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
And the final version: trait Stamped[A : LongKeyedMapper[A] with IdPK] extends KeyedMetaMapper[Long, A] { self: A with MetaMapper[A] with KeyedMapper[Long, A] = override def afterSave = (createLog(_: A, create)) :: super.afterSave override def afterUpdate = (createLog(_:

[Lift] Re: Stamped Trait question

2009-07-29 Thread fbettag
Now the last and final question: how would i go about and add this to the trait: object test extends MappedBoolean(this) ? i tried: private val thisTyped = this.asInstanceOf[A] object published extends MappedBoolean(thisTyped) and just this and self. Any ideas? On 30 Jul.,

[Lift] Re: Stamped Trait question

2009-07-29 Thread David Pollak
On Wed, Jul 29, 2009 at 5:54 PM, fbettag fr...@bett.ag wrote: Now the last and final question: how would i go about and add this to the trait: object test extends MappedBoolean(this) ? You can't add this to a MetaMapper trait, it must be part of a trait that's mixed into the Mapper. Look

[Lift] Re: Stamped Trait question

2009-07-28 Thread fbettag
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,