@Transient excludes a field or property from persistence while leaving it available at runtime. In JPA, place it on the field or getter according to the entity’s access strategy; field access is used when @Id is placed on fields. section 6.1.1 section 14.2
Computed entity property
An Item can persist initialPrice while calculating totalPriceIncludingTax at runtime. Marking totalPriceIncludingTax with @javax.persistence.Transient prevents a redundant database column. The Java transient keyword is an alternative when the field should also be excluded from Java serialization. section 6.1.1
Choose non-persistence for values that:
- Are derived from other persistent properties and can be recalculated. section 6.1.1
- Are sensitive, such as a clear-text password, and should not be stored for later disclosure. section 6.1.1 section 17.2
- Have meaning only in a local environment, such as a local IP address. section 6.1.1
The same annotation name also appears in Spring Data MongoDB. There, @Transient marks a field that will not be persisted or examined by the persistence framework; a User password field uses it for this purpose. section 17.2

