i have the persistent class as follow:
public class MCategory implements java.io.Serializable, TableData {
Code:
// Fields
private String category;
private String description;
// Constructors
/** default constructor */
public MCategory() {
}
/** minimal constructor */
public MCategory(String category) {
this.category = category;
}
/** full constructor */
public MCategory(String category, String description) {
this.category = category;
this.description = description;
}
// Property accessors
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
}
the mapping file is as below:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Apr 20, 2006 9:01:24 AM by Hibernate Tools 3.1.0 beta3 -->
<hibernate-mapping>
<class name="my.com.shinyang.ilms.model.MCategory" table="m_category">
<id name="category" type="string">
<column name="CATEGORY" length="20" />
<generator class="assigned" />
</id>
<property name="description" type="string">
<column name="DESCRIPTION" length="100" />
</property>
</class>
</hibernate-mapping>
and i try to add the category by using the session bean as below:
Code:
ses = ThreadLocalSession.currentSession();
ses.save(category);
ses.flush();
return category;
but when i try to save the object, it returns the wrror: "MCategory is not mapped' in server.
any good suggestion???