• Post Reply Bookmark Topic Watch Topic
  • New Topic

Master child details update using JPA  RSS feed

Suhas Mohamedali
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two tables

master_table : 'BenefitFileHdr ' and child_table: BenefitFileDtl

PK of master table is FK of child table.

One column start_date is getting updated from the GUI and needs to to be updated in DB.

Please check the code below.

when try to save the code i get following exception.

Caused by: java.sql.SQLException: ORA-02291: integrity constraint (SLMTEST.FK_BENEFIT_HDR_DTL) violated - parent key not found

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365)
at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75)

I tried to save the parent first. Still i got error mentioning children are there.

Mapping has been done as

Please suggest a solution for update
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I googled and found this page. Check if this applies is in your case.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!