- please forked this repo for practice
- use
MyBatis-Spring-Boot-Starter-Test
to implementRepository
testing for follow test cases - finish the testing and implementation of test cases
We are building a employee management application, this application has Employee
entity with fields id
,name
,age
,company_id
and Company
entity with fields id
,name
,address
. One Company
can have many Employee
Employee
should be fetched bycompany_id
, the result of method should be a entity not a list and the id and other fields should be consist with input.Company
should be fetched byid
and include it ownedEmployee
list ifemployee
table have related records.Employee
can be saved andid
generated by database should be returned properly- add
createdTime
field forEmployee
and let database generate the timestamp,createdTime
should be auto filled properly when a new object be inserted. Employee
list should be fetched by giving a keyword forname
searchingEmployee
list should be save in batch properly
- submit your git repo url to field
answer
- create
Entity
to present your data structure - create
Repository
for MyBatis integration - create
Mapper
under resources package - write sql statements
- use
Repository
for your business to access to database - write
Repository
testing
schema.sql
will be loaded and init database when application is starting- navigate to web console
http://localhost:8080/h2-console
- put
jdbc:h2:mem:tws_persistence_db
inJDBC URL
field
- controller layer is not required