I am using D 10.3 Rio Pro with the latest release of Aurelius with a Firebird 3 database to develop a student enrollment application for my employer.
I have created an enrollment contract class and a financial aid award class. There is a one to zero or one relationship between the two.
The enrollment contract class has a TFinAidAward association which I would like to lazy load. Here is the code (which works without a problem):
[Association]
[JoinColumn('FIRST_DAY_OF_SCHOOL', [TColumnProp.Required], 'FIRST_DAY_OF_SCHOOL')]
[JoinColumn('LAST_DAY_OF_SCHOOL', [TColumnProp.Required], 'LAST_DAY_OF_SCHOOL')]
[JoinColumn('STUDENT_ID', [TColumnProp.Required], 'STUDENT_ID')]
FFinAidAward: Proxy<TFinAidAward>;
If I change the Assocation attribute to [Association([TAssociationProp.Lazy], CascadeTypeAll - [TCascadeType.Remove])], I get the following exception when a nil TFinAidAward object is returned.
"Project StudCont.exe raised exception class EAssertionFailed with message 'Proxy loading failed. "TDocument" could not resolve property "FFinAidAward": results did not return a single object.
(Aurelius.Engine.ProxyController.pas, line 255)'."
Apparently, the referenced code asserts Objects.Count = 1, which is not the case. If I don't use lazy loading however, there is no exception.
Is this a bug or something I am doing wrong?