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.
Summary: | Entity from Database wizard does not play well with existing persistence.xml | ||
---|---|---|---|
Product: | javaee | Reporter: | Petr Jiricka <pjiricka> |
Component: | Persistence | Assignee: | Sergey Petrov <sj-nb> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 235203 | ||
Bug Blocks: |
Description
Petr Jiricka
2013-08-26 12:02:32 UTC
I am trying this with latest build that contains Tomas's hotfix for bug 235203, and here are my observations: - Entity from Database wizard offers comp/DefaultDataSource - good - Persistence Unit wizard offers comp/DefaultDataSource - good - When I do steps 1-3, comp/DefaultDataSource is present in the combo box, but it's not preselected, it would be nice to preselect it - When I select it, the New Database Connection wizard pops up, offering me to register sun-appserv-sampes database connection, which is not registered by default - looks like this is by design - I go through the New DB Connection wizard and it works fine - When the IDE returns be to the Entity from DB wizard and comp/DefaultDataSource is selected, the tables are not populated - looks like a refresh problem; the workaround is to restart this wizard - When I do steps 1 and 3 (skipping step 2) from the initial description, and select create entities against comp/DefaultDataSource datasource, the IDE puts the following into persistence.xml: <jta-data-source>comp/DefaultDataSource</jta-data-source> - this is not incorrect, but could be omitted as it's assumed by default ok, so {1} remains as "preselect default ds", but current behaviour do not preselect also "jdbc/__default" if its' not yet properly registered withing ide, otherwise user will get a dialog right after click next. regarding {2} it's not an issue, user use current pu but generate entities from another resource to use with current pu, it works as designed. it may be new option to add new pu here but we remove any pu options from the wizard except creation and only in case of completely absent of any pu. now, if connection was once registered default datasource is preselected http://hg.netbeans.org/web-main/rev/53368171f5c3 Integrated into 'main-silver', will be available in build *201308310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/53368171f5c3 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: #235026 preselect default in empty case Petr, is there anything to fix in this issue, do you want to add "add one more pu" functionality to the wizard in addition to current "create new persietence.xml with pu" and "use existent pu"? > now, if connection was once registered default datasource is preselected > http://hg.netbeans.org/web-main/rev/53368171f5c3 Thanks. One question, what's the behavior for EE 6? Is it the same, or different from EE 7? > Petr, is there anything to fix in this issue I would not do anything for NB 7.4 - it's now too close to code freeze and we don't have a clear idea of the desired behavior. Maybe not even after 7.4 - it may not make sense to complicate the UI just to make minor improvements in the behavior. What do you think, should we just leave it as it is now? designed was - use pu if exist/no modification/no addition etc. or create new pu if no one exist. for ee6 as it's said above (just try to specify "jdbc/__default" in pu) and it will be preselected if connection is registered and will not be preselected if connection isn't registered, in my opinion it's one of possible designs. for now, preselection in case it was supported for other datasources is added, but feel free to reopen if we may want to do more here. |