Article Repository
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
public interface ArticleRepository {
|
||||
List<Article> findAllArticle();
|
||||
Article findArticleById(int id);
|
||||
List<Article> findArticleByTitle(String title);
|
||||
void saveArticle(Article article);
|
||||
void deleteArticle(int id);
|
||||
void updateArticle(int id);
|
||||
|
||||
@@ -56,6 +56,13 @@ public class ArticleRepositoryImpl implements ArticleRepository {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Article> findArticleByTitle(String title) {
|
||||
String sql = "SELECT * FROM ARTICLES_VENDUS WHERE nom_article LIKE '?'";
|
||||
List<Article> articles = jdbcTemplate.query(sql, new ArticleRowMapper(), title);
|
||||
return articles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveArticle(Article article) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user