On Thu, Dec 10, 2009 at 9:27 AM, Peter Robinett <pe...@bubblefoundry.com>wrote:

> I believe David has said that having MappedPassword represent two
> columns is one of his great regrets, so watch out! ;-)
>

Yeah... it's the single worst design decision I made in Lift (and I've made
a non-trivial number of bad decisions... and no, I don't know what all of
them are).


>
> Peter
>
> On Dec 10, 9:17 am, Derek Chen-Becker <dchenbec...@gmail.com> wrote:
> > IMHO this doesn't sound like an ideal way to do this. At a high level
> what
> > are you trying to do? Is this a legacy DB or starting from scratch? If I
> had
> > to do something like this I would instead use something like
> > MappedLongForeignKey so that you have a direct reference to the other
> tables
> > instead of having to do it manually. Something like:
> >
> > class C extends LongKeyedMapper[C] with IdPK {
> >   def getSingleton = C
> >
> >   object refA extends MappedLongForeignKey(this,A)
> >   object refB extends MappedLongForeignKey(this,B)
> >
> >   def getRef = refA.obj or refB.obj
> >
> >   def setRef(obj : A) = refA(obj); refB(Empty)
> >   def setRef(obj : B) = refB(obj); refA(Empty)
> >
> > }
> >
> > Derek
> >
> >
> >
> > On Wed, Dec 9, 2009 at 9:44 PM, Joern <joern.bernha...@gmx.net> wrote:
> > > Hi there,
> >
> > > I want to create a MappedField, which has one column as Type Long and
> > > another column as Type Boolean, but I don't know, what I should put
> > > into "dbFieldClass" and/or targetSQLType. If I look at MappedPassword
> > > for example, I just see classOf[String] or Types.VARCHAR, which
> > > somehow makes sense, because all columns of the MappedPassword are
> > > Strings. How can I create such a MappedField ?
> >
> > > Or maybe there is a completely different and/or better way to approach
> > > my problem:
> > > I have two tables (A and B), which are represented by my own mapper
> > > classes having IdPK.
> > > In a third table (let's call it C), I want to reference an instance of
> > > A or B in table C. As mentioned above, I want to say for example that
> > > Boolean "false" means look in table A for the Long (=index) and "true"
> > > -> look in table B.
> >
> > > Any tips, pointers or links to more documentation about multi-column
> > > mappedfields? :)
> >
> > > Thanks,
> > > Joern
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
> <liftweb%2bunsubscr...@googlegroups.com<liftweb%252bunsubscr...@googlegroups.com>>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


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

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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