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 76635 - when entity class is deleted/renamed also delete/rename its entry in PU(s)
Summary: when entity class is deleted/renamed also delete/rename its entry in PU(s)
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on: 76722
Blocks:
  Show dependency tree
 
Reported: 2006-05-20 16:22 UTC by Pavel Buzek
Modified: 2007-06-26 17:04 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 Pavel Buzek 2006-05-20 16:22:11 UTC
Since the entries are being added automatically we should also rename/delete
entries in PU when the class gets renamed/deleted (as a refactoring).
Comment 1 Erno Mononen 2006-05-22 07:56:48 UTC
This is actually implemented, and it works for me. I tested following:

1. Created a PU and an entity
2. Added that entity to a PU (if neede, as you wrote, in Java application they 
are added automatically)
3. Performed rename / safely delete 

Seemed to work for EJB module, Web module and Java application. Could please 
provide steps to reproduce?
Comment 2 Pavel Buzek 2006-05-22 15:37:26 UTC
You are right, it works. I was just confused - rename refactoring is started
even if you rename the object using inplace editor, but for delete you have to
be careful to use Safe Delete, not the Dangerous Delete. I do not know why this
is so, but I understand this is not a problem of persistence.xml. Sorry.
Comment 3 jrojcek 2006-05-23 09:23:02 UTC
The purpose of Safe Delete is to check before deleting a class whether there are references for this class. It 
was not supposed to correct any references. It just informs the user that there are references and the user 
can decide whether to delete it anyway. 

I think the entity class and PU is a bit different case. We're trying to automatically update PU when a new 
class is created, so we should update PU even if a class is deleted. I don't mean the safe delete. I mean just 
the regular delete.

I expect there might be some problems with automatic update,  but I'm reopening while we're discussing 
this issue.
Comment 4 jrojcek 2006-05-23 09:44:49 UTC
I filed issue #76722 for safe delete not being integrated with regular delete. But I think it's still a different 
issue than this one.
Comment 5 Erno Mononen 2006-08-02 14:44:04 UTC
Will be fixed when issue 76722 is fixed, which very likely won't happen in 5.5 
timeframe => TM Dev.
Comment 6 Erno Mononen 2007-06-26 17:04:50 UTC
Fixed now since issue 76722 has been fixed.