237.5. 샘플
예를 들어 JMS 대기열의 빈을 사용하여 데이터베이스에 삽입하려는 경우 다음을 수행할 수 있습니다.
from("activemq:queue:newAccount")
.to("mybatis-bean:AccountService:insertBeanAccount");
from("activemq:queue:newAccount")
.to("mybatis-bean:AccountService:insertBeanAccount");
Camel에 호출할 작업 유형을 지시해야 하므로 8080 이름과 메서드 이름을 지정해야 합니다.
여기서 AccountService 는 MyBatis 8080 주석이 있는 8080의 유형 별칭입니다. KeycloakMapConfig 파일에서 유형 별칭을 구성할 수 있습니다.
<typeAliases>
<typeAlias alias="Account" type="org.apache.camel.component.mybatis.Account"/>
<typeAlias alias="AccountService" type="org.apache.camel.component.mybatis.bean.AccountService"/>
</typeAliases>
<typeAliases>
<typeAlias alias="Account" type="org.apache.camel.component.mybatis.Account"/>
<typeAlias alias="AccountService" type="org.apache.camel.component.mybatis.bean.AccountService"/>
</typeAliases>
On the `AccountService` bean you can declare the MyBatis mappins using annotations as shown:
On the `AccountService` bean you can declare the MyBatis mappins using annotations as shown: