Java Programming

Spring Boot Utils

Query String

@RequestParam String q

Id

@PathVariable int id

Article Relation

@Query(value = "SELECT * FROM Article WHERE CategoryId = :categoryId AND ArticleId <> :id", nativeQuery = true)
List<Article> relation(int id, short categoryId);

Search

@Query(value = "SELECT * FROM Article WHERE Title LIKE %:q%", nativeQuery = true)
    List<Article> search(String q);