implement to generate dao automatically(add and update a record)