Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate Cascade Issue

Have Programming Question? Ask it here!
 
 
 


/
Cascade Issue
0 Answer(s)      2 years and 8 months ago
Posted in : Hibernate


I have 3 tables: user, stuffperuser (pk: FKuser & FKstuff), stuff. When I don't use cascading, I get an error: "Cannot add or update a child row: a foreign key constraint fails"

The mapping files are correct. I need some sort of cascading. It works when I add cascading in the set property of the many-to-many relationship to add non-existent data to user & stuff, but its overwriting data in stuffperuser. Whenever I save an object which contains a 'stuff' which was already entered in stuffperuser, it overwrites the row, even when the other part of the PK is not thesame user. So basicly the previous user with that 'stuff' is overwritten by the new user with the same stuff.

It should always add a new row in the table stuffperuser if it is a new user, even with stuff that is already entered by another user.

That is not something that I want, but I can't seem to sort out where (stuff or user) to put the cascade rule and which one. The property inverse is set to FALSE.

I've looked up different sources, such as the offical hibernate website. I understand how cascading works with 2 tables, but with hibernating and 3 tables while the second is a normalization table, the dices role a bit different. Thanks for any input.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Cascade Issue
Cascade Issue  I have 3 tables: user, stuffperuser (pk: FKuser & FKstuff), stuff. When I don't use cascading, I get an error: "Cannot add... want, but I can't seem to sort out where (stuff or user) to put the cascade rule
Use of CASCADE CONSTRAINTS
Use of CASCADE CONSTRAINTS  hii, What is the use of CASCADE CONSTRAINTS?   hello,, CASCADE CONSTRAINTS describes about the parent-child relationship between tables
Advertisements
What is the use of CASCADE CONSTRAINTS?
What is the use of CASCADE CONSTRAINTS?   What is the use of CASCADE CONSTRAINTS?   Hi, The CASCADE CONSTRAINTS clause drops all referencial integrity constraints that refer to the primary and unique keys defined
Difference Between cascade and inverse Keyword
Difference Between cascade and inverse Keyword In this tutorial we are going to differentiate between the cascade option and inverse keyword. Cascade : In Hibernate the cascade option is used for defining the Owner
issue on jcombobox
issue on jcombobox  i have JTextfield and JComboBox. there are several values in combobox.when i select a value from combobox how to make textfiled as a combobox.only few values in the combobox need this functionality. need
jdialogbox issue.
jdialogbox issue.  i have one button.when clicked on it has to show a dialog box.but even click on it several times it has to open dialog box only once. if it is already not opened atleast once,then only it has to open dialog
JTABLE Issue
to go back for another search. Now issue is -- when I put some input data
Issue with Javascript
Issue with Javascript  Hi I created arrays in javascript in following way var myimages= new Array(); myimages[0]="iphone_pushups.png"; myimages[1]= "cricket.png"; myimages[2]= "july.png"; myimages[3]= "matrix.png
Decimal Format Issue Java
Decimal Format Issue Java  Decimal Format Issue Java
semantic issue xcode 4.2
semantic issue xcode 4.2  I have updated xcode 4.0 to 4.2 .. but once i open any application in this new version of xcode ..it throws lots of semantic issue. Can anyone please explain why it occurs and how to resolve
Resultset Issue in SQL
Resultset Issue in SQL  when i call rs.next() in my code it is returning false, though im having valid query to execute and fetch a row from database.how can i resolve this issue. My code is: SELECT JOBDESCRIPTION,CATEGORY
Issue in JSF and Richfaces.
Issue in JSF and Richfaces.  Hi,I am with a issue in JSF and Richfaces.I have one add user page.In which i have fields Firstname,LastName,SecretID(which has Validate/suggest as links beside tat) ,Email address,city,state,country
Login issue using Servlet
Login issue using Servlet  Hi all, I need a code for login using servlet where in I want to check and validate user name and password from database also I want to check candidate's class (for ex. FY, SY, TY) if candidate's class
Read Issue itext
Read Issue itext  Hello, I m using itext to read data from pdf file.. Right now i m reading page wise data,but i want to extract data on each line In variable whole page data there... so i want to read data line by line so
Read Issue itext
Read Issue itext  Hello, I m using itext to read data from pdf file.. Right now i m reading page wise data,but i want to extract data on each line In variable whole page data there... so i want to read data line by line so
Grid rows delete issue
on onchange of dropdown then because of rows indexing issue,they can't get middle row
maven subversion issue
maven subversion issue   m doing work on maven and subversion i have created a maven project now i want to point it to my repository(created by svn tortoise) i read that for this i have to change in pom.xml file from this site
Initializing Integer Variable issue?
Initializing Integer Variable issue?  My program is supposed to take a phrase like you'd see on a TV commercial, for example: "Call 1-800-GETLOAN now to..." then take that phrase and convert it to its actual phone number. My
Issue in Stateless session bean example
Issue in Stateless session bean example  Hi Team, I tried your Stateless session bean example in the path http://www.roseindia.net/ejb/examples... the issue. $Proxy65 cannot be cast
Dll issue while launching the application
Dll issue while launching the application  I am using one dll in my application for including the functionality provided by that dll . This dll i am... this issue
Database related issue - Development process
Database related issue  I have view in db2 database and i am firing a select query on this view with two timestamps which fetches all the rows in between these timestamps. Now my issue is i want to restrict the rows already
Java Calendar issue - Date Calendar
to client to display time in Singapore timezone Here is the issue my Calendar Obj
My SQL upgrade to version 5.5 issue
My SQL upgrade to version 5.5 issue  My SQL upgrade to version 5.5 issue
Issue with tutorial realted to insertion in middle in Linked List
Issue with tutorial realted to insertion in middle in Linked List  insert in middle in Linked list will take O(N) instead as displayed as O(1
IsTra Issue Tracker
IsTra Issue Tracker       IsTra is the first complete issue tracking solution designed to function as a pure Eclipse plugin. It offers full-cycle issue tracking
Truncating issue while parsing XML with SAX Parser.
Truncating issue while parsing XML with SAX Parser.  I am Parsing one... data, rather some of the characters gets truncated. Has anyone faced this issue nad what is the cause of this issue. While debugging with eclipse whatever i
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity...;user=sa;password=denver"); ---There is no issue But when I use following code
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity...;user=sa;password=denver"); ---There is no issue But when I use following code
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity...=dorakoina;user=sa;password=denver"); ---There is no issue But when I use
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist  MySQL issue: Table 'datadictionary.CHARACTERSETS' doesn't exist
Can anybody tell me how to resolve this issue?
Can anybody tell me how to resolve this issue?  java.lang.Exception: Exception : java.lang.Exception: Generic Errors = java.util.MissingResourceException: Can't find bundle for base name Connection, locale en_US
Issue in Converting .zip file to .jar file?
Issue in Converting .zip file to .jar file?  I have a folder called "printpdf.jar". I have changed the .jar to .zip and did some customizations. After which i had "zipped" it again and made as ".jar". Now the final file
Wants Suggestion about an issue. - Java Magazine
Wants Suggestion about an issue.  Hi all, I wish to develop a website like Social Networking Websites. For the development i think i should use Java Technology. So Request u guys to do suggest me what Design Pattern, What
Issue when deploying mdb jar in weblogic
Issue when deploying mdb jar in weblogic  Hi, I have written the code to read messages from queue.But when i deploy this in weblogic 9.2 after creating a jar file it is showing unmarshaller failed Below is the code MyMdb.java
Tomcat jar file issue - JSP-Servlet
of experience before ?Appreciate your help in this issue. Thanks in Advance
Tomcat start up issue: SEVERE: Error listenerStart - IDE Questions
Tomcat start up issue: SEVERE: Error listenerStart   Hi When I deployed my web application( named: myApp) in Tomcat 5.5.25, I am getting the following issue and I am not able to access my application. SEVERE: Error
Swing UI alignment Issue on different Platform - Swing AWT
Swing UI alignment Issue on different Platform  Hi, We are developing screens using Java Swing on windows. The problem is when we take the same screen in Linux machine, The alignment is changing. This is happening if we change
ISAPI Filter Issue Error from Web Service ("Error:- InternetOpenUrl()")
ISAPI Filter Issue Error from Web Service  <p>I have writen MFC application for ISAPI filter which will authenticate and authorization the request. Its working fine but when we are doing load testing we are getting error
Advertisements
 

 

 

DMCA.com