ベースクラスをクエリするとき、NHibernateは、ベースのサブクラスごとに左外部結合を作成します。これは、クエリがベース内のプロパティのみにあり、投影がそれらのプロパティに設定されていても発生します。Nhibernateがサブクラスに対して左外部結合を作成しないようにする方法
例:
SELECT this_.Id as y0_, this_.Name as y1_ FROM AnimalBase this_
left outer join Dog this_1_ on this_.Id=this_1_.AnimalBaseFK
left outer join Cat this_2_ on this_.Id=this_2_.AnimalBaseFK
WHERE lower(this_.Name) like @p0;@p0 = '%rover%'
私の質問はどのように私は、このデフォルトの動作を変更する必要がありますか?
おかげ
EDIT:
はここを見て:
How to perform a non-polymorphic HQL query in Hibernate?
フレデリクに感謝します。あなたが与えたリンクは私をより良いものに導いた:http://stackoverflow.com/questions/2093025/how-to-perform-a-non-polymorphic-hql-query-in-hibernate/2094321#2094321 –