Bug 355093 - Add new 'includeCriteria' flag to Multitenant metadata
Summary: Add new 'includeCriteria' flag to Multitenant metadata
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-18 10:33 EDT by Guy Pelletier CLA
Modified: 2022-06-09 10:20 EDT (History)
2 users (show)

See Also:


Attachments
Proposed changes - trunk (12.44 KB, patch)
2011-08-18 14:47 EDT, Guy Pelletier CLA
no flags Details | Diff
Proposed changes - 2.3.1 stream (4.57 KB, patch)
2011-08-18 15:01 EDT, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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