Can I fetch existing data for JPA field that newly marked as @Transient?

435 views Asked by At

I have a JPA column that Im GOING to mark as @Transient. But I do have some data in that field that I want to move later.

I know that @Transient won't persist. But, can I still load those existing data to the memory to the Java world?

1

There are 1 answers

4
Simon Martinelli On BEST ANSWER

No @Transientprevents JPA/Hibernate from any data access operation.

But if you have a field that you only want to read you can mark it read-only:

@Column(insertable = false, updatable = false)
private String transientField;