I have a collection of DALS such as Transaction DAO, Billing DAO etc. Each of them have CRUD operations and I need to use that methods in my project using spring autowiring. In some of the projects that I have checked out, I saw that they are fetching the data inmemory by querying. However, I have to use the DAL's that have already been written and have all the CRUD operations.
For example:
@Autowired
TransactionDAO transactionDAO
@Autowired
BillingDAO billingDAO
@Test
public void testImplementSearchMethodForDAO() throws Exception{
TransactionVO transactionVO = getTransVO();
BillingVO billingVO = getBillingVO();
List<TransactionVO> VOList1 = transactionDAO.searchList(transactionVO);
List<BillingVO> VOList2 = billingDAO.searchList(billingVO);
assertThat(VOList1.size()).isEqualto(1));
assertThat(VOList1.size()).isEqualto(1));
}
(Assuming I added one VO value in each table).
If you need any more clarifications, I will be glad to provide you.
Aucun commentaire:
Enregistrer un commentaire