ColdFusion 9 ORM "LEFT JOIN" in a mapping pool

Some time has passed since the last time I used the Hibernate implementation in CF9, and now I am at a point where I do not see the forest for all the trees (maybe not enough coffee).

I simplified this example to make it more relevant, but the nature of the problem is the same (matching connections in components to multiple tables should allow for additional relationships).

Inside my custom component, I have the following property to include an email address, which is stored in a separate table.

<cfproperty name="sEmail" type="string" default="" table="UserEmail" joincolumn="fkUserID" inversejoincolumn="pkUserID" /> 

Unfortunately, this generates an INNER JOIN, while I need a LEFT JOIN, so writing to another table will not be necessary to retrieve / save the object.

So my question is:
What attribute is needed to turn this from mandatory (e.g., INNER JOIN) to optional (e.g., LEFT OUTER JOIN)?

Google's results were flooded with HQL related examples, which made this option mostly unusable.

Thank you for your responses.

Added later:

Hibernate itself has an β€œoptional” attribute for it ( http://www.scribd.com/doc/2732589/Hibernate-Reference-Documentation#outer_page_74 ), but there seems to be no direct translation into CF attributes. But perhaps there is still a chance that someone may know the way.

+4
source share
1 answer

I do not believe that there is a way through sleep mode. I would be surprised if there was a way. In such situations, I usually populated the variable manually with a custom query in a user-defined function (i.e. loadSEmail ()).

0
source

Source: https://habr.com/ru/post/1389247/


All Articles