I have two POJOs.
class ZebraDAO {
Long id;
Mane mane;
Tail tail;
Stripes stripes;
}
class ZebraDTO {
Mane mane;
Tail tail;
Stripes stripes;
String description;
}
Does Spring framework have automagic feature/annotation/naming-convention in creating a new ZebraDTO from an instance of ZebraDAO, based on similarity of names or properties between the two POJOs? i.e., without my having to write any code transferring properties from one to the other.
How about using the good-old Apache Commons BeanUtils.copyProperties()? Spring also has his own flavor of an static BeanUtils.copyProperties() method.