[Lift] Re: Newbee question Datamapper

2009-10-18 Thread Naftoli Gugenheim
Another approach would be to use a lookup table of durations using LongMappedMapper etc. On Sun, Oct 18, 2009 at 6:49 AM, hyperion wrote: > > Then I would have two tables I suggest. But thank you nevertheless, it > is not so > important, I can live with fields mapping single columns ;). I only >

[Lift] Re: Newbee question Datamapper

2009-10-18 Thread hyperion
Then I would have two tables I suggest. But thank you nevertheless, it is not so important, I can live with fields mapping single columns ;). I only wanted to reduce some redundancy and was interested if it is possible to build such types. On Oct 18, 12:23 am, David Pollak wrote: > On Sat, Oct

[Lift] Re: Newbee question Datamapper

2009-10-17 Thread Naftoli Gugenheim
That was not my solution but harryh's, I believe. Of course the downside of it is that there's a limit of 1 timespan per record. - hyperion wrote: I think my simple solution does not work... and the implementation of MappedPassword is not really easy to under

[Lift] Re: Newbee question Datamapper

2009-10-17 Thread David Pollak
On Sat, Oct 17, 2009 at 2:42 AM, hyperion wrote: > > I think my simple solution does not work... and the implementation of > MappedPassword is not really easy to understand. I thought such > classes > would be nice for datatypes as Currency, Timespan etc... that appear > everwhere > in the applica

[Lift] Re: Newbee question Datamapper

2009-10-17 Thread hyperion
I think my simple solution does not work... and the implementation of MappedPassword is not really easy to understand. I thought such classes would be nice for datatypes as Currency, Timespan etc... that appear everwhere in the application but where own tables are not useful. The solution of Naf

[Lift] Re: Newbee question Datamapper

2009-10-16 Thread David Pollak
On Fri, Oct 16, 2009 at 9:42 AM, Naftoli Gugenheim wrote: > > I think there is support somewhere in the MappedField hierarchy for a > MappedField that represents to database columns. Take a look at > MappedPassword. > Having a field represent two columns (as MappedPassword does) is a huge piece o

[Lift] Re: Newbee question Datamapper

2009-10-16 Thread Naftoli Gugenheim
I think there is support somewhere in the MappedField hierarchy for a MappedField that represents to database columns. Take a look at MappedPassword. - harryh wrote: Make MyMappedTimeSpan a trait: trait MyMappedTimeSpan[T <:Mapper[T]](val owner: T) { obj

[Lift] Re: Newbee question Datamapper

2009-10-16 Thread harryh
Make MyMappedTimeSpan a trait: trait MyMappedTimeSpan[T <:Mapper[T]](val owner: T) { object from extends MappedTime[MapperType](this.asIntanceOf [MatterType]) object to extends MappedTime[MapperType](this.asIntanceOf [MatterType]) } And then use it like so: class DBObject extends LongKeyedM