DB is a data-repository and nothing more. In general before save data you need some logic so...if the logic is all in the DB (SPs, triggers for *any kind* of operation) you can access directly to the DB. if the logic is in the application, 2 applications should use a common logic in a application-server and who have access to the DB is only the application-server.
2009/6/18 Caio Kinzel Filho <[email protected]> > > >“I can’t change the DB because there are other applications using it”… my > friend in this case the first step should be write a good service layer to > serve “externals” applications. > > Well, this is actually the case, the app i'm creating will not > replace, but wok in parallel with the existing one. > I don't know exactly what you mean by "service layer to serve apps". > What do you suggest? > > On Thu, Jun 18, 2009 at 9:32 AM, Fabio Maulo<[email protected]> wrote: > > legacy DB in a new application. I must admit I'm not an expert using NH > with > > composite-Id > > http://fabiomaulo.blogspot.com/2009/06/database-eliot-ness-of-it.html > > > > > > 2009/6/17 Caio Kinzel Filho <[email protected]> > >> > >> unfortunately, yes > >> > >> On Wed, Jun 17, 2009 at 8:24 PM, Fabio Maulo<[email protected]> > wrote: > >> > legacy db, right ? > >> > > >> > 2009/6/17 caiokf <[email protected]> > >> >> > >> >> Hi, > >> >> > >> >> I'm having trouble mapping some classes, and wonder if someone could > >> >> help me with this > >> >> > >> >> Objects (relevant ones): > >> >> > >> >> public class Order > >> >> { > >> >> public virtual int ID { get; set; } > >> >> public virtual Company Company { get; set; } > >> >> public virtual IList<OrderLine> Itens { get; set; } > >> >> //... > >> >> } > >> >> > >> >> public class OrderLine > >> >> { > >> >> public virtual int ID { get; set; } > >> >> public virtual int OrderID { get; set; } > >> >> public virtual Company Company { get; set; } > >> >> public virtual Product Product { get; set; } > >> >> //... > >> >> } > >> >> > >> >> public class Company > >> >> { > >> >> public virtual int ID { get; set; } > >> >> public virtual string Name { get; set; } > >> >> //... > >> >> } > >> >> > >> >> and in the database I have: > >> >> > >> >> - ORDER TABLE : composed key (ID and COMPANY_ID) > >> >> > >> >> - ORDERLINE TABLE : composed foreign key to order (ORDER_ID, > >> >> COMPANY_ID) > >> >> key (ID, COMPANY_ID) > >> >> > >> >> > >> >> My problem is: how can I map this composed foreign key in ORDERLINES > >> >> to be a list in the ORDER object, while being different from it's > >> >> composed primary key?? > >> >> > >> >> Any help appreciated. > >> >> Thanks. > >> >> > >> > > >> > > >> > > >> > -- > >> > Fabio Maulo > >> > > >> > > > >> > > >> > >> > > > > > > > > -- > > Fabio Maulo > > > > > > > > > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
