add method in dao for insert and generate key