2016-11-09 47 views

回答

0

您需要为您的字段(实体内部)使用@Transient注释,这些注释需要作为持久性的一部分被忽略。

此注解指定属性或字段不是 持久性。

@Entity 
public class Employee { 
    @Id 
    int id; 

    @Transient 
    String ignoreMe; 
} 

你可以看看here

+0

我需要忽略的属性,只有属性等于一定值。不总是。 – Alexiuscrow