On Mon, Nov 23, 2009 at 8:30 AM, Ross Mellgren <dri...@gmail.com> wrote:

> I have heard on the list previously that compound primary keys are not
> supported by mapper.
>

That'd be correct.  Please use JPA.


>
> -Ross
>
> On Nov 23, 2009, at 10:18 AM, Arthur wrote:
>
> > Hi all
> >
> > I can't seem to find a way to use a combined primary key. The use case
> > I'm looking at would be something like a bug tracker where you can
> > comment on each bug. Each comment would have a number (only unique
> > within each bug report). In SQL I'd write something like:
> >
> > CREATE TABLE bug_comments (
> >  bugid integer REFERENCES bugs (id),
> >  number integer,
> >  comment text,
> >  PRIMARY KEY (bugid, number)
> > )
> >
> > I've seen that I can enforce the uniqueness of (bugid, number) with
> > def dbIndexes = Index (bugid, number) :: super.dbIndexes
> >
> > I'd like to have the comments numbered 1..n in each bug so they can be
> > easily referenced. What is the common way to do this in Lift? Should I
> > try to go that way or would you abandon the combined primary key and
> > simply use a synthetic primary key with LongKeyedMapper with IdPK?
> >
> > Thanks for any input.
> >
> > Yours
> >
> > Arthur
> >
> > --
> >
> > 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=
> > .
> >
> >
>
> --
>
> 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=.
>
>
>


-- 
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=.


Reply via email to