| Summary: | Entity Gen Wizard: Better to show a default schema when choosing a connection | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Nan Li <nan.n.li> | ||||||||
| Component: | JPA | Assignee: | Nan Li <nan.n.li> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | CC: | neil.hauge | ||||||||
| Version: | unspecified | Flags: | neil.hauge:
review+
|
||||||||
| Target Milestone: | 3.2 M5 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Nan Li
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. |