Hello All,

I've just found (somewhat buried) in the documentation that, apparently, we
can't use nullable properties inside of a composite element mapping that's
inside of a <set>. This answers my question. (Though I wonder if NHibernate
could crash with an error here instead of generating a DELETE SQL statement
that will just be a no-op?)

Sorry for the spam!

V/R,
Nicholas Piasecki

-----Original Message-----
From: Nicholas Piasecki [mailto:[email protected]] 
Sent: Tuesday, July 21, 2009 4:52 PM
To: nhusers
Subject: Deleting a composite-element with nullable structs and user type

Hello All,

I'm using NHibernate 2.1.0 (the new release). In one of my mappings, I
have <set> that contains a composite-element. Two of the properties of
this composite element are structs that also have UserTypes defined
for them.

While I can safely add new instances of this element, I can't delete
or update them if any of the nullable structs are null. That's because
NHibernate generates SQL that looks like this:

DELETE FROM Core.PackagingOptions
WHERE CarrierMethodId = 3 /* @p0 */
AND PackagingId = 4 /* @p1 */
AND MaxWeightLB = '2.00' /* @p2 */
AND MaxValueAmount = NULL /* @p3 */
AND MaxValueCurrencyId = NULL /* @p4 */

The problems is that those two "= NULL" need to be "IS NULL" for the
query to succeed in SQL Server. Have I done something stupid with my
(Composite)UserTypes? Or is this something that is not supported?

Thanks!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to