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 226646 - New Entity Classes from Database wizard don't see Database connection
Summary: New Entity Classes from Database wizard don't see Database connection
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 11:51 UTC by jbalaz
Modified: 2016-07-07 08:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
First open of the New Entity Classes from Database (75.41 KB, image/jpeg)
2013-02-27 12:43 UTC, jbalaz
Details
Second open of the New Entity Classes from Database (66.20 KB, image/jpeg)
2013-02-27 12:44 UTC, jbalaz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jbalaz 2013-02-25 11:51:29 UTC
I added new Database connection on the service tab 
right click on the package with database model and select 
generate new entity classes from database. When wizard 
open I don't see any Database connections from my connection 
list, in the drop down menu there was a Fetch from the server. 
I close the wizard restart IDE and open wizard same way as
before and I see all database connections.
Comment 1 Jaroslav Havlin 2013-02-27 10:20:13 UTC
I'm sorry, I cannot reproduce this bug.
Reassigning to javaee/Persistence. Sergey, can you please evaluate it? Thank you.
Comment 2 Sergey Petrov 2013-02-27 12:12:22 UTC
doesn't seems common and workaround isn't perfect by also simple enough.
anyway sorry but there are no details .
- what project type is used
- for maven: was server set at project creation? was it set later?
- what server is used
- what connection is created?
- what do you mean "all connections", do you have more connections except one created in the issue?

please reopen the issue with details.
Comment 3 jbalaz 2013-02-27 12:43:44 UTC
Created attachment 131961 [details]
First open of the New Entity Classes from Database
Comment 4 jbalaz 2013-02-27 12:44:46 UTC
Created attachment 131962 [details]
Second open of the New Entity Classes from Database
Comment 5 jbalaz 2013-02-27 12:50:40 UTC
I used maven based webapplication project. 
Maven version is 3.0.4 local instalation not budnled in NB.
Java version I using is 1.7.0_10 (64 bit)

Server was not set at project creation. I set it manually later. 
I used connection to Oracle DB server with ojdbc driver (driver version 11.2.0.3.0)

Oracle DB version 11g Enterprise Edition Release (11.2.0.1.0)

I created through wizard Oracle Thin. 


Attached images
First open -> fresh start of the NB 
1. selected package with DB model
2. right click on package select New -> Entity Classes from Database
3. Data sources are present click Cancel to close wizard
4. Now again steps 1 and 2 
5. Image Second open depicts the result don't see database conections. After click to Fetch from server NB Select deployment windows appears.

Hope this helps
Comment 6 Sergey Petrov 2013-02-27 13:45:18 UTC
ok, it's not as described before but first open show conenctions and second one do not show. but correct behavior is second one, if server isn't set, project should request connections avalable for some server, it shouldn't use some already registered connection.
Comment 7 jbalaz 2013-02-27 14:01:45 UTC
Correct me if I'm wrong but if I understand correctly what you wrote. Why should database connection be dependent on application server? I develop under glassfish but application should be deployed also on jboss, tomcat and so on. 

I generate entity classes for persistance layer and do not care about application server at this time.
Comment 8 jbalaz 2013-02-27 14:36:46 UTC
Therefore I think that correct behavior is first one. If I want to generate entities for RCP application I will not define application server.
Comment 9 Sergey Petrov 2013-02-27 14:45:49 UTC
At least it's just isn't supported maven and ant functionality match and require to know server to get what is supported and to generate persistence.xml, jpa controllers etc based on environment. There may be more dependency on server I miss right now, for example jpa version supported and more.
If you need just entities you can always create j2se library module instead of web/ee.
Comment 10 Sergey Petrov 2013-02-27 14:47:37 UTC
what I mean isn't supported is to get entities from somewhere and then configure server to work with this entities properly, you always need first to configure server and then project to depend on this configuration.
Comment 11 Sergey Petrov 2013-03-15 11:14:45 UTC
*** Bug 227485 has been marked as a duplicate of this bug. ***
Comment 12 Sergey Petrov 2013-03-25 10:28:08 UTC
>P4 for now as it's the issue but gives once extra functionality which isn't supported in real, will change back if there will be more complains about unclear behaviour.
Comment 13 Martin Balin 2016-07-07 08:56:17 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss