Created
October 25, 2015 20:07
-
-
Save gregori/6bd5b1c80a23ae297f37 to your computer and use it in GitHub Desktop.
Passo 2a
This file contains 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
/** | |
* Essa classe insere dois nomes, ao iniciar a aplicação, para fins de teste | |
* @author rodrigo | |
*/ | |
@Configuration | |
@EnableJpaRepositories | |
public class PersistenceConfiguration { | |
// Código para inserir duas pessoas no banco de dados | |
} |
This file contains 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
@Entity | |
@Data | |
public class Pessoa { | |
@Id | |
@GeneratedValue | |
private Long id; | |
private String nome; | |
} |
This file contains 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
public interface PessoaRepository extends JpaRepository<Pessoa, Long> { | |
List<Pessoa> findByNomeLike(String nome); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment