ResultMapping in fields transient

时间:2012-12-11 17:08:23

标签: java-ee jpa

我可以映射场瞬态。 映射狗的结果为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;

}

1 个答案:

答案 0 :(得分:-1)

如果你想阅读它,请不要使它@Transient