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 156304

Summary: MetadataElementHandle doesn't support Value type
Product: db Reporter: Rob Englander <mindstream>
Component: DB schemaAssignee: 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
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