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 93463 - Do not include classes into persistence.xml when is all included checkbox checked
Summary: Do not include classes into persistence.xml when is all included checkbox che...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on: 93274
Blocks:
  Show dependency tree
 
Reported: 2007-01-29 16:46 UTC by Michal Mocnak
Modified: 2007-10-30 18:20 UTC (History)
0 users

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 Michal Mocnak 2007-01-29 16:46:42 UTC
I have created an EJB module on glassfish app server. Then i've created entity
bean from db and as part of it also persistence unit. I have chosen a few tables
from jdbc/sample db. When all is finished edit persistence.xml file. There is
checkbox called 'Include All Entity Classe In ...'. This checkbox is checked and
if i understand its functionality well all entity classes what i selected before
will included. Ok. Also there is a list where i am able to add other entity
classes manually. And there is problem. In this list ther are all classes what i
selected before included. And i ask -> Is it necessarily to include these
classes in this list when the checkbox is checked ? I think that NO.

This problem is actual for some servers like a jboss (in severals
configurations) and also for oracle 10g. When i deploy this EJB module with
generated persistence.xml file with checked 'Include all..' checkob and classes
included in list the deployment failed. When i remove all classes from the list
everything is OK and persistence unit is registered successfully.
Comment 1 Erno Mononen 2007-02-09 16:17:07 UTC
Let me first try to clarify the purpose of the 'include all entity classes in 
module' check box. It is sort of a reverse 'exclude-include-classes' element of 
the persistence.xml schema. When the check box is checked, the persistence unit 
will include all entities that are discovered at deployment time. Now if you 
uncheck the check box and add an entity to the list, all other than the listed 
entity will not be included. 

So if I understood this correctly, the problem occurs when you have that check 
box checked, and then also such an entity in the 'include entity classes' list 
that would discovered even without specifying it in the list, right (so that it 
kind of gets defined twice now)?
Comment 2 Erno Mononen 2007-02-16 09:54:34 UTC
Could you please confirm whether my previous comment describes the problem 
accurately? Thanks.
Comment 3 Erno Mononen 2007-04-25 13:21:36 UTC
So there are two issues here, one is that the generated entities are 
automatically added as managed classes toa persistence unit even when they 
shouldn't be, e.g. in a EJB 3 module, where entities are by auto-discovered by 
default. This should be fixed when issue 93101 is resolved. The other issue, 
the list of entity classes being enabled even when the inlclude all check box 
is checked, should be fixed in the persistence.xml editor.
Comment 4 Erno Mononen 2007-04-25 13:23:45 UTC
This issue depends on 93274, not 93101.
Comment 5 Erno Mononen 2007-06-19 12:35:02 UTC
Now that issue 92374 has been fixed, IMO the remaining issue (see desc4) is rather a P3 than a P2.
Comment 6 Erno Mononen 2007-10-30 18:20:30 UTC
Fixed in trunk.

Checking in PersistenceUnitPanel.form;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.form,v  <--  
PersistenceUnitPanel.form
new revision: 1.3; previous revision: 1.2
done
Checking in PersistenceUnitPanel.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java,v  <--  
PersistenceUnitPanel.java
new revision: 1.11; previous revision: 1.10
done