So your saying you want a one to many join:
1 school has many subjects? You can of course do this with mapper, by default mapper is not a black box full of magic like, say, Ruby's active record, so you need to fit some of the convenience method plumbing yourself if you need it. Assuming you adding a "subjects" method to the School class, you could do something like: val subjects: List[Subject] = School.find(1234).subjects Likewise, if you had a subject you could do something like: val school: School = subject.school.obj The latter is provided as a convenience by default. The former is not. Does that help? Cheers, Tim On 27/05/2009 23:08, "Joe Wass" <j...@folktunefinder.com> wrote: > > Mapper (by default) > > On May 27, 11:03 pm, Timothy Perrett <timo...@getintheloop.eu> wrote: >> What persistance mech are you using Mapper or JPA? The solution >> differs depending on your choice. >> >> Cheers, Tim >> >> On May 27, 10:38 pm, Joe Wass <j...@folktunefinder.com> wrote: >> >>> Is there an idiomatic way to represent the following? I've done it >>> many times before manually in PHP, but never with ORM. I suppose I >>> know how I'd do it in Lift long-hand (I'm very new) but there might be >>> a 'Lift' way of doing it. Subject could be an enum or a table. >> >>> Entity: School >>> Entity: Subject >> >>> School can have multiple subjects. >> >>> School ---* SubjectInstance --- Subject >> >>> I suppose ideally I'd like to be able to treat it as School having a >>> Set of enums. >> >>> TIA >> >>> Joe > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@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 -~----------~----~----~----~------~----~------~--~---