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 202741 - Code completion for table names fails silently if database connection not registered
Summary: Code completion for table names fails silently if database connection not reg...
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Sergey Petrov
Depends on:
Reported: 2011-09-27 15:21 UTC by Petr Jiricka
Modified: 2015-09-17 13:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2011-09-27 15:21:53 UTC
1. Create a Java EE 6 Web application 
2. Register some database connection under Services
3. Create entities from this database
4. Close the project
5. Remove the connection in Services
6. Reopen the project - you will notice that the project will be correctly badged with an exclamation mark to indicate broken datasource
7. Open the generated entity class and press Ctrl+Space after @Table(name = "

Table names should be offered, but the IDE just says "No suggestions". The IDE should offer a way to address the situation, e.g. by fixing the broken datasource.

A similar situation may happen when opening an existing project, and not alerting the user may create a discoverability problem of the database code completion feature.
Comment 1 Sergey Petrov 2011-09-30 11:08:24 UTC
as it's said in 202742 correct badge is jee.common/web.project functionality, but there may be some api to check if datasource is valid(and also to fix later) from persistence side, need to use in code completion if available or consider to add.
Comment 2 Sergey Petrov 2011-10-27 11:50:43 UTC
one more issue is to suggest db connection creation for j2se project
Comment 3 Martin Balin 2015-09-17 13:09:46 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.