If you are just manipulating data, you should use the data import and export function of the database. If you must use Java, since the primary key is UUID, you should not need to import UUID data, but directly generate UUID data when inserting.
If the two sets represent the same structure, then the mapping relationship should be written in the table creation statement! Similar to this: create table student_teacher(student_id int, teacher_id int, constraint student_teacher_PK primary key(student_id,teacher_id), constraint student_id_FK foreign key(student_id) references student(id), constraint teacher_id_FK foreign key(teacher_id) references teacher (id)); You generate an xml file to import, and the mapping relationship is the same in both databases. Even if you use java and just read the xml file, you don’t need to consider the mapping relationship.
If you are just manipulating data, you should use the data import and export function of the database. If you must use Java, since the primary key is UUID, you should not need to import UUID data, but directly generate UUID data when inserting.
If the two sets represent the same structure, then the mapping relationship should be written in the table creation statement! Similar to this:
create table student_teacher(student_id int, teacher_id int,
constraint student_teacher_PK primary key(student_id,teacher_id),
constraint student_id_FK foreign key(student_id) references student(id),
constraint teacher_id_FK foreign key(teacher_id) references teacher (id));
You generate an xml file to import, and the mapping relationship is the same in both databases.
Even if you use java and just read the xml file, you don’t need to consider the mapping relationship.
http://www.yl1001.com/group_article/5341468242779196.htm
Turn off all foreign key constraints before importing, and enable foreign key constraints after importing