Bug 1041760 - Data Modeler deletes annotations added in Eclipse
Summary: Data Modeler deletes annotations added in Eclipse
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Data Modeler
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER1
: 6.0.1
Assignee: Walter Medvedeo
QA Contact: Jiri Locker
URL:
Whiteboard:
: 1063312 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 19:12 UTC by David Murphy
Modified: 2014-08-06 20:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:03:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1066616 0 high CLOSED POJO previously externally modified cannot be changed in the DM 2021-02-22 00:41:40 UTC

Internal Links: 1066616

Description David Murphy 2013-12-12 19:12:32 UTC
Description of problem:
When roundtripping between Data Modeler and Eclipse, validation annotations added to fields in Eclipse are removed when updating the class in the Data Modeler.


Version-Release number of selected component (if applicable):


How reproducible:
On Demand


Steps to Reproduce:
1. In Data Modeler, create new type Test
2. Add a field test with type java.lang.String
3. Save the Data Model
4. In project imported into Eclipse, open Test class
5. Add @Size(max=10) javax.validation annotation
6. Commit and Push changes
7. In Data Modeler, add a new field (otherTest) to Test
8. Save the Data Model
9. Pull changes in Eclipse
10. Open Test class

Actual results:
Validation annotation is removed from test field

Expected results:
Validation annotations remain on test field


Additional info:

Comment 2 Walter Medvedeo 2013-12-13 08:30:59 UTC
Current data modeller do not support arbitrary annotations. (It's not java programming IDE).
In my opinion enable support for arbitrary annotations is a feature request, not a bug.
To support arbitrary annotations also carries the problem of dependencies, the same as happens in whatever other tool. If you use for example an annotation that belongs to a third party java libray, you should add the corresponding dependency to the project, etc.

I added @etirelli and @pzapataf in the CC list so that they can evaluate this.

Comment 3 David Murphy 2013-12-13 13:17:40 UTC
(In reply to Walter Medvedeo from comment #2)
> Current data modeller do not support arbitrary annotations. (It's not java
> programming IDE).
> In my opinion enable support for arbitrary annotations is a feature request,
> not a bug.
> To support arbitrary annotations also carries the problem of dependencies,
> the same as happens in whatever other tool. If you use for example an
> annotation that belongs to a third party java libray, you should add the
> corresponding dependency to the project, etc.
> 
> I added @etirelli and @pzapataf in the CC list so that they can evaluate
> this.

The Data Modeler may not be an IDE, but Eclipse is. If I modify the classes generated by the Data Modeler, maybe the Data Modeler should no longer display the class. The bug is that there is loss of code without warning.

Comment 4 Edson Tirelli 2013-12-13 15:36:32 UTC
Walter, ideally we need the data modeller to preserve customer provided annotations, so it is something for the todo list. 

Having said that, I am nacking this for 6.0.0 and proposing it for 6.0.1. If it is not possible, lets discuss in engineering the alternatives.

Comment 5 Pedro Zapata 2014-01-15 11:42:24 UTC
The only and generic solution is to avoid consuming and introspecting compiled bytecode and start doing source code analysis. This change should be targeted for future versions, not for 6.0.1. This same problem occurs for any type of asset that has a UI. Data modeler is a tool aimed to non-developers and analyst capturing requirements.

To increase robustness and reliability for 6.0.1 the following can be implemented:

- Detect whether a change has been done to the POJO source code outside the data modeler editor (i.e with Eclipse). If so, then the data modeler UI will display the POJO in read-only mode, without the possibility of overwriting the changes made outside of data modeler. This option is safer and will avoid code loss scenarios.

Comment 6 Walter Medvedeo 2014-01-27 15:58:12 UTC
According to the specification above, controls were added in order to detect if a file was created/modified by an external tool.
To prevent loosing code pushed form external editors, if file was created/modified by an external editor the data modeller will show 
the file in read only mode. It means that It won't be possible to modify or delete the corresponding pojo from the datamodeller.
When the model is opened, if there are readonly objects the user will receive an information dialog showing the list of readonly objects. After the information dialog is closed, readonly objects will show the sufix (read only) in the navigation breadcrumb.


master URL: http://github.com/droolsjbpm/kie-wb-common/commit/83842a356

push 6.0.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/24d2441b2

Comment 7 Pedro Zapata 2014-02-10 14:15:32 UTC
*** Bug 1063312 has been marked as a duplicate of this bug. ***

Comment 8 Jiri Locker 2014-02-28 10:27:54 UTC
Verified in ER1. However the solution described in comment 6 is going to be obsoleted by bug 1066616.


Note You need to log in before you can comment on or make changes to this bug.