Am I correct in assuming this?

Posts   
 
    
hchattaway
User
Posts: 38
Joined: 06-Apr-2006
# Posted on: 06-Apr-2006 22:40:53   

Hello!

I've been looking for a tool that would represent a one to many relationship as an object instance, I think LLBLGen does that, please confirm if I am right in this example....

Let's say I have a CUSTOMER table and 2 related tables. There is a 1:1 relationship between each of the 2 tables and the main customer table. Each table has additional fields that I do not want to have in the main customer table. Related table A has additional fields for customers of one industry and Related table B has fields relevent for another industry. I want to keep the core fields in the CUSTOMER table and then industry specific fields in a related table.

My question is:

Can I create a form that treats this entity as if it was one record? I collect information on the form, some fields are for the main CUSTOMER table, and some are for table A. I assign them to the entity class and execute the SAVE() method. Will the SAVE() method save the info to both tables, effectively treating the 2 related tables as one record?

From the docs, it sounds like this would be the case.

Any confirmation would be greatly appreciated! Thanks Harold

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 06-Apr-2006 22:51:16   

hchattaway wrote:

Can I create a form that treats this entity as if it was one record? I collect information on the form, some fields are for the main CUSTOMER table, and some are for table A. I assign them to the entity class and execute the SAVE() method.

Yep. There are actually several approaches to how you could do this. With inheritence or without.

hchattaway wrote:

Will the SAVE() method save the info to both tables, effectively treating the 2 related tables as one record?

Yes, that is a recursive save.

BOb