Community
Participate
Working Groups
Currently I can drag and drop an Embeddable into the JPA Diagram Edtior. On the forums Stefan information me this is a bug: 1. Yes, it's a bug. The embeddable classes are not supposed to appear in the diagram, since they don't represent persistable entities. I haven't tested it, but what about the use case where you decide to change an Entity to an Embeddable, should it be removed from the diagram at that point?
> ... > I haven't tested it, but what about the use case where you decide to change an > Entity to an Embeddable, should it be removed from the diagram at that point? > ... Yes, it should.
Created attachment 180238 [details] patch
*** Bug 322782 has been marked as a duplicate of this bug. ***
Seems that the patch is incompatible with the latest in HEAD
Created attachment 180487 [details] make patch to be compatible with the head
When you change the mapping of the entity it disappears from the diagram. But if after that you try to open the java source code of the same class it seems that it's still entity - not embeddable or whatever. And if you change the mapping of the entity while it's open in the java editor as in the diagram editor then the mapping of the entity really changes, but a pop-up dialog appears showing some conflict between the editors.
Sorry for the double comment - browser problems ...
Created attachment 180870 [details] patch
Created attachment 180944 [details] patch If there is an a relation between two entities and the mapping of one of them is changed (to Embeddable, MappedSuperclass or just remove any class annotations), the pictogram element will be removed from the diagram with the relation element.
Now the ex-entity (along with its relations) is being removed properly from the diagram but there seems to be another problem: 1. Create two entities in the diagram with one-to-one bidir relation between them. 2. Change the inverse entity mapping to 'embeddable'. 3. Change the new embeddable class mapping back to entity through java editor or JPA details view 4. Drag the ex-embeddable entity back into the diagram Result: The entity appeares into the diagram, but the relation between the entities doesn't appear.
Created attachment 181383 [details] patch
Created attachment 181393 [details] patch The patch works fine, but there was a littlw correction that had to be done, so I did it and I'm submitting another version of the patch
patch submitted ...