Copy to ClipboardCopied!Toggle word wrapToggle overflow
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:
Copy to ClipboardCopied!Toggle word wrapToggle overflow
public interface AccountService {
@Select("select ACC_ID as id, ACC_FIRST_NAME as firstName, ACC_LAST_NAME as lastName"
+ ", ACC_EMAIL as emailAddress from ACCOUNT where ACC_ID = #{id}")
Account selectBeanAccountById(@Param("id") int no);
@Select("select * from ACCOUNT order by ACC_ID")
@ResultMap("Account.AccountResult")
List<Account> selectBeanAllAccounts();
@Insert("insert into ACCOUNT (ACC_ID,ACC_FIRST_NAME,ACC_LAST_NAME,ACC_EMAIL)"
+ " values (#{id}, #{firstName}, #{lastName}, #{emailAddress})")
void insertBeanAccount(Account account);
}
public interface AccountService {
@Select("select ACC_ID as id, ACC_FIRST_NAME as firstName, ACC_LAST_NAME as lastName"
+ ", ACC_EMAIL as emailAddress from ACCOUNT where ACC_ID = #{id}")
Account selectBeanAccountById(@Param("id") int no);
@Select("select * from ACCOUNT order by ACC_ID")
@ResultMap("Account.AccountResult")
List<Account> selectBeanAllAccounts();
@Insert("insert into ACCOUNT (ACC_ID,ACC_FIRST_NAME,ACC_LAST_NAME,ACC_EMAIL)"
+ " values (#{id}, #{firstName}, #{lastName}, #{emailAddress})")
void insertBeanAccount(Account account);
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow