Hello,
I have the following object hierarchy (renamed for simplicity):
1) Person table
- PersonID PK identity
- FirstName
- LastName
2) Employee table
- PersonID PK FK 1:1 references Person.PersonID
- EmployeeNumber
3) Paycheck table
- PaycheckID PK identity
- PersonID FK m:1 references Employee.PersonID
- Amount
I am using a Target-Per-Entity inheritance relationship between Employee and Person.
My Scenario:
1) Create an instance of Employee.
2) Set the FirstName, LastName, and EmployeeNumber fields
3) Create 2 new instances of Paycheck and set the Amount property only.
4) Add the Paycheck instances to the Employee's Paycheck collection.
5) Call DataAccessAdapter.Save(employee, true, true) (refetch and recurse)
When this happens, I receive a database error stating that the Paycheck.PersonID column cannot contain null values. When I look at the insert query, the PersonID field is not even present.
I know LLBL supports automatic updates of foreign keys when doing recursive saves. Is the problem that I'm using an object hierarchy?
LLBL Version: LLBL 2.0.0.0 Final (July 12th, 2006)
Runtime Version: 2.0.0.060722
Template: .NET 2.0 Adapter
Database: SQL Server 2005