开发者

Hibernate - How to disable mapping for a column

开发者 https://www.devze.com 2023-03-12 06:19 出处:网络
When tagged as @Entity, each attribute of a class is mapped to one database column. I have some classes where I want to add some fields for internal usage, but I don\'t开发者_开发百科 want them to be

When tagged as @Entity, each attribute of a class is mapped to one database column. I have some classes where I want to add some fields for internal usage, but I don't开发者_开发百科 want them to be mapped by hibernate to a database column. Is there a way to do so?

Thanks


Its either you mark the variables with @javax.persistence.Transient or declare it as transient.

@javax.persistence.Transient
String myTransietnColumn;



transient String myAnotherTransientColumn;
0

精彩评论

暂无评论...
验证码 换一张
取 消