2016-11-09 72 views

回答

0

您需要爲您的字段(實體內部)使用@Transient註釋,這些註釋需要作爲持久性的一部分被忽略。

此註解指定屬性或字段不是 持久性。

@Entity 
public class Employee { 
    @Id 
    int id; 

    @Transient 
    String ignoreMe; 
} 

你可以看看here

+0

我需要忽略的屬性,只有屬性等於一定值。不總是。 – Alexiuscrow