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

org.springframework.data.jpa.repository.GenericJpaRepository Maven / Gradle / Ivy

package org.springframework.data.jpa.repository;

import java.io.Serializable;
import java.util.List;

import javax.persistence.EntityNotFoundException;
import javax.persistence.Query;

import org.springframework.core.convert.converter.Converter;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Persistable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.support.DataTablesInput;
import org.springframework.data.jpa.support.DataTablesOutput;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.history.RevisionRepository;

import com.querydsl.core.Join;
import com.querydsl.core.dml.DMLClause;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.JPQLQuery;

/**
 * 
 * @QueryHints(@QueryHint(name = "org.hibernate.cacheable", value = "true"))
 * 
 * SELECT u FROM User u LEFT JOIN FETCH u.employee AS e WHERE UPPER(u.username) = UPPER(:username) AND (e.leave IS FALSE OR e IS NULL)
 * SELECT u FROM User u INNER JOIN FETCH u.employee AS e WHERE UPPER(u.username) = UPPER(:username) AND UPPER(u.name) = UPPER(:name) AND UPPER(e.id) = UPPER(:employeeId) AND (e.leave IS FALSE OR e IS NULL)
 * 
* * @see org.springframework.transaction.annotation.Transactional#readOnly() * @see org.springframework.transaction.annotation.Transactional#timeout() * @see org.springframework.data.repository.util.TxUtils#DEFAULT_TRANSACTION_MANAGER * @see org.springframework.transaction.annotation.Isolation#READ_UNCOMMITTED * @see org.hibernate.Hibernate#initialize(Object) * @see org.springframework.data.querydsl.binding.QuerydslBinderCustomizer * @see org.springframework.dao.IncorrectResultSizeDataAccessException */ @NoRepositoryBean public interface GenericJpaRepository, ID extends Serializable> extends RevisionRepository, JpaRepository, QueryDslPredicateExecutor, JpaSpecificationExecutor { T findOne(Predicate predicate, Join... joins); @Override T findOne(ID id) throws EntityNotFoundException; T findOne(JPQLQuery query); RT findOne(Expression expression, JPQLQuery query); RT findOne(Expression expression, Predicate predicate, Join... joins); boolean exists(Predicate predicate, Join... joins); long count(Predicate predicate, Join... joins); long execute(DMLClause clause); int executeUpdate(Query query); List getResultList(Query query); Object getSingleResult(Query query); List findAll(Predicate predicate, Sort sort, Join... joins); Page findAll(Predicate predicate, Pageable pageable, Join... joins); List findAll(Sort sort, JPQLQuery query); Page findAll(Pageable pageable, JPQLQuery query); List findAll(Expression expression, Predicate predicate, Sort sort, Join... joins); Page findAll(Expression expression, Predicate predicate, Pageable pageable, Join... joins); List findAll(Expression expression, Sort sort, JPQLQuery query); Page findAll(Expression expression, Pageable pageable, JPQLQuery query); DataTablesOutput findAll(DataTablesInput input, Specification specifications); DataTablesOutput findAll(DataTablesInput input, Converter converter, Specification specification); DataTablesOutput findAll(DataTablesInput input, Predicate predicate, Join... joins); DataTablesOutput findAll(DataTablesInput input, Converter converter, Predicate predicate, Join... joins); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy