Yeh you probably want a DAO and Manager (service) for the PersonRequest. You'll only want CRUD so you can just use the generic hibernate crud stuff. You need the CRUD to be able to save new relationships between Person and Request, and to get a list of all PersonRequests associated with a Person or Request in your web app.
In my app my "Person" form page has a table of currently associated "PersonRequests". If I click on one or click Add this takes me to a PersonRequest form which features a drop down list of "Requests" and field to add my "date". I also have a "Request" form that lets me add and edit new Requests. As you can see, this functionality requires a manager and dao for each model. There might be other ways of doing this, but I found this work ok. Cheers Aled -----Original Message----- From: syg6 [mailto:[EMAIL PROTECTED] Sent: 10 July 2007 09:11 To: [email protected] Subject: [appfuse-user] RE: RE: many-to-many with attribute ... again 'morning gents, Ok, no worries, I'll use an auto-gen'd id. Everything seems to be working a-ok. Mind you, I haven't really 'sunk my teeth' into the app yet, I just wanted to confirm that what I wanted to do was a) possible and b) not a headache. Now that I see that it's feasible, it's onwards and upwards! One doubt I have is to where to put the DAO and Service stuff. My feeling is that it should all be in either the Person or Request DAOs and Services. Because a PersonRequest on its own doesn't exist. Does this mean that PersonRequest shouldn't have any DAOs or Services, but rather just exist as a simple POJO? I believe this is correct. If I'm wrong please tell me so! Many thanks for all of your assistance, I couldn't have done it alone! Bob Derek Broughton-2 wrote: > > syg6 wrote: > >> >> I figured it out. My fault. Forgot to put @Entity in the Person class! >> >> One last question - I think PersonRequest should have a combination of >> 'person_id' and 'request_id' as its primary key, how can I do that? >> Currently it has its own auto-numeric key but I think it's more correct >> to >> use a composite key ... >> > Good Database Design (TM) would have you use the auto-numeric key, while > possibly putting a unique index on person_id/request_id. Otherwise you > may > need to modify other tables if anything changes in the PersonRequest > table. > -- > derek > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/many-to-many-with-attribute-...-again-tf4048626s2369.h tml#a11516481 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
