Search code examples
javahibernateannotationspojo

Java, Hibernate annotations, How to add methods to POJO object?


I am using hibernate annotations. How to add methods to POJO object? For example i have "getChildNodes" method, associated with database, but i want also add recursive method "getAllChildNodes". I get "org.hibernate.PropertyNotFoundException: Could not find a setter for property progress in class" exception when i do it.


Solution

  • If I interpret this as "how do I add a method that is NOT related to persistence" then you need to use the @Transient annotation on the getAllChildNodes() method