2013-08-14 2 views
0

두 필드를 내 도메인에 추가합니다. Class ContentSequence : GORM에 의해 자동으로 업데이트되는 lastUpdated, dateCreated. org.springframework.dao.TransientDataAccessResourceException : 최대 절전 모드 동작 :util.JDBCExceptionReporter 값 '0000-00-00 00:00:00'을 java.sql.Timestamp로 표현할 수 없습니다.

ContentSequence.get(1); 

불행하게도, 내가 웹 인터페이스의 콘솔에서 다음을 얻을 :

응용 프로그램을 다시 실행 한 후, 나는 기록을 얻으려고 not load an entity: [com.abdennour.content.ContentSequence#200]; SQL [select contentseq0_.id as id17_0_, contentseq0_.version as version17_0_, contentseq0_.chapter_id as chapter3_17_0_, contentseq0_.date_created as date4_17_0_, contentseq0_.difficulty as difficulty17_0_, contentseq0_.last_updated as last6_17_0_, contentseq0_.level_id as level7_17_0_, contentseq0_.name as name17_0_, contentseq0_.other as other17_0_, contentseq0_.owner_id as owner10_17_0_, contentseq0_.subject_id as subject11_17_0_, contentseq0_.type as type17_0_ from content_sequence contentseq0_ where contentseq0_.id=?]; Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp을 할 수

및 터미널

, 내가 얻을 :

util.JDBCExceptionReporter Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 

답변

1

내가 수동으로 쿼리 SQ을 L은 Timestamp가 최소

UPDATE content_sequence 
SET date_created = '2013-08-08 00:00:00'; 
    UPDATE content_sequence 
SET last_updated = '2013-08-08 00:00:00'; 

이므로 Date 필드의 값을 업데이트하고 현재 작업 중입니다.

2

오류 -> 값 '0000-00-00 00:00:00'을 열 XX에서 TIMESTAMP로 변환 할 수 없음 이유> 0000-00-00 00:00:00이 TIMESTAMP 값의 범위 밖에 있습니다 (in 사실, DATE 필드에서도 작동하지 않습니다). 해결책 -> JDBC 옵션 수정 jdbc : mysql : // localhost/test? zeroDateTimeBehavior = convertToNull

관련 문제