Hibernate version: 2.1.7
Hello Guys
I am a hibernate newbie and having some start up problem. I must be doing something silly but i need someone to point me out in right direction.
I am running a example given on site :
http://homepage.mac.com/edahand/project ... mple1.html
to jump start on tomcat, struts, hibernate and mysql. Example works fine
but data is not getting into database. When i go to database, table is blank.....
Code and details are:
mapping file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.ehand.hibernatetest.Item" table="item" >
<id name="id" column="id" type="java.lang.Long" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="name" column="name" type="java.lang.String" />
<property name="description" column="description" type="java.lang.String" />
</class>
</hibernate-mapping>
code for adding to database:
Session session = getSession();
try
{
session.save(item);
session.flush();
}
catch (HibernateException e)
Could some one point me why it is not getting into database.....
Thanks in advance for help
Manan