0

So I understand that the @Transient from javax.persistence.Transient marks that a property or field is not persistent. But how does this property or field know what data it should be populated with.

M A
  • 71,713
  • 13
  • 134
  • 174
stef52
  • 1,089
  • 2
  • 15
  • 23

2 Answers2

1

@Transient means the field is not persisted, which also means it will not be fetched from the database. Its value is set by user code (e.g. a setter method).

M A
  • 71,713
  • 13
  • 134
  • 174
0

It doesn't. The field has its default value (null, for an object type) until some code initializes to something else.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255