2

I added the following method to one of my application entity.

public boolean isSame(TaskUser taskUser){
        //some work
    }

However I came across few threads like this one regarding hibernate errors for such kind of methods used without @Transient. But my application is running fine and also there is no column created in my DB table for the entity, so as a learner I want to ask what actually happens that save my app from hibernate error. Is that argument passed the reason?

Community
  • 1
  • 1
SSH
  • 1,609
  • 2
  • 22
  • 42
  • 1
    http://stackoverflow.com/questions/12359346/how-to-make-hibernate-ignore-a-method ..... from here some questions arises to me – SSH Nov 28 '14 at 11:22

1 Answers1

4

This method does not define a property, so Hibernate is not interested in mapping a column for it.

The reason is that it is not a "getter". It does have the proper name ("isXXX" for a boolean), but it takes a parameter. Getters must be without parameters.

If it was a "real" getter, and you did not want it to result in a persistent property, you could use @Transient to suppress the automatic mapping.

Thilo
  • 257,207
  • 101
  • 511
  • 656