mardi 1 décembre 2015

Query data on spring boot with CrudRepository

I am working with Spring boot project .. I found a problem :(

I used :

public interface Comment1ServiceRepository extends CrudRepository<Comment1, Integer> {
        @Query(value = "SELECT comment1.comment_id,comment1.contribution_id,comment1.user_id,comment1.comment,comment1.photo_id,comment1.stamp_id,comment1.like_count,comment1.update_date,comment1.create_date,comment1.delete_flg,comment1.stamp_place FROM comment1 INNER JOIN contribution1 ON comment1.contribution_id = contribution1.contribution_id WHERE contribution1.location = ?1 LIMIT ?2, ?3", nativeQuery = true)
        List<Comment1> findByPlace( String location, Integer offset, Integer limit);
        @Query(value = "SELECT * FROM comment1  WHERE comment LIKE %:name%", nativeQuery = true)
        List<Comment1> findByName(@Param("name") String name);
}

I put param for location is "村上" not other string of UTF-8
and then I query it can not return data (0 row) though it exists on database

Further I query with string UTF-8 (Example : "America") it is normal working.

I don't know why sping boot not working. please help me !!! Thanks you very much




Aucun commentaire:

Enregistrer un commentaire