Community
Participate
Working Groups
Build Identifier: I20110525-0800 On the first page, Select Tables, of entity gen, it's better to show a default schema, which could be the first one in the list, along with the tables of that schema if choosing an active connection or connecting to a database through that Connect button. Currently, if selecting a connection or connecting to a database on this page, nothing shows up in the schema and the tables lists which gives a fault impression that the selected connection is inactive. Reproducible: Always
Moving JPA specific bugs to new JPA component in bugzilla.
Created attachment 205666 [details] Proposed Patch
I think we need to first default to the JPA project's default schema to cover the case where the user is generating from a schema that is not the default schema of the login. Also, when calling iterator.next(), it is good to know whether or not that next item exists (to avoid an exception). I don't think it is likely to encounter a database without any schemas, but I suppose it is possible, so probably good to check just in case.
Created attachment 208005 [details] Proposed Patch Regarding the comment of iterator.next(), the returned schema will be null if a database has no schema and null checks already exist at the places where getDefaultSchema() is invoked so I think it's unnecessary to add extra null check for it. Let me know if you have different opinions. Thanks!
(In reply to comment #4) > Created attachment 208005 [details] > Proposed Patch > > Regarding the comment of iterator.next(), the returned schema will be null if a > database has no schema and null checks already exist at the places where > getDefaultSchema() is invoked so I think it's unnecessary to add extra null > check for it. Let me know if you have different opinions. Thanks! I see what you meant so ignore this comment and I'll update the code and upload a new patch.
(In reply to comment #5) > (In reply to comment #4) > > Created attachment 208005 [details] [details] > > Proposed Patch > > > > Regarding the comment of iterator.next(), the returned schema will be null if a > > database has no schema and null checks already exist at the places where > > getDefaultSchema() is invoked so I think it's unnecessary to add extra null > > check for it. Let me know if you have different opinions. Thanks! > > I see what you meant so ignore this comment and I'll update the code and upload > a new patch. oh, I forgot that I did go through the code of getDatabase().getSchemata(). It seems it would never be null. An empty array iterable will be returned if no schema exists in the database so a null check is probably still unnecessary. Let me what you think. Thanks!
Created attachment 208009 [details] Proposed Patch I should get it right this time. :)
Patch applied to head.