나는 NHibernate
구동 저장소, Fluent
매핑을 사용하고 Linq to NHibernate
을 사용하려고합니다. C# NHibernate 간단한 질문
그러나
이Retrieve<XValue>(x => (x.Timestamp.CompareTo(start) >= 0 &&
x.Timestamp.CompareTo(end) <= 0));
// 'Retrieve' here acts simply as 'session.Query<T>().Where(expression);'
나는 다음과 같은 결과를 얻을 같은 몇 가지 간단한 쿼리 :
System.NotSupportedException: Int32 CompareTo(System.DateTime)
나는 이유는 모르겠지만, CompareTo
작업에 투영되지 않습니다 데이터베이스와 출력도 이상하게 보입니다.
create table "QuotUnitDescriptor" (
Id integer,
PaperId INTEGER,
Timestamp DATETIME,
InPaperIdx INTEGER,
primary key (Id)
)
NHibernate: INSERT INTO "QuotUnitDescriptor" ......................
// Many INSERT's
NHibernate: select cast(count(*) as INTEGER) as col_0_0_
from "QuotUnitDescriptor" binaryunit0_
이 작업이 select -> integer
작업을 호출하는 이유를 이해할 수 없습니다.
다음 날짜 별 쿼리를 어떻게 구현해야합니까?(Linq
을 사용하는 것이 더 좋지만 criterias도 좋습니다.)
타임 스탬프를 0으로 비교하고 있습니다. 이유가 무엇일까요? – Vadim
@ Yads 코드에서 'start' 및'end' 타임 스탬프와 비교할 것입니다. –