generated from matheusfy/readme-template-alura
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
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
11 changes: 8 additions & 3 deletions
11
src/main/java/io/github/matheusfy/screanmatch/ScreanMatchApplication.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
package io.github.matheusfy.screanmatch; | ||
|
||
import io.github.matheusfy.screanmatch.application.Principal; | ||
import io.github.matheusfy.screanmatch.model.repository.SerieRepository; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
|
||
@SpringBootApplication | ||
|
||
public class ScreanMatchApplication implements CommandLineRunner { | ||
|
||
@Autowired | ||
private SerieRepository serieRepository; | ||
public static void main(String[] args) { | ||
SpringApplication.run(ScreanMatchApplication.class, args); | ||
} | ||
|
||
@Override | ||
public void run(String... args) throws Exception { | ||
Principal menu = new Principal(); | ||
public void run(String... args) { | ||
Principal menu = new Principal(serieRepository); | ||
menu.exibeMenu(); | ||
} | ||
} |
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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/matheusfy/screanmatch/model/repository/SerieRepository.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.matheusfy.screanmatch.model.repository; | ||
|
||
import io.github.matheusfy.screanmatch.model.entity.Serie; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import javax.swing.text.html.Option; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface SerieRepository extends JpaRepository<Serie, Long> { | ||
|
||
// @Query(value = "SELECT * FROM series WHERE lower(titulo)=?",nativeQuery = true) | ||
Optional<Serie> findByTituloIgnoreCase(String titulo); | ||
|
||
} |
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