OMapper 提供了一个简单的库用来简化对象/Bean 与其他设计层面的映射,使用 Java 的注解。
示例代码:
/** * The Class Bean2. */ @Mappable public class Bean2 { /** The name. */ @Source(type = org.omapper.test.Bean1.class, property = "name") private String name; /** The address. */ @Source(type = Bean1.class, property = "address") private String address; /** The age. */ @Source(type = Bean1.class, property = "age") private int age; /** The emp_id. */ @Source(type = Bean1.class, property = "emp_id") private Integer emp_id; }