Posts

Showing posts from January, 2013

Spring and Hibernate Integration....

Integrating Hibernate with Spring I tried to learn how to integrate Hibernate with Spring and found very useful information in Spring in Action by Craig Walls. Before getting started let me tell you about the example I have used in this article. I am having a very basic table in database CREATE TABLE sample ( id int ( 10) unsigned NOT NULL AUTO_INCREMENT, name varchar ( 45) NOT NULL , city varchar ( 45) NOT NULL , PRIMARY KEY ( id) ) ; and here is Sample.hbm.xml < ? xml version = "1.0" ? > < ! DOCTYPE hibernate - mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > < hibernate - mapping > < class name = "hibernate.Sample" table = "sample" lazy = "false" > < id name = "id" column = "id" type = "java.lang.Long" > ...