Hi:

I am very new to this forum and a rookie using NHibernate.
We came up with a situation recently and I would appreciate someone's help 
in that.

We have two entities having parent-child relation. Here are the 
corresponding HBMs.

<class name="MainCandidate" table="mainCandidates" dynamic-update="true" >
<id name="Id" column="TheName" type="string" unsaved-value="null">
<generator class="assigned"/>
</id>

<bag name="Steps" lazy="true" cascade="all-delete-orphan" 
order-by="stepOrder" inverse="true" >
<key column="TheName" />
<one-to-many class="Step" />
</bag>
</Class>

<class name="Step" table="tbl_step_key">
<many-to-one column="TheName" name="Rule" class="MainCandidate" 
cascade="none" />
</Class>

Whenever MainCandidate object is loaded, 'Step' table will be loaded lazily. 
'TheName' is happened to be the primary key on 'MainCandidate' table and 
foreignkey on 'Step' table.

Due to our recent data migration to 'MainCandidate' table, some of 'TheName' 
column values are updated with trailing spaces and it went unnoticed. 
Recently we found out that the NHibernate query which is reponsible for 
loading the child 'Step' table is messed up because of that trailing spaces. 
We've traced that query through SQL Profiler.

My question is, is there anyway that we correct this problem without 
touching either of the above mentioned tables? How can we make the 
NHibernate query ignore the whitespaces?

Thanks inadvance. 

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/DhrCe5LbdakJ.
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