Hi Jaikiran
Please find the POJO and corrsponding hbm file below that i am using.
public class Roles {
private int roleid;
private
String rolename;
private String description;
private int deleted_flg;
private String scope;
public Roles() {
}
public Roles(int roleid, String rolename, String description,int deleted_flg,String scope) {
this.roleid = roleid;
this.rolename = rolename;
this.description = description;
this.deleted_flg = deleted_flg;
this.scope = scope;
}
/** The getter method for this Deleted Flag
*
* @hibernate.property
*/
public int getDeleted_flg() {
return deleted_flg;
}
/**
* @param deleted_flg the deleted_flg to set
*/
public void setDeleted_flg(int deleted_flg) {
this.deleted_flg = deleted_flg;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/** The getter method for this Role's identifier.
*
* @hibernate.id generator-class="native"
*/
public int getRoleid() {
return roleid;
}
/**
* @param roleid the roleid to set
*/
public void setRoleid(int roleid) {
this.roleid = roleid;
}
/** The getter method for this Role's name
*
* @hibernate.property
*/
public String getRolename() {
return rolename;
}
/**
* @param rolename the rolename to set
*/
public void setRolename(String rolename) {
this.rolename = rolename;
}
/** The getter method for this Scope's name
*
* @hibernate.property
*/
public String getScope() {
return scope;
}
/**
* @param scope the scope to set
*/
public void setScope(String scope) {
this.scope = scope;
}
}
--------------------------------------------------------------------------
roles.hbm.xml
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.miletag.server.persist.Roles" table="ROLES" >
<id name="roleid" column="ROLEID" >
<generator class="native"/>
</id>
<property name="rolename" type="java.lang.String" column="ROLENAME" />
<property name="description" type="java.lang.String" column="DESCRIPTION" />
<property name="deleted_flg" type="int" column="DELETED_FLG" />
<property name="scope" type="java.lang.String" column="SCOPE" />
</class>
</hibernate-mapping>