1. 程式人生 > >Hibernate的一個註釋 @Transient

Hibernate的一個註釋 @Transient

   示例:
    //根據birth計算出age屬性
    @Transient
    public int getAge() {
    return getYear(new Date()) - getYear(birth);
    }

這個東東還是挺有用的。