java hibernate - unneeded saving of a method return value because it starts with get..()
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
.
精彩评论