Is Google not installed on your machine? Try searching for "Java DAO".
But since it's clear that you need some spoon feeding, here's a simple one:
public class Person implements Serializable
{
private Long id;
private String firstName;
private String lastName;
// ctors, getters, setters, equals, hashCode, other methods go here.
}
public interface PersonDao
{
Person find(Long id);
List<Person> findAll();
List<Person> findByLastName(String lastName);
void save(Person p);
void update(Person p);
void delete(Person p);
}
public class CompanyDto implements Serializable
{
private List<Person> employees;
// ctors, getters, setters, equals, hashCode, other methods go here.
}
That's the idea.
%