236장. MyBatis Component

Camel 버전 2.7에서 사용 가능

mybatis: 구성 요소를 사용하면 MyBatis 를 사용하여 관계형 데이터베이스에서 데이터를 쿼리, 폴링, 삽입, 업데이트 및 삭제할 수 있습니다.

Maven 사용자는 이 구성 요소를 위해 다음 종속성을 pom.xml 에 추가해야 합니다.

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-mybatis</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

236.1. URI 형식

mybatis:statementName[?options]

여기서 statementName 은 평가하려는 쿼리, 삽입, 업데이트 또는 삭제 작업에 매핑되는 MyBatis XML 매핑 파일의 문 이름입니다.

다음 형식 ?option=value&option=value&…​로 URI에 쿼리 옵션을 추가할 수 있습니다.

이 구성 요소는 기본적으로 예상 이름이 SqlMapConfig.xml 인 classpath의 루트에서 MyBatis SqlMapConfig 파일을 로드합니다.
파일이 다른 위치에 있는 경우 MyBatisComponent 구성 요소에서 configurationUri 옵션을 구성해야 합니다.If the file is located in another location, you will need to configure the configurationUri option on the MyBatisComponent component.