Exception in thread "main" java.lang.ExceptionInInitializerError: SessionFactory creation failed: Could not find a getter for reporttopicdetail in class com.foursight.jobscheduler.checkplan.data.entity.Topic
Actually I used hibernate tool generated pojo and mapping file, I just can not figure out what wrong with it, any help will be appreciated?
Thanks
Code:
// Generated May 24, 2006 12:01:32 PM by Hibernate Tools 3.1.0.beta4
import java.util.HashSet;
import java.util.Set;
/**
* Topic generated by hbm2java
*/
public class Topic implements java.io.Serializable {
// Fields
private long topicid;
private Reporttopicdetail reporttopicdetail;
private String topictype;
private Set jobsubscribtions = new HashSet(0);
// Constructors
/** default constructor */
public Topic() {
}
/** minimal constructor */
public Topic(long topicid) {
this.topicid = topicid;
}
/** full constructor */
public Topic(long topicid, Reporttopicdetail reporttopicdetail, String topictype, Set jobsubscribtions) {
this.topicid = topicid;
this.reporttopicdetail = reporttopicdetail;
this.topictype = topictype;
this.jobsubscribtions = jobsubscribtions;
}
// Property accessors
public long getTopicid() {
return this.topicid;
}
public void setTopicid(long topicid) {
this.topicid = topicid;
}
public Reporttopicdetail getReporttopicdetail() {
return this.reporttopicdetail;
}
public void setReporttopicdetail(Reporttopicdetail reporttopicdetail) {
this.reporttopicdetail = reporttopicdetail;
}
public String getTopictype() {
return this.topictype;
}
public void setTopictype(String topictype) {
this.topictype = topictype;
}
public Set getJobsubscribtions() {
return this.jobsubscribtions;
}
public void setJobsubscribtions(Set jobsubscribtions) {
this.jobsubscribtions = jobsubscribtions;
}
}
And here is the mapping file
Code:
<hibernate-mapping>
<class name="Topic" table="topic">
<id name="topicid" type="long">
<column name="topicid" />
<generator class="assigned" />
</id>
<many-to-one name="reporttopicdetail" class="Reporttopicdetail" fetch="select">
<column name="topicdetail" />
</many-to-one>
<property name="topictype" type="string">
<column name="topictype" length="10" />
</property>
<set name="jobsubscribtions" inverse="true">
<key>
<column name="topic" not-null="true" />
</key>
<one-to-many class="Jobsubscribtion" />
</set>
</class>
</hibernate-mapping>