While inserting the data in section master i am facing the Exception as
13:20:25,906 ERROR [BasicPropertyAccessor] IllegalArgumentException in class: beans.master.CatalogueMaster, getter method of property: catalogueId
While fetching the data(which is manually inserted by insert query through DB) from section master i got this exception
15:19:51,187 INFO [STDOUT] Exception in getExistingSection() method of SectionMasterBean.java : org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection
_optimizer=false for more info) setter of beans.master.SectionMaster.setCatalogueId
can anybody help me in this ??????
mapping file contains
Code:
<class name="beans.master.SectionMaster" table="section_master">
<id name="sectionId" type="int" column="section_id" >
<generator class="sequence">
<param name="sequence">section_id_sequence</param>
</generator>
</id>
<property name="sectionName" type="string" not-null="true">
<column name="section_name" />
</property>
<many-to-one name="catalogueId"
class="beans.master.CatalogueMaster"
column="catalogue_id"
not-null="true"/>
<property name="status" type="string" not-null="true">
<column name="status" />
</property>
</class>
<class name="beans.master.CatalogueMaster" table="catalogue_master">
<id name="catalogueId" type="int" column="catalogue_id" >
<generator class="sequence">
<param name="sequence">catalogue_id_sequence</param>
</generator>
</id>
<property name="catalogueName" type="string" not-null="true">
<column name="catalogue_name" />
</property>
<property name="moderator" type="string">
<column name="moderator" />
</property>
<property name="status" type="string" not-null="true">
<column name="status" />
</property>
</class>
Table Structures
Table "section_master"
Column | Type | Modifiers
--------------+------------------------+-----------
section_id | integer | not null
section_name | character varying(255) |
catalogue_id | integer | not null
status | character varying(255) |
Primary key: section_master_pkey
Table "catalogue_master"
Column | Type | Modifiers
----------------+------------------------+-----------
catalogue_id | integer | not null
catalogue_name | character varying(255) |
moderator | character varying(255) |
status | character varying(255) |
Primary key: catalogue_master_pkey
Corresponding Pojo classes
Code:
public class CatalogueMaster {
/**
*
*/
public CatalogueMaster() {
}
private int catalogueId;
private String catalogueName;
private String moderator;
private String status;
/**
* @return
*/
public int getCatalogueId() {
return catalogueId;
}
/**
* @return
*/
public String getCatalogueName() {
return catalogueName;
}
/**
* @return
*/
public String getModerator() {
return moderator;
}
/**
* @return
*/
public String getStatus() {
return status;
}
/**
* @param i
*/
public void setCatalogueId(int i) {
catalogueId = i;
}
/**
* @param string
*/
public void setCatalogueName(String string) {
catalogueName = string;
}
/**
* @param string
*/
public void setModerator(String string) {
moderator = string;
}
/**
* @param string
*/
public void setStatus(String string) {
status = string;
}
}
public class SectionMaster {
/**
*
*/
public SectionMaster() {
super();
// TODO Auto-generated constructor stub
}
private int sectionId;
private String sectionName;
private int catalogueId;
private String status;
/**
* @return
*/
public int getCatalogueId() {
return catalogueId;
}
/**
* @return
*/
/**
* @return
*/
public String getSectionName() {
return sectionName;
}
/**
* @return
*/
public String getStatus() {
return status;
}
/**
* @param i
*/
public void setCatalogueId(int i) {
catalogueId = i;
}
/**
* @param i
*/
/**
* @param string
*/
public void setSectionName(String string) {
sectionName = string;
}
/**
* @param string
*/
public void setStatus(String string) {
status = string;
}
/**
* @return
*/
public int getSectionId() {
return sectionId;
}
/**
* @param i
*/
public void setSectionId(int i) {
sectionId = i;
}
}