本文介紹了為什么 JPA 有 @Transient 注解?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
Java 有 transient
關鍵字.為什么 JPA 有 @Transient
而不是簡單地使用已經(jīng)存在的 java 關鍵字?
Java has the transient
keyword. Why does JPA have @Transient
instead of simply using the already existing java keyword?
推薦答案
Java的transient
關鍵字用來表示一個字段不被序列化,而JPA的@Transient
注解用于表示一個字段不被持久化到數(shù)據(jù)庫中,即它們的語義不同.
Java's transient
keyword is used to denote that a field is not to be serialized, whereas JPA's @Transient
annotation is used to indicate that a field is not to be persisted in the database, i.e. their semantics are different.
這篇關于為什么 JPA 有 @Transient 注解?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!