It is very easy to configure any J2EE-based web application to use Spring. At the very least, you can simply add Spring’s ContextLoaderListener to your web.xml file:
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
These are the key benifits of Hibernate:
Transparent persistence based on POJOs without byte code processing Powerful object-oriented hibernate query language Descriptive O/R Mapping through mapping file. Automatic primary key generation Hibernate cache : Session Level, Query and Second level cache. Performance: Lazy initialization, Outer join fetching, Batch fetching
Add the hibernate mapping file entry in mapping resource inside Spring’s applicationContext.xml file in the web/WEB-INF directory.
<property name="mappingResources"> <list> <value>org/appfuse/model/User.hbm.xml</value> </list> </property>
For a typical Spring Application we need the following files
1. An interface that defines the functions. 2. An Implementation that contains properties, its setter and getter methods, functions etc., 3. A XML file called Spring configuration file. 4. Client program that uses the function.
A Great Tutorials Portal
Aquarian Infotech System
Copyright © 2008 interviewmaterial.com. All rights reserved.