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: | MetadataElementHandle doesn't support Value type | ||
---|---|---|---|
Product: | db | Reporter: | Rob Englander <mindstream> |
Component: | DB schema | Assignee: | Jaroslav Havlin <jhavlin> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews, matthias42, mmirilovic |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST, PATCH_AVAILABLE |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 155714 | ||
Attachments: |
proposed patch v1
Proposed Patch v2 Proposed Patch v3 |
Description
Rob Englander
2009-01-05 19:24:33 UTC
Sorry, I don't understand this. Can you provide some more background to help me understand? Thanks. MetadataElementHandle is missing code for resolving Value handles. There is no "Kind" for org.netbeans.modules.db.metadata.model.api.Value. So, for instance, I can't create a handle to the Value instance I get back from calling Procedure.getReturnValue(); OK, got it, thanks. Created attachment 126262 [details]
proposed patch v1
The attached bug fixes this problem at the cost of an api breach.
I was not able to create a procedure in derby that returns a value, so I looked at functions, which by definition return a value. I extended the metadata to include functions and added a resolve-method for functions and returnvalues to the MetadataElementHandle.
I extended the unittest to verify resolving handles for parameters, functions, procedures and returnValues.
Please have a look at it (i wouldn't consider it for 7.3!)
Created attachment 131279 [details]
Proposed Patch v2
Updating Matthias's patch (increased version number, added @since tags).
Thank you very much for providing the patch.
Please review changes in module db.metadata.model. The module API is not public (friend private), so the API review is not mandatory, but if you are interested, please check it. Thank you. API Changes (under org.netbeans.modules.db.metadata.model): New classes: api.Function spi.FunctionImplementation New methods: api.Schema.getFunctions() api.Schema.getFunction(String name) spi.SchemaImplementation.getFunctions() spi.SchemaImplementation.getFunction(String name) Changed methods (incompatible API changes): (return type changed from api.Procedure to api.MetadataElement) api.Parameter.getParent() spi.ParameterImplementation.getParent() Y01a If the change is incompatible, it is better to increase the major version (the one after /). That will prevent linkage errors (old client w/ new API). Y01b Alternatively consider keeping compatibility by adding new method getEnclosingElement() and deprecating getParent (while keeping its behavior in previously existing situations). Created attachment 131302 [details]
Proposed Patch v3
Y01 - I think a) is fine in this case. Specification version changed to 1.0.
Thank you.
Unless there are any objections, I'll integrate tomorrow. Thank you. Integrated as http://hg.netbeans.org/core-main/rev/2dad0543da3a Integrated into 'main-golden', will be available in build *201302222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2dad0543da3a User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #156304: MetadataElementHandle doesn't support Value type |