Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 355093 | Differences between
and this patch

Collapse All | Expand All

(-)trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/descriptors/DescriptorQueryManager.java (-1 / +24 lines)
Lines 15-20 Link Here
15
 *       - 337323: Multi-tenant with shared schema support (part 2)
15
 *       - 337323: Multi-tenant with shared schema support (part 2)
16
 *     05/24/2011-2.3 Guy Pelletier 
16
 *     05/24/2011-2.3 Guy Pelletier 
17
 *       - 345962: Join fetch query when using tenant discriminator column fails.
17
 *       - 345962: Join fetch query when using tenant discriminator column fails.
18
 *     08/18/2011-2.3.1 Guy Pelletier 
19
 *       - 355093: Add new 'includeCriteria' flag to Multitenant metadata
18
 ******************************************************************************/  
20
 ******************************************************************************/  
19
package org.eclipse.persistence.descriptors;
21
package org.eclipse.persistence.descriptors;
20
22
Lines 69-74 Link Here
69
    protected transient DeleteObjectQuery deleteQuery;
71
    protected transient DeleteObjectQuery deleteQuery;
70
    protected DoesExistQuery doesExistQuery;
72
    protected DoesExistQuery doesExistQuery;
71
    protected ClassDescriptor descriptor;
73
    protected ClassDescriptor descriptor;
74
    protected boolean includeTenantCriteria;
72
    protected boolean hasCustomMultipleTableJoinExpression;
75
    protected boolean hasCustomMultipleTableJoinExpression;
73
    protected transient String additionalCriteria;
76
    protected transient String additionalCriteria;
74
    protected transient Expression additionalJoinExpression;
77
    protected transient Expression additionalJoinExpression;
Lines 102-107 Link Here
102
     * Initialize the state of the descriptor query manager
105
     * Initialize the state of the descriptor query manager
103
     */
106
     */
104
    public DescriptorQueryManager() {
107
    public DescriptorQueryManager() {
108
        this.includeTenantCriteria = true;
105
        this.queries = new LinkedHashMap(5);
109
        this.queries = new LinkedHashMap(5);
106
        this.cachedUpdateCalls = new ConcurrentFixedCache(10);
110
        this.cachedUpdateCalls = new ConcurrentFixedCache(10);
107
        this.cachedExpressionQueries = new ConcurrentFixedCache(20);
111
        this.cachedExpressionQueries = new ConcurrentFixedCache(20);
Lines 816-821 Link Here
816
820
817
    /**
821
    /**
818
     * INTERNAL:
822
     * INTERNAL:
823
     */
824
    public boolean includeTenantCriteria() {
825
        return includeTenantCriteria;
826
    }
827
    
828
    /**
829
     * INTERNAL:
819
     * Post initialize the mappings
830
     * Post initialize the mappings
820
     */
831
     */
821
    public void initialize(AbstractSession session) {
832
    public void initialize(AbstractSession session) {
Lines 942-948 Link Here
942
                additionalJoinExpression = databaseQuery.getSelectionCriteria().and(additionalJoinExpression);
953
                additionalJoinExpression = databaseQuery.getSelectionCriteria().and(additionalJoinExpression);
943
            } 
954
            } 
944
            
955
            
945
            if (descriptor.hasTenantDiscriminatorFields()) {
956
            if (descriptor.hasTenantDiscriminatorFields() && includeTenantCriteria) {
946
                ExpressionBuilder builder = new ExpressionBuilder();
957
                ExpressionBuilder builder = new ExpressionBuilder();
947
                
958
                
948
                for (DatabaseField discriminatorField : descriptor.getTenantDiscriminatorFields().keySet()) {
959
                for (DatabaseField discriminatorField : descriptor.getTenantDiscriminatorFields().keySet()) {
Lines 1352-1357 Link Here
1352
1363
1353
    /**
1364
    /**
1354
     * ADVANCED:
1365
     * ADVANCED:
1366
     * Set this boolean to exlude tenant column criteria in the additional
1367
     * join expression. This is of particualar use when using Oracle VPD
1368
     * that handles tenant identifiers. Setting this flag to false will ensure
1369
     * EclipseLink does not futher filter tenant information (and only populate 
1370
     * it)
1371
     */
1372
    public void setIncludeTenantCriteria(boolean includeTenantCriteria) {
1373
        this.includeTenantCriteria = includeTenantCriteria;
1374
    }
1375
    
1376
    /**
1377
     * ADVANCED:
1355
     * Set the receiver's insert call.
1378
     * Set the receiver's insert call.
1356
     * This allows the user to override the insert operation.
1379
     * This allows the user to override the insert operation.
1357
     */
1380
     */
(-)trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/descriptors/InheritancePolicy.java (+5 lines)
Lines 11-16 Link Here
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *     04/01/2011-2.3 Guy Pelletier 
12
 *     04/01/2011-2.3 Guy Pelletier 
13
 *       - 337323: Multi-tenant with shared schema support (part 2)
13
 *       - 337323: Multi-tenant with shared schema support (part 2)
14
 *     08/18/2011-2.3.1 Guy Pelletier 
15
 *       - 355093: Add new 'includeCriteria' flag to Multitenant metadata
14
 ******************************************************************************/  
16
 ******************************************************************************/  
15
package org.eclipse.persistence.descriptors;
17
package org.eclipse.persistence.descriptors;
16
18
Lines 1151-1156 Link Here
1151
                getDescriptor().addTenantDiscriminatorField(property, discriminatorField);
1153
                getDescriptor().addTenantDiscriminatorField(property, discriminatorField);
1152
            }
1154
            }
1153
            
1155
            
1156
            // Copy down the include criteria flag.
1157
            getDescriptor().getQueryManager().setIncludeTenantCriteria(getParentDescriptor().getQueryManager().includeTenantCriteria());
1158
            
1154
            setClassIndicatorMapping(getParentDescriptor().getInheritancePolicy().getClassIndicatorMapping());
1159
            setClassIndicatorMapping(getParentDescriptor().getInheritancePolicy().getClassIndicatorMapping());
1155
            setShouldUseClassNameAsIndicator(getParentDescriptor().getInheritancePolicy().shouldUseClassNameAsIndicator());
1160
            setShouldUseClassNameAsIndicator(getParentDescriptor().getInheritancePolicy().shouldUseClassNameAsIndicator());
1156
1161

Return to bug 355093