开发者

java hibernate - unneeded saving of a method return value because it starts with get..()

开发者 https://www.devze.com 2023-02-28 23:31 出处:网络
I have created a String getDisplayString(); method in a class which is a hibernate entity. When I r开发者_运维技巧un the code there is an exception that tells me that I have to have a

I have created a

String getDisplayString();

method in a class which is a hibernate entity. When I r开发者_运维技巧un the code there is an exception that tells me that I have to have a

setDisplayString()

Though there is no Member called DisplayString. No, to solve it quickly I havve created a set method that does nothing. it runs - but it saves a culmumn named DisplayString with the result of the getDisplayString() method (though not a member).

How do I make a getDisplayString() method and let Hibernate not use it?


If class is mapped with annotations, you need to mark your get method as @Transient.

0

精彩评论

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