Unit 4
Unit 4
4
DR.N.HEMA PRIYA
STAFF INCHARGE
http://makble.com/what-is-spring-framework
Its Core module provides a lightweight container for ordinary JavaBeans implements inversion of control
(IoC) and dependency injection, allowing complex graphs of objects to be declared rather than managed
programmatically.
It simplifies exception handling by a combination of strategies:
providing an excellent error reporting framework.
It offers a flexible web framework that implements the model/view/controller pattern and offers pluggable
strategies for all of its high-level decision-making.
It implements aspect-oriented programming (AOP) at many levels, allowing “cross-cutting concerns” to be
addressed effectively for even very complex applications.
It offers a simple means of integrating persistence tools while preserving application-level control of
transactions.
1.singleton – only one instance of the spring bean will be created for the spring container. This is the
default spring bean scope. While using this scope, make sure bean doesn’t have shared instance
variables otherwise it might lead to data inconsistency issues.
2.prototype – A new instance will be created every time the bean is requested from the spring
container.
3.request – This is same as prototype scope, however it’s meant to be used for web applications. A
new instance of the bean will be created for each HTTP request.
4.session – A new bean will be created for each HTTP session by the container.
5.global-session – This is used to create global session beans for Portlet applications.
https://www.journaldev.com/21039/spring-bean-scopes
Installing Hibernate
Once you downloaded and unzipped the latest version of the Hibernate Installation
file, you need to perform following two simple steps. Make sure you are setting your
CLASSPATH variable properly otherwise you will face problem while compiling
your application.
•Now, copy all the library files from /lib into your CLASSPATH, and change your
classpath variable to include all the JARs −
•Finally, copy hibernate3.jar file into your CLASSPATH. This file lies in the root
directory of the installation and is the primary JAR that Hibernate needs to do its
work.
Oct 17, 2023 DEPARTMENT OF IT, PSGCT
Supporting Technologies
It can translate from Java to SQL data types and vice versa.
The Map interface provides three collection views, which allow a map's contents to be
viewed as a set of keys, collection of values, or set of key-value mappings. A Map is
mapped with a <map> element in the mapping table and an unordered map can be
initialized with java. util.
@Table annotation allows to specify the details of the table that will be used to persist
the entity in the database.
@Id annotation will automatically determine the most appropriate primary key
generation strategy to be used
@GeneratedValue annotation, which takes two parameters strategy and generator
The @Column annotation is used to specify the details of the column to which a field or
property will be mapped.
topjavatutorial.com/frameworks/spring/spring-rest/spring-restful-crud-operations-hibernate/
https://examples.javacodegeeks.com/enterprise-java/spring/mvc/spring-mvc-and-hibernate-
login-form-example/