DB 마다 시간 구하는 함수가 다르다.
하이버네이트에서는 방언(dialect)라는 개념을 이용해서 쿼리를 변환해주는 기능이 있는데,
보니 current_timestamp를 괄호없이 사용하면 된다.
eg)
<sql-query name="Mappings.DeviceMap.Update">
UPDATE sdh2k_device_map
SET sdh2000_ip = :sdh2000IP, updated_datetime = current_timestamp
WHERE mfp_ip = :mfpIP;
</sql-query>
구현은 아래 URL을 참고
MsSqlServer : https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Dialect/MsSql2000Dialect.cs
(current_timestamp -> getdate)
PostgreSQL : https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Dialect/PostgreSQLDialect.cs
(current_timestamp -> now)
MySQL : https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Dialect/Dialect.cs (inherited Dialect)
current_timestamp -> current_timestamp
Oracle : https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Dialect/Oracle8iDialect.cs
current_timestamp -> current_timestamp
'Programing > 닷넷' 카테고리의 다른 글
데이터 타입별로 접미어 정보 (0) | 2014.08.15 |
---|---|
웹 프로젝트 DLL 참조 추가 (0) | 2014.05.28 |
[C#] 애플리케이션 경로 (0) | 2014.03.06 |
[C#] WinForm - Drag & Drap 구현하기 (아이콘 변화) (0) | 2014.03.06 |
[Winform] 단축키(Accelerator) (0) | 2014.02.03 |