org.eclipse.persistence.queries.BatchFetchPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eclipselink Show documentation
Show all versions of eclipselink Show documentation
EclipseLink build based upon Git transaction f2b9fc5
/*
* Copyright (c) 2011, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// James Sutherland - initial API and implementation
package org.eclipse.persistence.queries;
import org.eclipse.persistence.annotations.BatchFetchType;
import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.expressions.Expression;
import org.eclipse.persistence.internal.expressions.QueryKeyExpression;
import org.eclipse.persistence.internal.sessions.AbstractRecord;
import org.eclipse.persistence.mappings.DatabaseMapping;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* BatchFetchPolicy defines batch reading configuration.
*
* @see org.eclipse.persistence.queries.ObjectLevelReadQuery#setBatchFetchPolicy(BatchFetchPolicy)
* @author James Sutherland
*/
public class BatchFetchPolicy implements Serializable, Cloneable {
/** Define the type of batch fetching to use. */
protected BatchFetchType type;
/** Define the batch size for IN style batch fetching. */
protected int size = 500;
/** Define the attributes to be batch fetched. */
protected List attributeExpressions;
/** Define the mapping to be batch fetched (from mapping settings). */
protected List batchedMappings;
/** PERF: Used internally to store the prepared mapping queries. */
protected transient Map mappingQueries;
/** PERF: Cache the local batch read attribute names. */
protected List attributes;
/** Stores temporary list of rows from parent batch query per batched mapping. */
protected transient Map