- This topic has 2 replies, 2 voices, and was last updated 18 years, 3 months ago by Jim Icenhower.
-
AuthorPosts
-
Jim IcenhowerMemberI have a MyEclipse web project that has Hibernate, Spring and Struts capabilities. I ran the Generate Hibernate Mapping function from the DB explorer. The files seemed to be generated and the project compiles without error. When I start Tomcat I get the following error:
Could not find a getter for statusNo in class net.icenhower.dao.Answer
Here’s the Answer.hbm.cml file:
<!-- Mapping file autogenerated by MyEclipse - Hibernate Tools --> <hibernate-mapping> <class name="net.icenhower.dao.Answer" table="answer" catalog="datapool"> <id name="answerNo" type="integer"> <column name="AnswerNo" /> <generator class="assigned" /> </id> <property name="questionNo" type="integer"> <column name="QuestionNo" not-null="true" /> </property> <property name="dispOrder" type="integer"> <column name="DispOrder" not-null="true" /> </property> <property name="otherRsp" type="string"> <column name="OtherRsp" length="1" not-null="true" /> </property> <property name="statusNo" type="integer"> <column name="StatusNo" not-null="true" /> </property> <property name="ansLen" type="integer"> <column name="AnsLen" not-null="true" /> </property> <property name="lastUser" type="integer"> <column name="LastUser" not-null="true" /> </property> <property name="lastUpdate" type="timestamp"> <column name="LastUpdate" length="19" /> </property> <set name="responses" inverse="true"> <key> <column name="AnswerNo" not-null="true" /> </key> <one-to-many class="net.icenhower.dao.Response" /> </set> </class> </hibernate-mapping>
I do have a Status table in the database but the Answer table does not have a foreign key to it. What do I need to change?
Thanks!
Jim
Haris PecoMemberJim,
This error
Could not find a getter for statusNo in class net.icenhower.dao.Answer
mean that you haven’t getStatusNo method in POJO Answer.java
If you want that MyEclipse generate collection you have to add foreig keys for table or you can change mapping after generating.
Best regards
Jim IcenhowerMemberThanks for the prompt and precise answer! Still loving MyEclipse!
Jim -
AuthorPosts