Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346085 - QueryByExamplePolicy addSpecialOperation with attribute names
Summary: QueryByExamplePolicy addSpecialOperation with attribute names
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: submitted_patch
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 09:19 EDT by Jeff Domeyer CLA
Modified: 2022-06-09 10:31 EDT (History)
1 user (show)

See Also:


Attachments
proposed-patch (7.94 KB, patch)
2011-05-17 09:20 EDT, Jeff Domeyer CLA
no flags Details | Diff
Sample maven project utilizing the patch (27.22 KB, application/octet-stream)
2011-09-10 10:32 EDT, Jeff Domeyer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Domeyer CLA 2011-05-17 09:19:33 EDT
Currently when you are working with a QBEPolicy, you can only add special operations for class types. So if an attribute is of type String.class, then you can apply a special operation.

I've taken a stab at adding special operations with respect to attribute names with regular expression matching. That way you can identify all attributes that end with "Date" ("Date$") and apply a special operation.

If this seems like a good idea, I'd like to continue with adding more capabilities into the QBEPolicy. My current need is to apply logic of the nature:

startDate !>= some date and endDate !<= same date

In order to acquire effectively dated records that overlap with the specified start and end date. Adding the "not" into the mix is where it gets sticky as the only operation currently supported with "not" is notEqual.

So if I get a nod, I'll continue with this enhancement.
Comment 1 Jeff Domeyer CLA 2011-05-17 09:20:16 EDT
Created attachment 195851 [details]
proposed-patch
Comment 2 Tom Ware CLA 2011-07-06 10:43:42 EDT
Is this working for you?  Can you provide a sample of how you are using it?
Comment 3 Jeff Domeyer CLA 2011-09-10 10:32:34 EDT
Created attachment 203110 [details]
Sample maven project utilizing the patch

Sorry it took so long to get back to this!
Comment 4 Jeff Domeyer CLA 2011-09-10 10:38:20 EDT
The sample project just shows that it works, but it's not a clear use-case scenario. The enhancement allows for a more targeted application of special operations. Before you'd specify that Date classes should match the equal operation, whereas my use-case needs 2 different operations depending on if it's a startDate or an endDate.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:31:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink