I figured I'd toss this out here  to see if anyone else has come across it. 
 I don't think it's a FNH issue at this point, but maybe I'm simply clueless 
(or more so than normal) and had a bit of coding by coincidence on the 
composite keys.

In 2.1.2, I have a few legacy Oracle mappings like:

CompositeId()
  .KeyProperty(x => x.Id, "COURSE_ID")
  .KeyProperty(x => x.TeacherId, "TEACHER_ID")
  .KeyProperty(x => x.StudentId, "PUPIL_NUMBER")
  .KeyProperty(x => x.SchoolId, "SHORT_NAME");
  
Generated HBM (cleaned for a bit of brevity):

 <composite-id mapped="false" unsaved-value="undefined">
      <key-property name="Id" type="System.Nullable`1[[System.Int32]]">
        <column name="COURSE_CODE" />
      </key-property>
      <key-property name="TeacherId" type="System.Int32">
        <column name="TEACHER_ID" />
      </key-property>
      <key-property name="StudentId" type="System.Int32">
        <column name="PUPIL_NUMBER" />
      </key-property>
      <key-property name="SchoolId" type="System.Int32">
        <column name="SHORT_NAME" />
      </key-property>
</composite-id>
  
That worked just fine in the past--for the past couple of years.  In some 
cases, COURSE_ID would be empty (null coming from Oracle), but the object 
would just instanciate with those properties being null (Id is an int?).

After bumping up to NH3, the object won't return (even though the generated 
SQL returns a valid row) unless all four key properties have values (e.g. 
elementary-level pupils are in classes without a course_code, so that field 
is null). 

After hunting around the NH HBMs, it seems a composite-id's key-property 
doesn't have a nullable attribute and, from what I'm gathering, it should 
have never worked.

Has anyone else ran across this yet?  I'm wondering if it was working by 
coincidence before... and was fixed in 3.0.

Thanks! :)

-dl

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en.

Reply via email to