Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: :3.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?yes
Read this:
http://hibernate.org/42.html
Error is <Sessionfactory error: entity class not found: Addressarea >
/**
* Addressarea generated by hbm2java
*/
public class Addressarea implements java.io.Serializable {
// Fields
private long addSlno;
private String addcountry;
private String city;
private String area;
private String pincode;
// Constructors
/** default constructor */
public Addressarea() {
}
/** minimal constructor */
public Addressarea(long addSlno) {
this.addSlno = addSlno;
}
/** full constructor */
public Addressarea(long addSlno, String addcountry, String city, String area, String pincode) {
this.addSlno = addSlno;
this.addcountry = addcountry;
this.city = city;
this.area = area;
this.pincode = pincode;
}
// Property accessors
public long getAddSlno() {
return this.addSlno;
}
public void setAddSlno(long addSlno) {
this.addSlno = addSlno;
}
public String getAddcountry() {
return this.addcountry;
}
public void setAddcountry(String addcountry) {
this.addcountry = addcountry;
}
public String getCity() {
return this.city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return this.area;
}
public void setArea(String area) {
this.area = area;
}
public String getPincode() {
return this.pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
}
<?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 Sep 4, 2006 4:47:51 PM by Hibernate Tools 3.2.0.beta6a -->
<hibernate-mapping>
<class name="com.srit.his.persistence.Addressarea" table="ADDRESSAREA">
<id name="addSlno" type="long">
<column name="ADD_SLNO" precision="18" scale="0" />
<generator class="assigned" />
</id>
<property name="addcountry" type="string">
<column name="ADDCOUNTRY" length="50" />
</property>
<property name="city" type="string">
<column name="CITY" length="50" />
</property>
<property name="area" type="string">
<column name="AREA" length="50" />
</property>
<property name="pincode" type="string">
<column name="PINCODE" length="50" />
</property>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.password">
PATIENTMOD
</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@192.168.1.74:1521:SHELLNET
</property>
<property name="hibernate.connection.username">
PATIENTMOD
</property>
<property name="default_schema">PATIENTMOD</property>
<property name="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<!-- mapping
resource="com/srit/his/persistence/Addressarea.hbm.xml" / -->
</session-factory>
</hibernate-configuration>