Bug 156304 - MetadataElementHandle doesn't support Value type
MetadataElementHandle doesn't support Value type
Status: RESOLVED FIXED
Product: db
Classification: Unclassified
Component: DB schema
6.x
All All
: P3 (vote)
: 7.4
Assigned To: Jaroslav Havlin
issues@db
: API, API_REVIEW_FAST, PATCH_AVAILABLE
Depends on:
Blocks: 155714
  Show dependency treegraph
 
Reported: 2009-01-05 19:24 UTC by Rob Englander
Modified: 2013-02-23 04:13 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
proposed patch v1 (40.30 KB, patch)
2012-10-21 14:52 UTC, matthias42
Details | Diff
Proposed Patch v2 (44.77 KB, patch)
2013-02-12 10:01 UTC, Jaroslav Havlin
Details | Diff
Proposed Patch v3 (44.82 KB, patch)
2013-02-12 15:53 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Englander 2009-01-05 19:24:33 UTC
The MetadataElementHandle doesn't support Value type.
Comment 1 David Vancouvering 2009-01-05 19:42:04 UTC
Sorry, I don't understand this.  Can you provide some more background to help me understand?  Thanks.
Comment 2 Rob Englander 2009-01-05 19:54:06 UTC
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();
Comment 3 David Vancouvering 2009-01-05 20:10:24 UTC
OK, got it, thanks.
Comment 4 matthias42 2012-10-21 14:52:44 UTC
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!)
Comment 5 Jaroslav Havlin 2013-02-12 10:01:17 UTC
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.
Comment 6 Jaroslav Havlin 2013-02-12 10:05:29 UTC
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()
Comment 7 Jaroslav Tulach 2013-02-12 12:01:13 UTC
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).
Comment 8 Jaroslav Havlin 2013-02-12 15:53:25 UTC
Created attachment 131302 [details]
Proposed Patch v3

Y01 - I think a) is fine in this case. Specification version changed to 1.0.
      Thank you.
Comment 9 Jaroslav Havlin 2013-02-19 09:09:57 UTC
Unless there are any objections, I'll integrate tomorrow.
Thank you.
Comment 10 Jaroslav Havlin 2013-02-20 16:16:17 UTC
Integrated as http://hg.netbeans.org/core-main/rev/2dad0543da3a
Comment 11 Quality Engineering 2013-02-23 04:13:17 UTC
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo