I m Even facing the same error ...
I don know why even the FK of Song details are matching with the Pk of the Album i mm getting the below mentioned error:
java.sql.BatchUpdateException: ORA-02291: integrity constraint (SONGSLIB.SONGSDETAIL_ALBUM_FK1) violated - parent key not found
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10070)
at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at com.gp.songslib.dao.impl.SaveSongsInfoDaoImpl.saveAlbum(SaveSongsInfoDaoImpl.java:35)
at mysonglibrary.MySongLibrary.main(MySongLibrary.java:31)
While debugging i found it's coming when i m going for flush or commit.
DB : Oracle
DLL OF ALBUM :
DLL of SongDetails :