I'm having a problem every time I need to use the Generate Entities of Table from JPA Tools (use Eclipse Neon.3). I generate the entities with the Generate Entities of Table command from JPA Tools. In the code of a class in the annotation of a relationship I add the code orphanRemoval=true
and saved everything right. When I need to use the Generate Entities of Table command again, when I look at the same class I entered, the orphanRemoval=true
no longer exists.
How do I configure JPATools (Generate Custom Entities screens) to insert orphanRemoval = true in a relationship so that it is stored and every time I need to use the command to generate the table entities automatically enter orphanRemoval? Just like you select cascade on the Generate Custom Entities screen and it keeps memorized.
See the code snippet below:
When you generate the entity with JPA Tools:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL})
private Set<PessoaContato> listaPessoaContato;
Manually enter orphanRemoval in the code and save:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL},orphanRemoval=true)
private Set<PessoaContato> listaPessoaContato;
When I need to regenerate again, jpa tools overwrites all classes by deleting everything that is manually entered, so the code snippet returns:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL})
private Set<PessoaContato> listaPessoaContato;