This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 173148 - Refactoring doesn't cause persistence.xml to be updated
Summary: Refactoring doesn't cause persistence.xml to be updated
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on: 173346
Blocks: 173299
  Show dependency tree
 
Reported: 2009-09-26 14:12 UTC by edburns
Modified: 2009-11-16 03:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description edburns 2009-09-26 14:12:30 UTC
I recently performed a rename on some classes in my maven project open in NetBeans but I noticed that the <class> entries in my persistence.xml were not 
refactored accordingly.

I imagine the same is true when you have class references in your faces-config.xml or web.xml.

Fixing this would be a big boost.

I think this is a P2, but you can downgrade it.  I won't be offended.
Comment 1 edburns 2009-09-26 14:34:36 UTC
I think this goes for Facelets pages too.  Refactoring doesn't cause any references that may reside in facelet pages to be updated.
Comment 2 Petr Jiricka 2009-09-29 17:30:13 UTC
Let's have a one issue per technology, i.e. this one for persistence.xml. For other technologies, there are many
refactoring-related issues already filed, let's collect them under umbrella issue 173299 that I just created. (For
web.xml this should definitely work, probably also for faces-config.xml.)

For persistence.xml, this *is* supposed to work, see also issue 74859. I am reassigning to Sergey to investigate.
Comment 3 Sergey Petrov 2009-09-30 10:47:09 UTC
can't verify in 6.8 because of #173346, but will try 6.7 also.
but for j2se project found if peristence.xml in design view isn't updated but persistence.xml is updated. if it's the
case it's not p2.
What nb version have the issue? I'm sure it's not nb 5.0..
Comment 4 Sergey Petrov 2009-09-30 12:47:38 UTC
the same in 6.7, only design view isn't refreshed. in this case deployment and execution should work as expected. ->p3
feel free to rise back if I can't reproduce worst case or at least add more commenns if there is another issue I can't
reproduce.
Comment 5 edburns 2009-10-02 03:25:33 UTC
Please know that it's a maven project with the persistence.xml in src/main/resources/META-INF/persistence.xml, which I
think is where maven expects it to be.

NetBeans build web-main-1657-090923
Comment 6 Sergey Petrov 2009-10-02 07:36:53 UTC
yes, all except design view refresh work in maven project for me.
Comment 7 Sergey Petrov 2009-11-05 13:11:58 UTC
just tried again with web maven project (with usage of "include entity classes" option.
tried package rename, all 4 classes was moved to new package, tried entity class move and tried entity class rename.

it's unclear from last comment if there an problem with refactoring itself or only with design view refresh,
edburns can you clarify?
will look for view refresh issue now.
Comment 8 Sergey Petrov 2009-11-06 09:35:05 UTC
as it may not be fixed in 6.8, for furute reference:
PersistenceToolBarMVElement::propertyChange contain "&& !this.equals(puDataObject.getActiveMultiViewElement0())".
may be some new event should be added for cases like refactoring/addition of new classes in project. ( it may be good to
handle addition of classes as separate event as it may allow to refresh only classes list instead of complete view ) as
with updates from xml editor.
Comment 9 Petr Jiricka 2009-11-09 02:15:36 UTC
Integrated into 'main-golden', will be available in build *200911070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3e4273080f3f
User: sergeyp@netbeans.org
Log: fix #173148 - some work to fix, modified api to separate addition/removal of classes from design view editor from all other updates, may be changed later or roll backed.
Comment 10 Sergey Petrov 2009-11-13 04:40:10 UTC
web-main:7b58115c55a5
fixed refresh of active design view
Comment 11 Quality Engineering 2009-11-16 03:12:31 UTC
Integrated into 'main-golden', will be available in build *200911160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7b58115c55a5
User: sj-nb@netbeans.org
Log: fix #173148 - view is updated now if active and update is by some action outside of designer