I have a very non-standard database that I have to work with for a loan origination system. Many of the legacy tables that I am forced to work with have multiple non-self incrementing primary keys. I have added a few new tables that allow me to have a handle on the legacy stuff.
When I am inserting data for the first time, I have no problem using the iterator.add() methods and adding 1:1 child objects using reactor. It creates the relationships which are then saved to the database without issue. My lowest level in the hierarchy of the current issue looks like this:
UserAccount.getLoanApplicationIterator().getAt(1).getReferenceInfo().getUrlaSetup().setSomething("my value");
On creating/inserting, this all works exactly as planned. The UserAccount record is then available through a UserAccount facade.
Later when I want to change a value and save, I have no problem at all changing and outputting any property, but when it comes time to do
UserAccount.save(), no data actually gets persisted to the database. There is no error, but simply no database action. I have tried shooting at this from a number of angles, but would really appreciate a second opinion before I have to scrap this direction and try something else altogether.
The tables that are in play with this particular problem are listed below.
UserAccount: (new table)
UserAccountId - self incrementing PK
Username...Password... etc....
LoanApplication: (new table)
LoanApplicationId - self incrementing PK
reference_id - legacy FK ColdFusion UUID
company_code - legacy FK numeric
UserAccountLoanApplication: (new table)
UserAccountLoanApplicationId: self incrementing PK
UserAccountId: FK to UserAccount
LoanApplicationId: FK to LoanApplication:
now the legacy stuff...
REFERENCE_INFO
REFERENCE_ID - non-self incrementing part of multi-PK varchar
COMPANY_CODE - non-self incrementing part of multi-PK numeric
various other badly named columns...
URLA_SETUP:
REFERENCE_ID - non-self incrementing part of multi-PK varchar
COMPANY_CODE - non-self incrementing part of multi-PK numeric
URLA_SETUP_ID - part of multi-PK but always a "1" for some reason....
various other badly named columns...
So here is the config that ties this together, although I am stripping the non-key fields for clarity:
<object name="UserAccount">
<hasMany name="LoanApplication">
<link name="UserAccountLoanApplication" />
</hasMany>
</object>
<object name="LoanApplication">
<field name="company_code" alias="CompanyCode" />
<field name="reference_id" alias="ReferenceId" />
<hasOne name="ReferenceInfo">
<relate from="CompanyCode" to="CompanyCode" />
<relate from="ReferenceId" to="ReferenceId" />
</hasOne>
<hasMany name="UserAccount">
<link name="UserAccountLoanApplication" />
</hasMany>
</object>
<object name="UserAccountLoanApplication">
<hasOne name="UserAccount">
<relate from="UserAccountId" to="UserAccountId" />
</hasOne>
<hasOne name="LoanApplication">
<relate from="LoanApplicationId" to="LoanApplicationId" />
</hasOne>
</object>
<object name="REFERENCE_INFO" alias="ReferenceInfo">
<field name="REFERENCE_ID" alias="ReferenceId" />
<field name="COMPANY_CODE" alias="CompanyCode" />
<hasOne name="UrlaSetup">
<relate from="ReferenceId" to="ReferenceId" />
<relate from="CompanyCode" to="CompanyCode" />
</hasOne>
</object>
For what it is worth, I can instantiate an existing ReferenceId object and modify/persist values in its child UrlaSetup object like this:
ReferenceInfo.getUrlaSetup().setSomething("my value");
ReferenceInfo.save();
But for some reason I cannot save from above that level. If anyone has any thoughts on this matter, I would really appreciate hearing them. Also if I need to clarify any of the above, just ask. I really need to find resolution to this issue!
--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- [Reactor for CF] Strange issue with updating child objects Dave Shuck

