Hello everyone ,
I am new to Hibernate - and thought I would try out a ready made example
Here are some code excerpts :
In the
JSP :
=============================
<%@ page import="hib.Item" %>
<%@ page import="hib.ItemService" %>
<%
Item item = new Item();
item.setDescription("Desc");
item.setName("Name");
// this line gives an error
ItemService.getInstance().addItem(item);
%>
=============================
" Item " is a simple
Java Bean
The problem is when the code tries to get a "Session" Object
Here is the xml file : "Item.hbm.xml"
======================================
<hibernate-mapping>
<class name="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>
======================================
The error that I get is :