Add entity and dao test

Add test for entity and dao. And add getByName in Dao.