Created
April 27, 2017 20:47
-
-
Save sidneydemoraes/a52efcd4d114bb04ea4d4ae1a4bb4752 to your computer and use it in GitHub Desktop.
TechTalk - Gradle + Spring Boot + Groovy - Repository com Simple Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import br.com.smc.meurumo.domain.comercio.entity.Cnae | |
import org.springframework.data.repository.Repository | |
/** | |
* Repositório de {@link Cnae}. | |
*/ | |
interface CnaeRepository extends Repository<Cnae, Integer> { | |
/** | |
* Busca um {@link Cnae} baseado em ID. | |
* | |
* @param id | |
* @return | |
*/ | |
Cnae findById(int id); | |
/** | |
* Busca as primeiras 3 ocorrências de {@link Cnae#descricao} baseado em uma {@code Substring}. | |
* | |
* @param descricaoParcial | |
* @return | |
*/ | |
List<Cnae> findFirst3ByDescricaoContainsIgnoreCase(String descricaoParcial); | |
/** | |
* Busca todos os {@link Cnae} pertencentes a um {@link br.com.smc.meurumo.domain.comercio.entity.GrupoCnae}. | |
* | |
* @param idGrupoCnae | |
* @return | |
*/ | |
List<Cnae> findBySubgrupoGrupoCnaeId(int idGrupoCnae); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment