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 89092 - Entity Classes from DB: @Table does not include the schema name
Summary: Entity Classes from DB: @Table does not include the schema name
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker with 1 vote (vote)
Assignee: Andrei Badea
URL:
Keywords:
: 121995 124506 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-10 09:37 UTC by schiefer
Modified: 2016-07-07 08:55 UTC (History)
4 users (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 schiefer 2006-11-10 09:37:44 UTC
I noticed the this behavior when creating entities from DB/2 tables. The
entities were created without problems but the schema that I selected when I
created the datasource within Netbeans wasn't added to the entities annotations.
I changed 

@Table(name = "name") to @Table(name = "name", schema = "schema")

and now everything works fine.
Comment 1 Andrei Badea 2006-11-10 15:13:21 UTC
Deserves more thinking. It would be nice if the schema was added only when
neceesary (that is, when that schema is not the default schema for that database
user). Unfortunately there is no way in JDBC to get the default schema. OTOH, if
we add the schema, should we also add the catalog? Perhaps we could have an
option like "fully qualify table names" which would add both the catalog and schema.
Comment 2 Jan Stola 2007-11-09 12:26:47 UTC
Don't forget to provide the same functionality in EntitiesFromDBGenerator, thanks.
Comment 3 David Vancouvering 2008-01-11 23:05:31 UTC
*** Issue 124506 has been marked as a duplicate of this issue. ***
Comment 4 Andrei Badea 2008-03-27 12:33:37 UTC
*** Issue 121995 has been marked as a duplicate of this issue. ***
Comment 5 Dongmei Cao 2008-06-05 23:26:12 UTC
Add schema and catalog attributes for @Table when fullyQualifiedTableNames is set
http://hg.netbeans.org/main?cmd=changeset;node=9381d9899ef0
Comment 6 Dongmei Cao 2008-06-18 00:28:40 UTC
catalog and schema will be generated on @Table if Fully Qualified Table Names is checked in the very last step of the
wizard.
Comment 7 brkrishnareddy 2015-04-08 13:00:35 UTC
Hi Team,

We are working on deploying EJB CMP 2.x into GlassFish server, so we are trying to generate dbschema using CaptureSchema utility. 
We are using DB2 database and we have aliases for every table. When we run CaptureSchema,  dbschema is generating meta data for only tables but not considering the table aliases. We tried to change the CaptureSchema.java code to pass Table Type as Alias also, but there was no luck.

Can someone please guide us in using CaptureSchema tool with table Aliases.


Many Thanks,
Ramakrishna.
Comment 8 Martin Balin 2016-07-07 08:55:48 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