Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346085

Summary: QueryByExamplePolicy addSpecialOperation with attribute names
Product: z_Archived Reporter: Jeff Domeyer <domeyerj>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: submitted_patch
Attachments:
Description Flags
proposed-patch
none
Sample maven project utilizing the patch none

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