Java Many to Many Relation Duplicate Entry Exception -


i have 3 tables:

  • person: id, name
  • property: id, description
  • person_x_properties: id_person, id_property

on java have code example:

entitymanager em = getentitymanager();

person.setpropertylist(propertylist); property.setpersonlist(personlist);

for (...) {     //     //  <-no problem these lines there numeric operations     //     em.merge(property); }  em.merge(person); 

then message (duplicate entry @ person_x_properties [xxx, yyy]).

i have been searching solutions , have 1 possible:

  • assign list in 1 of them.

it works dont because need information in 2 objects future.

anyone can give me orientation please?

thanks!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -