I'm using a TargetPerEntity structure that looks something like this:
* Guid Id (primary key)
* Guid ChildId (FK to Id)
* Guid CurrentChildId (FK to Id)
* Guid ParentId (FK to Id)
* bool IsCurrent
* DateTime ActionDate
* ActionType ActionType
* string ActionComment
* Guid AuthorId (FK to Person.Id)
* Guid PAuthorId (FK to Person.Id)
* ItemType ItemType
PersonEntity extends HistoryEntity
* Guid Id (primary key, and FK to History.Id)
ItemType and ActionType are custom enumeration structures, but LLBLGen deals with them as integers.
To insert initial data into the database, all constraints are temporarily suppressed and a simple tool fills the fields of entities, which are then saved via a DataAccessAdapter.
For testing, this initial data consists of a single Person entity. However, when it is saved I get the following ArgumentException:
The field name 'ActionDate' isn't known in the element 'HistoryEntity'
Parameter name: fieldName
Since all the fields are present on the History entities' backing table, this is really bizarre. It seems to suggest a problem with the generated code, but I don't know whereabouts to start looking in said code for the cause of this problem.
Note that the LLBLGen assemblies were generated from a project built by another custom tool. I know the project will not load in the LLBLGen GUI due to the handling of custom enumerations (requires a generified TypeConverter, subject of a previous topic) so I can't verify the inheritance hierarchy built by it.
Just to check, setting up TPE inheritance involves the following steps in the custom tool:
1. Ensure the supertype is either a TPE root or already a member of a TPE structure.
2. Use SetSuperTypeEntity with the subtype's combined primary/foreign key relation to the supertype.
3. Ensure all field targets are mapped to fields.
I haven't missed anything obvious here, have I? The project built in memory by the tool is almost identical to the GUI-produced project I built for reference purposes.
Could the problem possibly be caused by Person only having a single field?