How do you delete a record with NHibernate with a composite key where one column is nullable?
I have the NHibernate mapping file set up correctly for my Marketing List object but I can't delete a record because of the null value in the composite key (I didn't set up the database and the database column can't be changed because of other systems). I get the standard Unexpected row count: 0; expected: 1
Can I do a CreateSQL or CreateHQL to do the delete?
Below is the SQL that NHibernate is spitting out:
DELETE FROM MARKETING_LIST WHERE FK_MJ_MJ_NUMBER = :p0 AND FK_MV_MV_NUMBER = :p1 AND LIST_SYSID = :p2 AND INS_COVERAGE_SUBTYPE = :p3; :p0 = '53494', :p1 = '101', :p2 = '10101', :p3 = ''
Below is the important pieces of the NHibernate Mapping. InsuranceCoverageSubtype is a nullable character column.
namespace="Affinion.M1.Business"
assembly="Affinion.M1.Business"
default-access="field.camelcase-underscore">
Status:
Open Sep 13, 2007 - 12:06 PM
Databases
2answers
Answers
Mar 31, 2012 - 10:55 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment