modify Repository class, and add macro to create entity class
add unit test of repository