2
我想設置一個先前設置的日期字段在Oracle中使用休眠空值,但一旦「可空」列設置爲一個日期,我不能再設置爲空,因爲我不知道如何表示要在下面的查詢中作爲參數傳遞的空日期。無法再次設置日期爲空
Query updateQuery;
updateQuery = em.createNativeQuery("UPDATE STATION SET MOD_DT = ?1 WHERE STATION_ID = ?2");
updateQuery.setParameter(2, stationId);
updateQuery.setParameter(1, null);
updateQuery.executeUpdate();
登錄:
g! Dec 02, 2014 4:41:46 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 932, SQLState: 42000
<02-Dec-2014 16:41:46 o'clock EET> <Warning> <org.hibernate.engine.jdbc.spi.SqlExceptionHelper> <BEA-000000> <SQL Error: 932, SQLState: 42000>
Dec 02, 2014 4:41:46 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ORA-00932: inconsistent datatypes: expected DATE got BINARY
<02-Dec-2014 16:41:46 o'clock EET> <Error> <org.hibernate.engine.jdbc.spi.SqlExceptionHelper> <BEA-000000> <ORA-00932: inconsistent datatypes: expected DATE got BINARY>