com.github.iintelligas.repo.UserRepository Maven / Gradle / Ivy
The newest version!
package com.github.iintelligas.repo;
import com.github.iintelligas.persist.entity.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface UserRepository extends JpaRepository {
UserEntity findByUsername(String username);
UserEntity findByEmail(String email);
@Query("select ue from UserEntity ue where ue.username like CONCAT('%',:name,'%')")
List findByMatchingName(@Param("name") String name);
}