开发者

Nhibernate component with mapped class problem

I am working with oracle and nhibernate. I can select list of an object from db table (all items开发者_开发问答 in table) as Iquerable, but when I try to select an item from the list using "linq where clause" it sends nonsense query to oracle db. And it gets invalid identifier error.

I can get whole list without any error in query, it happens when I use where clause.

(Some information about query and mapping document is as below) query :

SELECT this_.ID as ID33_0_,
this_.BUNDLEID.........................Where bundleitem1_.ID = :p0

(bundleitem1_.ID is invalid)

related mapping part :

<component name="BundleItem"
class="PromissoryNotes.Server.Data.Bundle,
PromissoryNotes.Server.Data">
     <property name="Id" column="BUNDLEID" type="decimal"></property>

Copmponent "Bundle" has a mapping seperatly in another xml document, I realized that, when I change the Bundle class to another unmapped class, it works. Problem is about component with mapped classes as Bundle. What is the solution, any idea?


Are you sure this should really be mapped as a component? Should this perhaps be a many-to-one mapping?

Perhaps something like:

<many-to-one name="BundleItem" column="BundleId" cascade="save-update" />


I see that, this is an nhibernate bug. Mapped class could not be used as a component.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜