CF10/CB-3.8.1: How to properly map uniqueidentifier FK in ORM

Hello,

I’m exploring ORM and having issues with mapping the FK that is of uniqueidentifier in MSSQL. I have spent many hours searching but have not found an example of this sort… perhaps someone here may have used this type of implementation?

Here’s an example of the code:

system.cfc

/Primary Key/
property name=“SysID” column=“EntryID” type=“string” ormtype=“string” length=“36” setter=“false” generator=“guid” fieldtype=“id”;

/join mapping/
property name=“RegistrationID” type=“string” ormtype=“string” fieldType=“one-to-many” cfc=“REGISTRATION” fkcolumn=“RegistrationID”;

Does anyone have any thoughts on this issue? Still hunting for answer… I appreciate any pointers you might have.

Sorry, I haven’t used ORM with GUIDs much, but my original guess was obviously that it was trying to save an empty string instead of a null. Have you turned on SQL logging to confirm that?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com