2

NHibernatesの正確な違いは何ですか

Projection.RowCount() 

Projection.Count()

行/結果の数を探しているときは?

4

1 に答える 1

1

Projection.Count は、カウントが必要なプロパティを渡すことを期待しています。

Projection.Count("propertyName")

SQLでは次のように変換されます

select Count(this.whateverNhibernateConvention) from table as this

Projection.RowCount に関しては、変換するものを渡す必要はありません

select Count(1) from table as this

上記が当てはまると思います

于 2011-06-05T14:53:22.317 に答える