1. Error description
caused by:com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:Cannot Add or update a child row : A FOREIGN KEY constraint fails at SUN.REFLECT.NATIVECONSTRUCTORACCESSORIMPL.NEWINSTANCE0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:57) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at Com.mysql.jdbc.Util.handleNewInstance ( util.java:404) at Com.mysql.jdbc.Util.getInstance (util.java:387) at Com.mysql.jdbc.SQLError.createSQLException ( sqlerror.java:932) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3878) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3814) at Com.mysql.jdbc.MysqlIO.sendCommand (Mysqlio.java : 2478) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2625) at Com.mysql.jdbc.ConnectionImpl.execSQL ( connectionimpl.java:2551) at Com.mysql.jdbc.PreparedStatement.execuTeinternal (preparedstatement.java:1861) at Com.mysql.jdbc.PreparedStatement.executeUpdateInternal ( preparedstatement.java:2073) at Com.mysql.jdbc.PreparedStatement.executeUpdateInternal (Preparedstatement.java :) at Com.mysql.jdbc.PreparedStatement.executeLargeUpdate (preparedstatement.java:5094) at Com.mysql.jdbc.PreparedStatement.executeUpdate (preparedstatement.java:1994) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.logicalcobwebs.proxool.ProxyStatement.invoke (proxystatement.java:100) at Org.logicalcobwebs.proxool.ProxyStatement.intercept (proxystatement.java:57) at $java. lang.autocloseable$$ Enhancerbyproxool$$9c7ad94b.executeupdate (<generated>) at Org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate (resultsetreturnimpl.java:208) ... More
2. Cause of error
3. Solutions
Cannot add or update a child row:a FOREIGN KEY constraint fails