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

Bug 355093

Summary: Add new 'includeCriteria' flag to Multitenant metadata
Product: z_Archived Reporter: Guy Pelletier <guy.pelletier>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: douglas.clarke, eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed changes - trunk
none
Proposed changes - 2.3.1 stream none

Description Guy Pelletier CLA 2011-08-18 10:33:49 EDT
This flag is of particular importance when using Oracle VPD (but not limited to) where we only need the multitenant id values populated in the db. The db takes care of the rest.

The following will be added to the Multitenant annotation

/**
 * (Optional) Indicate if the database requires the tenant criteria to
 * be added to the SELECT, UPDATE, and DELETE queries. By default this is
 * done but when set to false the queries will not be modified and it will
 * be up to the application or database to ensure that the correct criteria 
 * is applied to all queries.
 */
boolean includeCriteria() default true;

And the following attribute to the XML multitenant element.

<xsd:attribute name="include-criteria" type="xsd:boolean"/>
Comment 1 Guy Pelletier CLA 2011-08-18 14:47:39 EDT
Created attachment 201741 [details]
Proposed changes - trunk
Comment 2 Guy Pelletier CLA 2011-08-18 15:01:24 EDT
Created attachment 201742 [details]
Proposed changes - 2.3.1 stream

Note: only the core changes are being added to the 2.3.1 stream and not the new API. Users can configure through the use of a customizer.
Comment 3 Guy Pelletier CLA 2011-08-18 15:42:28 EDT
Changes have been submitted.

Verified by: Tom Ware

Tests: N/A. Tested manually and with the JPA VPD example.
Comment 4 Doug Clarke CLA 2011-08-18 15:44:02 EDT
Comments om latest patch:

1. Comments on the INTERNAL API should describe similar information to what is in @Multitenant or should have a reference to the description.

2. The reference to Oracle VPD should be more generic stating something like: Database solution (i.e. Oracle VPD) or additional critera added by the application.
Comment 5 Guy Pelletier CLA 2011-08-18 15:54:33 EDT
Comments have been updated.

    /**
     * ADVANCED:
     * Boolean used to indicate if the database requires the tenant criteria to
     * be added to the SELECT, UPDATE, and DELETE queries. By default this is
     * done but when set to false the queries will not be modified and it will
     * be up to the application or database to ensure that the correct criteria 
     * is applied to all queries.
     * 
     * @see org.eclipse.persistence.annotations.Multitenant
     */
    public void setIncludeTenantCriteria(boolean includeTenantCriteria) {
        this.includeTenantCriteria = includeTenantCriteria;
    }
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:20:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink