Lift doesn't currently support multiple-field primary keys. I think there is an article on the wiki about a better way to model many to many.
------------------------------------- XiaomingZheng<[email protected]> wrote: hi guys: how lift mapper works with many-to-many relationships? the definitive book told me to write code like this: class ManyToManyRelation extends LongKeyedMapper[ManyToManyRelation] with IdPK { ...... object obj1 extends MappedLongForeignKey(this, other1) object obj2 extends MappedLongForeignKey(this, other2) } so this method uses obj1 and obj2 to keep this ManyToMany relation. My question is : this method uses IdPK trait and id field as primary key, but sometimes (obj1, obj2) can identify single item. how can i use tupple (obj1, obj2) as primary key field without using idPK trait? After all, this idPK field seems to be redundant here. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
