hibernate - How to handle Spring JPA repository SQL error when occur? -
in project using sring jpa repositories concept interact database. repository has many inbuild crud functions repository.save().. saves entity
now during saves sql error below , save operation fails: sql error:
2012-06-28 10:28:43,217 [warn] [pool-1-thread-1] [org.hibernate.util.jdbcexceptionreporter] - sql error: 0, sqlstate: 22001 2012-06-28 10:28:43,217 [error] [pool-1-thread-1] [org.hibernate.util.jdbcexceptionreporter] - data truncation: data long column '<column name>' @ row 1
my concern how handle these kind on error in java code, because cannot see method throwing exception handle upon these kind of error.
apart fact business classes or pojos check if length not big can find on hibernate forums hibernate logging this.
see example persist object error : data long column (in mysql) , data truncation: data long column.
it not spring data related @ all.
Comments
Post a Comment