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 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.

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
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
Advertisements
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
ModuleNotFoundError: No module named 'cascade'
ModuleNotFoundError: No module named 'cascade'  Hi, My Python... 'cascade' How to remove the ModuleNotFoundError: No module named 'cascade... to install padas library. You can install cascade python with following command
ModuleNotFoundError: No module named 'cascade'
ModuleNotFoundError: No module named 'cascade'  Hi, My Python... 'cascade' How to remove the ModuleNotFoundError: No module named 'cascade... to install padas library. You can install cascade python with following command
Use of CASCADE CONSTRAINTS
Use of CASCADE CONSTRAINTS  hii, What is the use of CASCADE CONSTRAINTS?   hello,,ADS_TO_REPLACE_1 CASCADE CONSTRAINTS describes about the parent-child relationship between tables
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
Version of com.paypal>cascade-akka_2.10 dependency
List of Version of com.paypal>cascade-akka_2.10 dependency
Version of com.paypal>cascade-akka_2.11 dependency
List of Version of com.paypal>cascade-akka_2.11 dependency
Version of com.paypal>cascade-common_2.10 dependency
List of Version of com.paypal>cascade-common_2.10 dependency
Version of com.paypal>cascade-common_2.11 dependency
List of Version of com.paypal>cascade-common_2.11 dependency
Version of com.paypal>cascade-examples_2.10 dependency
List of Version of com.paypal>cascade-examples_2.10 dependency
Version of com.paypal>cascade-examples_2.11 dependency
List of Version of com.paypal>cascade-examples_2.11 dependency
Version of com.paypal>cascade-http_2.10 dependency
List of Version of com.paypal>cascade-http_2.10 dependency
Version of com.paypal>cascade-http_2.11 dependency
List of Version of com.paypal>cascade-http_2.11 dependency
Version of com.paypal>cascade-json_2.10 dependency
List of Version of com.paypal>cascade-json_2.10 dependency
Version of com.paypal>cascade-json_2.11 dependency
List of Version of com.paypal>cascade-json_2.11 dependency
ModuleNotFoundError: No module named 'cascade-settings'
ModuleNotFoundError: No module named 'cascade-settings'  Hi, My... named 'cascade-settings' How to remove the ModuleNotFoundError: No module named 'cascade-settings' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'suds_cascade'
ModuleNotFoundError: No module named 'suds_cascade'  Hi, My Python... 'suds_cascade' How to remove the ModuleNotFoundError: No module named 'suds_cascade' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'suds_cascade'
ModuleNotFoundError: No module named 'suds_cascade'  Hi, My Python... 'suds_cascade' How to remove the ModuleNotFoundError: No module named 'suds_cascade' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'bu-cascade'
ModuleNotFoundError: No module named 'bu-cascade'  Hi, My Python... 'bu-cascade' How to remove the ModuleNotFoundError: No module named 'bu-cascade' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'djangocms-cascade'
ModuleNotFoundError: No module named 'djangocms-cascade'  Hi, My... named 'djangocms-cascade' How to remove the ModuleNotFoundError: No module named 'djangocms-cascade' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'djangocms-cascade'
ModuleNotFoundError: No module named 'djangocms-cascade'  Hi, My... named 'djangocms-cascade' How to remove the ModuleNotFoundError: No module named 'djangocms-cascade' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'cascade-settings'
ModuleNotFoundError: No module named 'cascade-settings'  Hi, My... named 'cascade-settings' How to remove the ModuleNotFoundError: No module named 'cascade-settings' error? Thanks   Hi, In your
Decimal Format Issue Java
Decimal Format Issue Java  Decimal Format Issue Java
ModuleNotFoundError: No module named 'issue'
ModuleNotFoundError: No module named 'issue'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'issue' How to remove the ModuleNotFoundError: No module named 'issue'
ModuleNotFoundError: No module named 'issue'
ModuleNotFoundError: No module named 'issue'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'issue' How to remove the ModuleNotFoundError: No module named 'issue'
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
Reloading issue in jsp
Reloading issue in jsp  I wrote one jsp page with one submit button. If we click on button it will execute business logic, but I want to stop reloading page if user refreshed the link. how we do
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
Grid rows delete issue
on onchange of dropdown then because of rows indexing issue,they can't get middle row
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
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
jquery issue plese help
jquery issue plese help  Im am trying to Change the background color of the dashboard to black with an opacity of 0.6 Change the opacity of the images in the dashboard to 0.5 before the dashboard slides out. Change the opacity
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
Solving java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean issue
Solving java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean issue  Solving java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean issue In my Spring
How to cascade two text boxes??
How to cascade two text boxes??  I am having 3 text boxes if i entered the value in the first text box then the values of the two text boxes should come from the database with respect to first text box value
ModuleNotFoundError: No module named 'django-postgres-delete-cascade'
ModuleNotFoundError: No module named 'django-postgres-delete-cascade' ...: No module named 'django-postgres-delete-cascade' How to remove the ModuleNotFoundError: No module named 'django-postgres-delete-cascade' error
ModuleNotFoundError: No module named 'tocka-djangocms-cascade'
ModuleNotFoundError: No module named 'tocka-djangocms-cascade'  Hi...: No module named 'tocka-djangocms-cascade' How to remove the ModuleNotFoundError: No module named 'tocka-djangocms-cascade' error? Thanks   
ModuleNotFoundError: No module named 'django-db-cascade'
ModuleNotFoundError: No module named 'django-db-cascade'  Hi, My... named 'django-db-cascade' How to remove the ModuleNotFoundError: No module named 'django-db-cascade' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-postgres-delete-cascade'
ModuleNotFoundError: No module named 'django-postgres-delete-cascade' ...: No module named 'django-postgres-delete-cascade' How to remove the ModuleNotFoundError: No module named 'django-postgres-delete-cascade' error
ModuleNotFoundError: No module named 'django-seo-cascade'
ModuleNotFoundError: No module named 'django-seo-cascade'  Hi, My... named 'django-seo-cascade' How to remove the ModuleNotFoundError: No module named 'django-seo-cascade' error? Thanks   Hi, In your
Maven Dependency cascade-akka_2.10 >> 0.2.0
You should include the dependency code given in this page to add Maven Dependency of com.paypal >> cascade-akka_2.10 version0.2.0 in your project
Maven Dependency cascade-akka_2.10 >> 0.3.0
You should include the dependency code given in this page to add Maven Dependency of com.paypal >> cascade-akka_2.10 version0.3.0 in your project
Maven Dependency cascade-akka_2.10 >> 0.4.0
You should include the dependency code given in this page to add Maven Dependency of com.paypal >> cascade-akka_2.10 version0.4.0 in your project

Ads