0
I’m having trouble every time I need to use JPA Tools' Generate Entities of Table (use Eclipse Neon.3). I run 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 save everything right. When I need to use the Generate Entities of Table command again, when I will look at the same class I entered the orphanRemoval=true
no longer exists.
How do I set up Jpatools (on the Generate Custom Entities screens) to insert orphanRemoval=true in a relationship, so that it is stored and every time you need to use the command to generate table entities it automatically inserts orphanRemoval? Just like you select Cache on the Generate Custom Entities screen and it keeps it memorized.
See the case code snippet below:
When I Gero the entity with JPA Tools:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL})
private Set<PessoaContato> listaPessoaContato;
I manually enter the orphanRemoval and saved code:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL},orphanRemoval=true)
private Set<PessoaContato> listaPessoaContato;
When I need to regenerate, jpa tools overwrites all classes by deleting everything that is entered manually, so the code snippet gets rewritten:
@OneToMany(mappedBy="pessoa", cascade={CascadeType.ALL})
private Set<PessoaContato> listaPessoaContato;
Hello, Fredebr. Welcome to [en.so]! Unfortunately I don’t know how to answer the question (because I haven’t used Eclipse for years). However, I want to warn those who voted to close that the question is perfectly clear: the questioner is using a code generation tool in the Eclipse editor and needs the generated code to have a certain feature. Whether or not it is possible to customize the tool I do not know, but it is a perfectly valid question.
– utluiz