Skip to content

Mybatis update query시 파라미터 오류 #2

Description

@pinest94

mybatis update시 파라미터 오류

MyBatis Mapper interface에서 파라미터가 여러개인 경우

void updateProduct(Product product, Long id);
--> void updateProduct(@Param("product") Product product, @Param("id")Long id);
@Param 어노테이션을 사용해야한다.

Mapper.xml에서는 name = #{product.name}와 같이 @Param안에 "product"를 사용하여 value값을 추출한다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions