All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blazebit.persistence.view.CorrelationProvider Maven / Gradle / Ivy

There is a newer version: 1.6.14
Show newest version
/*
 * Copyright 2014 - 2019 Blazebit.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.blazebit.persistence.view;

/**
 * Provides correlation functionality for entity views.
 * Beware that correlation providers may only be used once for an entity view hierarchy.
 * Also note that aliases defined in the query builder will contribute to the main query
 * when using {@link FetchStrategy#JOIN}, so be careful and choose rather unique names.
 *
 * @author Christian Beikov
 * @since 1.2.0
 */
public interface CorrelationProvider {

    /**
     * Applies a correlation to a query builder.
     * Depending on the correlation strategy, the correlationExpression may be one of the following:
     * 
    *
  • {@link FetchStrategy#SELECT} - A named parameter
  • *
  • {@link FetchStrategy#SUBSELECT} - A named collection parameter
  • *
  • {@link FetchStrategy#JOIN} - The correlation expression
  • *
* * To be able to make use of all strategies it is best if you use the IN predicate in conjunction with the correlationExpression. * * @param correlationBuilder The correlation builder to create the correlation * @param correlationExpression The correlation expression from the outer query on which to correlate */ public void applyCorrelation(CorrelationBuilder correlationBuilder, String correlationExpression); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy