我可以映射一个字段瞬态。结果映射狗为null,怎么实现映射。
@Entity
@SqlResultSetMapping(name = "DogMapping",
entities = {
@EntityResult(entityClass = Dog.class, fields = {
@FieldResult(name = "Id", column = "ID"),
@FieldResult(name = "name", column = "NAME"),
})
}))
public class Dog implements Serializable {
@Id
private Long id;
@Transient
private String name;
}