Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329817

Summary: Registering of java entities in peristence.xml causes silent replacement of objects
Product: [WebTools] Dali JPA Tools Reporter: Stefan Dimov <stefan.dimov>
Component: FrameworkAssignee: dali.framework-inbox <dali.framework-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 2.3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Stefan Dimov CLA 2010-11-09 10:36:47 EST
Steps to reproduce:
    1. Import the last version of JPA Editor plugin from HEAD as a project
    2. Open a runtime Eclipse IDE in debug mode
    3. Create new JPA 1.0 project (in the runtime IDE) and make sure that the option "Annotated classes must be listed in persistence.xml"
    4. Go to target IDE and put two breakpoints in java files:
        a) org.eclipse.jpt.ui.diagrameditor.util.JPASolver [line: 520]
        b) org.eclipse.jpt.ui.diagrameditor.util.JPASolver [line: 1004] 
    5. Put a condition on both breakpoints:
         jpt.getName().endsWith("Mark")
    6. Open diagram of the JPA Project
    7. Create a new entity from the palette in the diagram
    8. Use direct editing and rename the new entity as 'Mark'
    9. The debugger will suspend execution a few times at the breakpoints. Notice the debug id of the object referenced by 'jpt' variable. Resume debugging with F8
   10. Use the context button of the entity 'Mark' to create a new attribute
   11. The debugger will stop a few times at the breakpoints. 

Result: Notice that the debug id of the 'jpt' object is already changed, hence this is another object.

This happens only if the java classes are being listed in persistence.xml and it causes a lot of errors in the diagram editor, because in the editor the grahical objects are mapped to the java persistence objects.
Comment 1 Stefan Dimov CLA 2010-11-10 03:44:19 EST

*** This bug has been marked as a duplicate of bug 257530 ***