Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2020-2022 the original author or authors.
*
* 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
*
* https://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 org.springframework.data.relational.repository.query;
import java.util.Collection;
import java.util.Iterator;
import org.springframework.data.relational.core.query.Criteria;
import org.springframework.data.repository.query.Parameter;
import org.springframework.data.repository.query.Parameters;
import org.springframework.data.repository.query.parser.AbstractQueryCreator;
import org.springframework.data.repository.query.parser.Part;
import org.springframework.data.repository.query.parser.PartTree;
import org.springframework.data.util.Streamable;
import org.springframework.util.Assert;
/**
* Implementation of {@link AbstractQueryCreator} that creates a query from a {@link PartTree}.
*
* @author Roman Chigvintsev
* @author Mark Paluch
* @since 2.0
*/
public abstract class RelationalQueryCreator extends AbstractQueryCreator {
private final CriteriaFactory criteriaFactory;
/**
* Creates new instance of this class with the given {@link PartTree}, {@link RelationalEntityMetadata} and
* {@link ParameterMetadataProvider}.
*
* @param tree part tree, must not be {@literal null}.
* @param accessor parameter metadata provider, must not be {@literal null}.
*/
public RelationalQueryCreator(PartTree tree, RelationalParameterAccessor accessor) {
super(tree);
Assert.notNull(accessor, "RelationalParameterAccessor must not be null");
this.criteriaFactory = new CriteriaFactory(new ParameterMetadataProvider(accessor));
}
/**
* Creates {@link Criteria} for the given method name part.
*
* @param part method name part, must not be {@literal null}.
* @param iterator iterator over query parameter values
* @return new instance of {@link Criteria}
*/
@Override
protected Criteria create(Part part, Iterator