java - Hibernate updating primary key -


is possible update primary key having more 1 table mapping? how can update id in master table?

create table master (id int, name varchar(20),address varchar(20),primary key(id));  create table slave_1 (id int,s1_id int,area varchar(20),project varchar(20),primary key(s1_id),foreign key (id) references master(id));  create table slave_2 (id int,s2_id int,area varchar(20),project varchar(20),primary key(s2_id),foreign key (id) references master(id)); 

you follows:

  1. disable foreign key constraints.

  2. update id/references

  3. enable foreign key constraints.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -