본문 바로가기

개발~30

[IntelliJ] MyBatis binding 에러 이번에 여러 사람들과 mybatis로 빠르게 빠르게 변환하는 작업을 진행했습니다. 인터페이스 Mapper를 이용해서 연결하는데, 저 같은 경우는 Mapper 메서드 매개변수에 @Param을 넣지 않으면 아래와 같은 에러가 발생했습니다. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'barcode' not found. Available parameters are [arg1, arg0, param1, param2] 그런데 몇몇 분들은 @Param이 없어도 잘 동작하더라구요! 왜 그런지 이유를 찾아보니, intelliJ build 설정이 달라서 생.. 2021. 5. 24.
[Spring] 하위 메뉴 구현하기 1. 목표 상위 메뉴, 하위 메뉴 까지만 존재하는 메뉴를 만들려고 합니다. 메뉴의 순서를 정할 수 있고, 하위 메뉴는 같은 상위 메뉴 아래에서만 순서를 변경할 수 있습니다. 또한 항상 전체 메뉴 목록을 보여줘야하기 때문에 페이징은 하지 않습니다. 2. 개발 환경 Spring boot, JPA, h2 database, querydsl 를 이용해서 개발합니다. 3. 데이터베이스 구조 create table menu ( id bigint generated by default as identity, parent_id bigint, name varchar(255), list_order int, primary key(id), foreign key (parent_id) references menu(id) ) id는 .. 2021. 2. 9.
[mysql] 이름 가운데 글자 * 로 치환하기 select replace(name, substr(name, 2, 1), '*') name from user ; 2020. 12. 2.
[JPA] Method 기반 Query 생성 docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation Spring Data JPA - Reference Documentation Example 109. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false").. 2020. 12. 1.