CooperatorRepositoryCustomImpl.java

/*
 * Copyright 2026 Global Crop Diversity Trust
 * Licensed under the Apache License, Version 2.0
 * See LICENSE file in project root folder or http://www.apache.org/licenses/LICENSE-2.0
 */

package org.gringlobal.persistence;

import java.util.List;

import org.gringlobal.model.Cooperator;
import org.gringlobal.model.QCooperator;

import org.springframework.beans.factory.annotation.Autowired;

import com.querydsl.jpa.impl.JPAQueryFactory;

public class CooperatorRepositoryCustomImpl implements CooperatorRepositoryCustom {

	@Autowired
	private JPAQueryFactory jpaQueryFactory;

	@Override
	public List<Cooperator> findRedirects(final Cooperator cooperator) {
		return jpaQueryFactory.selectFrom(QCooperator.cooperator).where(QCooperator.cooperator.currentCooperator().eq(cooperator)).fetch();
	}

}