Hi there! I'm pretty new to Castle's Active Record (or any ORM except for minor Hibernate-experience) and brand new to this mailing list. I already made a lot of things work by following the documentation but couldn't find a solution to what I'm posting here albeit searching the docs, the web in general and this mailing list in particular. If this question was asked and answered before or is just plain obvious or stupid, I'm sorry and perfectly fine with a simple pointer to the solution.
Now to my problem: I'm trying to persist objects of many, many classes which are part of a not-so-small inheritance forest. For different reasons, I decided to go with Class Table Inheritance and would like to stick to that decision if there is a solution to my problem. As an example lets assume three classes, each with its own attributes: ClassA (attA) || ClassB (attB) || ClassC (attC) Now for the tables - I though this to be pretty straight forward and went for the following: TableA * id : PK * attA TableB * id : PK * idA : FK to TableA.id * attB TableC * id : PK * idB : FK to TableB.id * attC If we ignore ClassC for a moment, everything is just fine. I mark ClassA.id as PrimaryKey, ClassB as JoinedBase with idA as JoinedKey and loading and storing objects works like a charm. The problem arises by including ClassC because its own JoinedKey idB is joined with the only PrimaryKey in that inheritance hierarchy (namely ClassA.id and this obviously violates the FK-constraint of TableC). This seems to make sense in some/many/perhapsevenmost situations but is bugging me a lot, since I need it to be a foreign key to TableB! Normally ClassC doesn't know about ClassA, TableC definitely doesn't know about TableA, so why would I have to shortcut the inheritance for ActiveRecord by aligning ClassA and ClassC along their joined key? I don't see a reason. Am I in violation of same best practice here? So bottom line: How do I tell ActiveRecord to join ClassC.idB with ClassB.id? (For totally different reasons I actually already know all three ids and would even be fine with 'manually' assigning them during the save() call.) Any help is greatly appreciated! Thx, pan. -- You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en.
