Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

hibernate for JDBC

 
rakesh Bob
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends please help me out of this problem , When am usiing hibernate in eclipse for JDBC programs am gettin an error like " this method for example setPid() is undefined for the type Products".What should i do???
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have getter/setter methods for the properties that you have mapped in the hbm files. In this case, i guess you have mapped a property named pid and there is no setPid method in the Products class. Introduce that method in the class
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check your .hbm (mapping file) for Products table whether pid is defined. If it is defined, then check your bean class for setPid() method as latter poster said. you need to have both to fix it.

Still have a problem, post .hbm file and bean class.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!