0

I've tried all the answer I've found on stackoverflow and other websites. It's pretty common but looks like each case has its solution. I generated the mapping files using JBoss Hibernate tool on eclipse, so I'm surprised it has mapping error. Hibernate can't find the getter for idparameters (I changed the database column to all lowercase to make sure it's not some case problem, but no avail) Anybody can point out the problem?

Parameter class generated by Hibernate Parameters.java

The xml mapping generated by Hibernate Parameters.hbm.xml

And the error itself

2
  • Did you use the Parameters class to generate the hibernate mapping file? Commented May 20, 2015 at 16:21
  • Sorry I didn't precise, both Parameters.java and Parameters.hbm.xml were generated automatically. On eclipse I just run run > Hibernate Code generation .. Commented May 20, 2015 at 16:25

2 Answers 2

1

You should follow the Java Bean naming conventions when using Hibernate. This is what you can do :

  1. In the generated Parameters class, change idparameters to idParameters.
  2. Change the getter and setter to getIdParameters and setIdParameters(Integer idParameters).
  3. Regenerate the hibernate mapping file.

Make sure that all your getters and setters follow the Java Bean naming conventions. Example : - getGrayscale

Sign up to request clarification or add additional context in comments.

2 Comments

I fixed it, regenerated hibernate mapping file, but the problem persists
@mhfff32 I am sure it's for some other field and not the idParametersField. You need to make sure all your getters and setters follow the Java Bean naming convention.
0

Ensure that you do a clean java build. You are probably having an old class around that does not have this parameter in it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.