Bug 1076473 - Data Modeler should not over-write externally added annotations
Summary: Data Modeler should not over-write externally added annotations
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Data Modeler
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER5
: 6.1.0
Assignee: Walter Medvedeo
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-14 12:23 UTC by jbride@redhat.com
Modified: 2020-03-27 19:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:45:35 UTC
Type: Feature Request
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1061350 0 medium CLOSED DM discards everything it cannot display to the user 2021-02-22 00:41:40 UTC

Internal Links: 1061350

Description jbride@redhat.com 2014-03-14 12:23:44 UTC
Hi.
  Seems that a common use-case will be initial creation of POJOs via the Data modeler and subsequent refinement of those POJOs by more specialized tools.  ie;  via JBDS: add JPA/Hibernate or JAXB annotations.  
  Afterwards, further changes to those now JPA or JAXB annotated POJOs in the Data Modeler should not over-write nor eliminate those annotations.  At least in BPMS6.0.0.GA, the data modeler removes the annotations that have been tacked on to POJOs external of the data modeler.

thanks!  jeff

Comment 2 Zuzana Krejčová 2014-03-18 10:12:35 UTC
This might be considered as a duplicate of bug 1061350.

Comment 3 Walter Medvedeo 2014-05-13 09:05:11 UTC
Annotations preservation will be delivered for community version 6.1, and after that included in next GA version.

Comment 4 Walter Medvedeo 2014-06-02 08:50:19 UTC
Annotations preservation was implemented and pushed in master branch, so the feature should be testable in community 6.1.CR releases.

Comment 5 Walter Medvedeo 2014-11-10 10:19:30 UTC
The feature was implemented in both 6.2.x community and 6.1.0 CR1 releases.

Comment 6 jvahala 2015-01-15 12:43:09 UTC
It seems that annotations disappear above constructors. Classes, methods and fields works fine. Moving back to Assigned.

Comment 7 Walter Medvedeo 2015-01-15 13:32:55 UTC
One remark about this.

For drools purposes it's necessary automatically generate four constructors.
Empty constructor (no arguments), a constructor with all fields, a constructor with all fields annotated as @Position, and a constructor with all fields annotated as @Key. 
Because of that constructors are re-generated, when new fields are added, or annotated, etc.

For this version it was defined that constructors will be created and deleted again. This explains why constructors can loose annotations. But this is part or current definition.

Comment 8 Edson Tirelli 2015-01-15 15:04:08 UTC
Walter, I believe the correct behavior is to not override existing constructors. The 4 constructors you mentioned are created as helpers, there are no hard requirements that depend on such constructors (other than the no-arg constructor), so the best thing to do is to preserve existing constructors and just add new constructors if they do not exist.

Comment 9 Walter Medvedeo 2015-01-21 09:43:02 UTC
The criteria for generating the constructors were changed, and now existing user generated constructors are preserved. Data modeller generated constructors are still generated but only when they don't conflict with user generated ones.
This new criteria solves the issue.

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


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


 push 6.2.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/3a73a8c55


 push 6.2.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/f3fa0582b


PS: This commits includes some modifications that solves the following BZs.

https://bugzilla.redhat.com/show_bug.cgi?id=1173075
https://bugzilla.redhat.com/show_bug.cgi?id=1173089

Comment 10 jvahala 2015-02-13 13:28:13 UTC
Annotations above the constructors don't disappear anymore. 

Verified with ER5.


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