Top Banner

of 37

7th Sem Report Group

Aug 08, 2018

Download

Documents

VaiBhav Arora
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/22/2019 7th Sem Report Group

    1/37

    1

    IMPLEMENTAION OF OBJECT RELATION MAPPING IN

    ONLINE RAILWAY RESERVATION SYSTEM USING

    HIBERNATE AND ITS BENEFITS

    A practice school report submitted

    to

    NIT PATNA

    For Partial Fulfillment of the Requirement for the

    Award of the Degree

    of

    BACHELOR OF TECHNOLOGYin

    COMPUTER SCIENCE AND ENGINEERING

    by

    MAYANK SHUKLA

    VAIBHAV ARORAABHISHEK ANAND

    KALI PANDEY

    Under the Guidance of

    Mr. KUMAR ABHISHEK, Department of Computer Science and Engineering

    DEPARTMENT OF COMPUTER SCIENCE AND

    ENGINEERINGNATIONAL INSTITUTE OF

    TECHNOLOGY PATNA(An institute under Ministry of HRD, Govt. of India)

    PATNA - 800005, ASHOK RAJPATH

    2012

  • 8/22/2019 7th Sem Report Group

    2/37

    2

    NATIONAL INSTITUTE OF

    TECHNOLOGY(An institute under Ministry of HRD, Govt. of India)

    PATNA 800005 .

    DEPARTMENT OF COMPUTER SCIENCE ANDENGINEERING

    CERTIFICATE

    This is to certify that the practice school titled IMPLEMENTATION

    OF OBJECT RELATIONAL MODELLING USING HIBERNATE

    AND IT BENEFITS is a bonafied work of

    MAYANK SHUKLA

    VAIBHAV ARORA

    ABHISHEK ANAND

    KALI PANDEY

    0906028

    0906059

    0906058

    0906053

    Carried out in partial fulfillment of the requirements for awarding the

    degree of Bachelor of Technology in Computer Science and

    Engineering discipline in National Institute of Technology Patna during

    the academic year2012-2013.

    Mr. Kumar AbhishekAssistant professor

    Project Guide

    Dr. M.P.SinghProfessor & HOD

    Dept. of Computer Science and Engineering

  • 8/22/2019 7th Sem Report Group

    3/37

    3

    TABLE OF CONTENTS

    ACKNOWLEDGEMENTS ................................................................................ 5

    ABSTRACT ........................................................................................................... 6

    LIST OF TABLES ................................................................................................... 7

    LIST OF FIGURES ............................................................................................ 8

    ABBREVIATIONS ............................................................................................ 9

    CHAPTER 1 INTRODUCTION

    1.1 Object Relational Mapping.10

    1.2 Hibernate.11

    1.2.1 Hibernate Advantages...12

    CHAPTER 2 PROBLEMS WITH EXISTING SYSTEM AND ORM AS THEIR

    SOLUTION

    2.1 Persistence..13

    2.2 Object - Relation Impedence Mismatch..14

    2.2.1 Cost of Mismatch.16

    2.3 Object Relational Mapping.15

    2.3.1 Why ORM.17

    2.3.2 Benefits of ORM18

    2.4 Hibernate.21

    2.4.1 Hibernate Architecture.22

    CHAPTER 3 LITERATURE SURVEY

    3.1 Literature Survey23

  • 8/22/2019 7th Sem Report Group

    4/37

    4

    CHAPTER 4 DESIGN

    4.1 Use Case Diagram.26

    4.2 Entity Relationship Diagram..27

    4.3 Data Flow Diagram28

    CHAPTER 5DATABASE SCHEMA

    5.1 Database Schema..30

    CHAPTER 6 WORK FLOW OF IMPLEMENTATION

    4.1 Work flow of implementation..32

    CHAPTER 6 SNAPSHOTS OF SYSTEM

    8.1 Home Page..34

    8.2 Plan My Travel..34

    8.3 Find Trains35

    8.4 Book Ticket..35

    8.5 Electronic Ticket..36

    CHAPTER 8 REFRENCES.37

  • 8/22/2019 7th Sem Report Group

    5/37

    5

    ACKNOWLDGEMENT

    Nothing concrete can be achieved without an optimum combination of inspection and

    perspiration. The idea of presenting this material without adequate thanks to those who

    give it to us or pointed in the right direction seems simply indefensible. Generating this

    piece has been time consuming and an arduous task and has involved various

    contributions.

    It is our pleasure to acknowledge the help I have received from our project guide .Our

    sincere appreciation and gratitude to our project head respected Mr. Kumar Abhishek

    who guided us throughout the project.

  • 8/22/2019 7th Sem Report Group

    6/37

    6

    ABSTRACT

    KEYWORDS: ORM,(Object Relation Modelling), relational database , hibernate

    Object-relational mapping (ORM) in computer software is a programming technique for

    converting data between incompatible type systems in relational databases and object-

    oriented programming languages . ORM technologies mediates between object oriented

    architecture system and relational environment.

    The project is based on this ORM approach which was first realized in Hibernate, an open

    source project for Java systems started in 2002. Abstract-Hibernate is a very excellent

    ORM framework which allows developers to access database by using object-oriented

    approach. In the project we implemented ORM technique using Hibernate with struts

    framework in Indian railway reservation system by cloning IRCTC and comparing it with

    traditional jdbc and struts framework. The fir st and fo remost o bjec tive o f the

    project is to give a better service to the customer at the time of reserving the ticket of

    railway and eradicate the problems faced by the customer to some extent .

    The Online Railway Reservation System (ORRS) was one of the earliest changes to improve

    efficiency.A Computer Reservation System is used for the reservation of a

    particular train a n d i n t e r f a c e s w i t h a G l o b a l D i s t r i b u t i o n S y s t e m

    ( G D S ) w h i c h s u p p o r t s t r a v e l agencies and other distribution channels in making

    reservations for the most major airlines in a single system .Railway Reservation System

    contain train schedule, fare traffics, passenger reservations and ticket records. A

    railways direct distribution works within their own reservation system, as

    well as pushing out information to the GDS. A second type of direct

    distribution channel is consumers who use the internet or mobile application to

    make their own reservations

  • 8/22/2019 7th Sem Report Group

    7/37

    7

    LIST OF TABLES

    Table Title Page

    2.1 Mismatch problems that are exposed during loading and

    storing graphs of objects using a tabular relational database ..................... 15

    2.3 Features of Object Relational Modelling(ORM) .......................................... 17

  • 8/22/2019 7th Sem Report Group

    8/37

    8

    LIST OF FIGURES

    Figure Title Page

    1.1 Position and role of hibernate in database connectivity ................................ 10

    2.1 Architecture of Hibernate and its core components ...................................... 22

  • 8/22/2019 7th Sem Report Group

    9/37

    9

    ABBREVIATIONS

    ORM Object Relational Mapping

    JSP Java Server Pages

    EL Expression Language

    JSTL Java Standrad Tag Library

    RAM Random Access Memory

    SQL Structured Query Language

    JDBC Java Database Connectivity

  • 8/22/2019 7th Sem Report Group

    10/37

    10

    CHAPTER 1

    INTRODUCTION

    1.1 Object Relational Mapping(ORM) :

    Object-relational mapping (ORM) in computer software is a programming technique for

    converting data between incompatible type systems in relational databases and object-

    oriented programming languages . ORM technologies mediates between object oriented

    architecture system and relational environment.

    In a nutshell, object/relational mapping is the automated (and transparent) persistence of

    objects in a Java application to the tables in a relational database, using metadata that

    describes the mapping between the objects and the database. ORM, in essence, works by

    (reversibly) transforming data from one representation to another. This implies certain

    performance penalties. However, if ORM is implemented as middleware, there are many

    opportunities for optimization that wouldnt exist for a hand-coded persistence layer.

    Hibernate also provides solution to object relation impedence mismatch. Object-Relational

    Impedence Mismatch' (sometimes called the 'paradigm mismatch') is just a fancy way of

    saying that object models and relational models do not work very well together. Hibernate is

    an open source object relational mapping tool available in java . in Hibernate, an open

    source project for Java systems started in 2002. Abstract-Hibernate is a very excellent

    ORM framework which allows developers to access database by using object-oriented

    approach.

  • 8/22/2019 7th Sem Report Group

    11/37

    11

    1.2 Hibernate :

    With the information society and network and information technology fully to penetrate

    today's society, spreading across the globe. Heterogeneous database query optimization is

    very important. We can proceed to examine the following problem. First, the database is

    varied, which to communicate data between different databases is a big problem, one solution

    is to abandon the original database to achieve database consistency. But such costs are

    enormous:

    (1) data migration time-consuming enormous: to move data from one database to another

    database but also to maintain data consistency and data integrity, tremendous time-

    consuming.

    (2) unified database costly: a unified database to re-purchase of the database costly, but also

    to abandon the original database, which result in waste of resources. Must therefore seek to

    achieve unified management of heterogeneous databases. We are using hibernate to solve

    heterogeneous database systems between data types, data conversion, query decomposition

    and translation and query optimization technology.[1]

    Hibernate is an Object-Relational Mapping(ORM) solution for JAVA and it raised as an

    open source persistent framework created by Gavin King in 2001. It is a powerful, high

    performance Object-Relational Persistence and Query service for any Java Application.

    Hibernate maps Java classes to database tables and from Java data types to SQL data types

    and relieve the developer from 95% of common data persistence related programming tasks.

    Hibernate sits between traditional Java objects and database server to handle all the work in

    persisting those objects based on the appropriate O/R mechanisms and patterns.

  • 8/22/2019 7th Sem Report Group

    12/37

    12

    Fig. 1.1 Position and role of hibernate in database connectivity[8]

    1.2.1 Hibernate Advantages:

    Hibernate takes care of mapping Java classes to database tables using XML files andwithout writing any line of code.

    Provides simple APIs for storing and retrieving Java objects directly to and from thedatabase.

    If there is change in Database or in any table then the only need to change XML fileproperties.

    Abstract away the unfamiliar SQL types and provide us to work around familiar JavaObjects.

    Hibernate does not require an application server to operate. Manipulates Complex associations of objects of your database. Minimize database access with smart fetching strategies. Provides Simple querying of data.

  • 8/22/2019 7th Sem Report Group

    13/37

    13

    Chapter 2

    Problems with existing Systems and ORM as their solution

    2.1 Persistence

    Persistence simply means that we would like our application's data to outlive the applications

    process. Persistence in computer science refers to the characteristic of state that outlivesthe process that created it.The purpose is to make it be more efficient in future use, and is not

    necessary to get the data from the database at all time. Without this capability, state would

    only exist in RAM, and would be lost when this RAM loses power, such as a computer

    shutdown.

    In Java terms, we would like the state of some of our objects to live beyond the scope of the

    JVM so that the same state is available later. The Java Persistence API draws on ideas from

    leading persistence frameworks and APIs . Persistence is used to solve the conflicts between

    relational database and object-oriented programming language. It can convert records to

    objects. Persistence is the best way to solve and avoid non-target operation of the object-

    oriented programming operating data before the object database appears and becomes

    popular. Persistence of data is to package the data removed from the database, and put it in an

    object.[3]

    Persistence has been a hot topic of debate in the Java community. Is persistence a problem

    that is already solved by relational technology and extensions such as stored procedures, or is

    it a more pervasive problem that must be addressed by special Java component models such

    as EJB entity beans? Should we hand-code even the most primitive CRUD (create, read,

    update, delete) operations in SQL and JDBC, or should this work be automated? How do we

    achieve portability if every database management system has its own SQL dialect? Should

  • 8/22/2019 7th Sem Report Group

    14/37

    14

    we abandon SQL completely and adopt a new database technology, such as object database

    systems? Debate continues, but recently a solution called object/relational mapping (ORM)

    has met with increasing acceptance. Hibernate is an open source ORM implementation.

    2.2 Object - Relation Impedence Mismatch

    Object-Relational Impedence Mismatch' (sometimes called the 'paradigm mismatch') is just a

    fancy way of saying that object models and relational models do not work very well

    together. RDBMSs represent data in a tabular, whereas object-oriented languages, such as

    Java, represent it as an interconnected graph of objects. Loading and storing graphs of

    objects using a tabular relational database exposes us to 5 mismatch problems.

    1. Granularity

    Sometimes you will have an object model which has more classes than the number of

    corresponding tables in the database (we says the object model is more granular than the

    relational model). Take for example the notion of an Address...

    2. Subtypes (inheritance)

    Inheritance is a natural paradigm in object-oriented programming languages. However,

    RDBMSs do not define anything similar on the whole (yes some databases do have subtype

    support but it is completely non-standardized).

    3. Identity

    A RDBMS defines exactly one notion of 'sameness': the primary key. Java, however, defines

    both object identity (a==b) and object equality (a.equals(b)).

  • 8/22/2019 7th Sem Report Group

    15/37

    15

    4. Associations

    Associations are represented as unidirectional references in Object Oriented languages

    whereas RDBMSs use the notion of foreign keys. If you need bidirectional relationships in

    Java, you must define the association twice.

    Likewise, you cannot determine the multiplicity of a relationship by looking at the object

    domain model.

    5. Data navigation

    The way you access data in Java is fundamentally different than the way you do it in a

    relational database. In Java, you navigate from one association to an other walking the object

    network. This is not an efficient way of retrieving data from a relational database. You

    typically want to minimize the number of SQL queries and thus load several entities via

    JOINs and select the targeted entities.

    Table 2.1 Mismatch problems that are exposed during loading and storing graphs of objects

    using a tabular relational database.[8]

    2.2.1 Cost of Mismatch

    The overall solution for the list of mismatch problems can require a significant outlay of time

    and effort. In our experience, the main purpose of up to 30 percent of the Java application

  • 8/22/2019 7th Sem Report Group

    16/37

    16

    code written is to handle the tedious SQL/JDBC and the manual bridging of the

    object/relational paradigm mismatch. One of the major costs is in the area of modeling. The

    relational and object models must both encompass the same business entities. But an object-

    oriented purist will model these entities in a very different way than an experienced relational

    data modeler. The usual solution to this problem is to bend and twist the object model until it

    matches the underlying relational technology. This can be done successfully, but only at the

    cost of losing some of the advantages of object orientation. Keep in mind that relational

    modeling is underpinned by relational theory.

    2.3 Object Relational Modelling ( ORM )

    Object-relational mapping (ORM) in computer software is a programming technique for

    converting data between incompatible type systems in relational databases and object-

    oriented programming languages . ORM technologies mediates between object oriented

    architecture system and relational environment.

    In a nutshell, object/relational mapping is the automated (and transparent) persistence of

    objects in a Java application to the tables in a relational database, using metadata that

    describes the mapping between the objects and the database. ORM, in essence, works by

    (reversibly) transforming data from one representation to another. This implies certain

    performance penalties. However, if ORM is implemented as middleware, there are many

    opportunities for optimization that wouldnt exist for a hand-coded persistence layer.[4]

    An ORM solution consists of the following four features:

  • 8/22/2019 7th Sem Report Group

    17/37

    17

    Table 2.3 Features of Object Relational Modelling(ORM)[8]

    2.3.1Why ORM?

    An ORM implementation is a complex beastless complex than an application server, but

    more complex than a web application framework like Struts or Tapestry. Why should we

    introduce another new complex infrastructural element into our system? Will it be worth it? It

    will take us most of this book to provide a complete answer to those questions. For the

    impatient, this section provides a quick summary of the most compelling benefits. But first,

    lets quickly dispose of a non-benefit. A supposed advantage of ORM is that it shields

    developers from messy SQL. This view holds that object-oriented developers cant be

    expected to understand SQL or relational databases well and that they find SQL somehow

    offensive. On the contrary, we believe that Java developers must have a sufficient level of

    familiarity withand appreciation ofrelational modeling and SQL in order to work with

    ORM. ORM is an advanced technique to be used by developers who have already done it the

    hard way. To use Hibernate effectively, you must be able to view and interpret the SQL

    statements it issues and understand the implications for performance.[6]

  • 8/22/2019 7th Sem Report Group

    18/37

    18

    2.3.2 Benefits of ORM :

    Productivity

    Persistence-related code can be perhaps the most tedious code in a Java application.

    Hibernate eliminates much of the grunt work (more than youd expect) and lets you

    concentrate on the business problem. No matter which application development strategy you

    prefertop-down, starting with a domain model; or bottomup, starting with an existing

    database schemaHibernate used together with the appropriate tools will significantly

    reduce development time.

    Maintainability:

    Fewer lines of code (LOC) makes the system more understandable since it emphasizes

    business logic rather than plumbing. In systems with hand-coded persistence, an inevitable

    tension exists between the relational representation and the object model implementing the

    domain. Changes to one almost always involve changes to the other. And often the design of

    one representation is compromised to accommodate the existence of the other. (What almost

    always happens in practice is that the object model of the domain is compromised.) ORM

    provides a buffer between the two models, allowing more elegant use of object orientation on

    the Java side, and insulating each model from minor changes to the other.

    Performance:

    A common claim is that hand-coded persistence can always be at least as fast, and can often

    be faster, than automated persistence. This is true in the same sense that its true that

    assembly code can always be at least as fast as Java code, or a handwritten parser can always

    be at least as fast as a parser generated by YACC or ANTLRin other words, its beside the

  • 8/22/2019 7th Sem Report Group

    19/37

    19

    point. The unspoken implication of the claim is that hand-coded persistence will perform at

    least as well in an actual application. But this implication will be true only if the effort

    required to implement at-least-as-fast hand-coded persistence is similar to the amount of

    effort involved in utilizing an automated solution. The really interesting question is, what

    happens when we consider time and budget constraints? Given a persistence task, many

    optimizations are possible. Some (such as query hints) are much easier to achieve with hand-

    coded SQL/JDBC. Most optimizations, however, are much easier to achieve with automated

    ORM. Hibernate allows many more optimizations to be used all the time. Furthermore,

    automated persistence improves developer productivity so much that you can spend more

    time hand-optimizing the few remaining bottlenecks

    Vendor independence

    An ORM abstracts your application away from the underlying SQL database and SQL

    dialect. If the tool supports a number of different databases (most do), then this confers a

    certain level of portability on your application. You shouldnt necessarily expect write

    once/run anywhere, since the capabilities of databases differ and achieving full portability

    would require sacrificing some of the strength of the more powerful platforms. Nevertheless,

    its usually much easier to develop a crossplatform application using ORM. Even if you

    dont require cross-platform operation, an ORM can still help mitigate some of the risks

    associated with vendor lock-in. In addition, database independence helps in development

    scenarios where developers use a lightweight local database but deploy for production on a

    different database. [7]

  • 8/22/2019 7th Sem Report Group

    20/37

    20

    1.3.3Generic ORM problems

    The following list of issues, which well call the O/R mappingproblems, are the fundamental

    problems solved by a full object/relational mapping tool in a Java environment. Particular

    ORM tools may provide extra functionality (for example, aggressive caching), but this is a

    reasonably exhaustive list of the conceptual issues that are specific to object/relational

    mapping:

    1 What do persistent classes look like? Are they fine-grained JavaBeans? Or are they

    instances of some (coarser granularity) component model like EJB?

    2.How transparent is the persistence tool? Do we have to adopt a programming model and

    conventions for classes of the business domain?

    2. How is mapping metadata defined? Since the object/relational transformation is

    governed entirely by metadata, the format and definition of this metadata is a centrally

    important issue. Should an ORM tool provide a GUI to manipulate the metadata graphically?

    Or are there better approaches to metadata definition?

    3. How should we map class inheritance hierarchies? There are several standard strategies.

    What about polymorphic associations, abstract classes, and interfaces?

    4. How do object identity and equality relate to database (primary key)identity? How do

    we map instances of particular classes to particular table rows?

    5. How does the persistence logic interact at runtime with the objects of the business

    domain? This is a problem of generic programming, and there are a number of solutions

    including source generation, runtime reflection, runtime bytecode generation, and buildtime

    bytecode enhancement. The solution to this problem might affect your build process (but,

    preferably, shouldnt otherwise affect you as a user).

  • 8/22/2019 7th Sem Report Group

    21/37

    21

    6 .What is the lifecyle of a persistent object? Does the lifecycle of some objects depend upon

    the lifecycle of other associated objects? How do we translate the lifecyle of an object to the

    lifecycle of a database row?

    7 .What facilities are provided for sorting, searching, and aggregating? The application could

    do some of these things in memory. But efficient use of relational technology requires that

    this work sometimes be performed by the database.

    8 .How do we efficiently retrieve data with associations? Efficient access to relational data is

    usually accomplished via table joins. Object-oriented applications usually access data by

    navigating an object graph. Two data access patterns should be avoided when possible: the

    n+1 selects problem, and its complement, the Cartesian product problem (fetching too much

    data in a single select). In addition, two issues are common to any data-access technology.

    They also impose fundamental constraints on the design and architecture of an ORM:

    Transactions and concurrency

    Cache management (and concurrency)

    It is clear that a full object-mapping tool needs to address quite a long list of issues.

    HIBERNATE is an open source ORM implementation, a full object mapping (ORM)

    tool. It provides all the benefits of an ORM tool and also many benefits over JDBC .

    2.4 HIBERNATE:

    Hibernate is an Object-Relational Mapping (ORM) solution for JAVA. It is a powerful, high

    performance object/relational persistence and query service. It allows us to develop persistent

    classes following object-oriented idiom including association, inheritance and

    polymorphism.

    2.4.1Hibernate Architecture :

  • 8/22/2019 7th Sem Report Group

    22/37

    22

    1) itself opens connection to database,

    2) converts HQL (Hibernate Query Language) statements to database specific statement,

    3) receives result set,

    4) then performs mapping of these database specific data to Java objects which are directly

    used by Java application.

    Hibernate uses the database specification from Hibernate Properties file. Automatic mapping

    is performed on the basis of the properties defined in hbm XML file defined for particular

    Java object.

    6. Hibernate communication with RDBMS

    Fig. 2.1 Architecture of Hibernate and its core components. [8]

  • 8/22/2019 7th Sem Report Group

    23/37

    23

    Chapter 3

    Literature Survey

    Following are some of the journals that have been published in IEEE on similar projects;

    these papers have served as the base of our project.

    1. Research and Design on Library Management System Based on Struts and HibernateFramework (2009) by Erxiang Chen and Minghui Liu.

    If some small libraries use traditional librarymanagement system, they maybe waste

    resources. Inorder to this problem, a library management systembased on struts and

    hibernate frame is put forward. Thissystem has MVC architecture. It is a mutil-tier

    system including presentation layer, business layer, data persistence layer and

    database layer, which can separate codes, and improve maintainability and reuse of

    thesystem.

    2. Design and Implementation of the Hibernate Persistence Layer Data Report SystemBased on J2EE (2009) by Ming Xue and Changjun Zhu

    The process of research and development of data report system for financial

    management is described in this paper. It chooses J2EE as platform, JasperReport as

    development tools, for the realization of the Report System with Hibernate to meet the

    requirement of users. In the process of project development, we pay more attention to

    the study of the mechanism of the report generation by JasperReport. The advantages

    of object-oriented (O/R) database are described, as well as the superiority of

    Hibernate; finally, we design the layout of the database with IReport. Traditional

    relational database is transformed into durable objects with the O/R mapping tools

    through Hibernate, so the database can be operated by the form of object, which will

    be used to develop the persistent objects mapped by the underlying data structure, and

    provide the service, such as querying, searching, and generating reports for theadvanced data.

    3. Study of Urban Planning Information System based on Struts and Hibernate (2009) byZianxing Chen

    According to urban managing requirements,, an urban planning information system is

    designed using Struts as the presentation layer framework and Hibernate as the data

    layer framework architecture. This paper implements the system with flexiblecomponent, XML and Java technology. It is introduced that the basic character of two

    frameworks with Struts, Hibernate and the technology of combination of them in

  • 8/22/2019 7th Sem Report Group

    24/37

    24

    this paper, the design of data persistence layer of the passenger transport information

    management system is discussed, besides good practicability and high efficiency, this

    system is provided with the advantages of definite responsibility and rapid feedback.

    It is also characterized by its good expansibility and maintainability. Finally, using an

    example expatiates the implementation of hibernate persistence solution.

    4. Efficient implement of ORM (Object/Relational Mapping) use in J2EE framework:Hibernate (2009) by Chuanlong Xia, Guangcan Yu and Meng Tang.

    Object-relational mapping (ORM) in computer software is a programming technique

    for converting data between incompatible type systems in relational databases and

    object-oriented programming languages. ORM technologies mediates between object

    oriented architecture system and relational environment; it is a solution for paradigm

    mismatch. This creates, in effect, a "virtual object database" that can be used from

    within the programming language. There are both free and commercial packagesavailable that perform objectrelational mapping, although some programmers opt to

    create their own ORM tools. The ORM approach was first realized in Hibernate, an

    open source project for Java systems started in 2002, which will be introduced here.

    Hibernate not only takes care of the mapping from Java classes to database tables (and

    from Java data types to SQL data types), but also provides data query and retrieval

    facilities. It can also significantly reduce development time otherwise spent with

    manual data handling in SQL and JDBC. Hibernate's goal is to relieve the developer

    from 95 percent of common data persistence related programming tasks. Hibernate

    may not be the best solution for data-centric applications that only use stored-

    procedures to implement the business logic in the database, it is most useful with

    object-oriented domain models and business logic in the Java-based middle-tier.

  • 8/22/2019 7th Sem Report Group

    25/37

    25

    Implementation of Object Relational

    Mapping in Railway Reservation

    System using Hibernate

  • 8/22/2019 7th Sem Report Group

    26/37

    26

    CHAPTER-4

    DESIGN

    4.1 USE CASE DIAGRAM

  • 8/22/2019 7th Sem Report Group

    27/37

    27

    4.2 ER DAIGRAM

  • 8/22/2019 7th Sem Report Group

    28/37

    28

    4.3 DATA FLOW DIAGRAM (DFD)

    LEVEL 0

    USER LEVEL 1:

  • 8/22/2019 7th Sem Report Group

    29/37

    29

    ADMIN LEVEL 1

  • 8/22/2019 7th Sem Report Group

    30/37

    30

    CHAPTER 5

    DATABASE SCHEMA

    DATABASE SCHEMA

  • 8/22/2019 7th Sem Report Group

    31/37

    31

  • 8/22/2019 7th Sem Report Group

    32/37

    32

    CHAPTER-6

    Work flow of implementation

    During this project the whole task was divided into three parts:-

    1. Study2. Documentation3. Development of the Reservation System

    The study required for the project comprised of understanding various technologies and

    framework used in the system such as JSP, Servlets, Hibernate, Struts Framework and all the

    other necessary things as per the requirement.

    Documentation comprised of mentioning the advantages of using Hibernate and the

    disadvantages related with JDBC. Also the documentation points out the advantages of using

    Struts framework which helped in reusing of code and smart development of the project. This

    documentation also consists of snapshots and database schema of the developed project to

    give an impression of how the final system would look like and its working.

    Development of the project is the most crucial task of any software project. To achieve a

    good system we divided the process of development into three phases:-

    Phase 1: This phase of the project has been completed till now. It focused on

    development of user interface and various pages that would be accessible to a user

    before and after logging onto the Reservation portal.

    Phase 2: Since the project aimed to differentiate between the accessing of the

    database using JDBC and the accessing of database using Hibernate, basic facilities of

    the Online Reservation System such as registering on the system, logging onto the

  • 8/22/2019 7th Sem Report Group

    33/37

    33

    user account, searching for trains between two stations and booking of ticket in any of

    the available trains have been demonstrated using both technologies. By using the

    reservation facility of both the system it is clear that usage of Hibernate offers better

    and faster query retrieval because of it persisting the data on users system. This phase

    of our project is also complete and is in working condition.

    Phase 3: The complete aim of the Online Railway reservation System was not only

    to develop a reservation system using Hibernate but was to clone the Indian Railway

    Reservation website (www.irctc.co.in) using Hibernate and to make some betterment

    to the existing system such as increasing its response time, reducing the traffic and to

    suggest various alternate routes that may be available between a pair of stations in

    case of no direct train between those stations on the given date. This phase of project

    is still to be done which would be covered during the further development of the

    project in the next semester. Also during this phase all those facilities would be

    provided to the user in the Railway Reservation System which should be necessary in

    any such system. Some smart methods to show availability of tickets in various

    classes of users selected train would also be employed.

    http://www.irctc.co.in/http://www.irctc.co.in/http://www.irctc.co.in/http://www.irctc.co.in/
  • 8/22/2019 7th Sem Report Group

    34/37

    34

    CHAPTER-7

    SNAPSHOTS OF SYSTEM

    HOME PAGE

    PLAN MY TRAVEL

  • 8/22/2019 7th Sem Report Group

    35/37

    35

    FIND TRAINS

    BOOK TICKET

  • 8/22/2019 7th Sem Report Group

    36/37

    36

    ELECTRONIC TICKET

  • 8/22/2019 7th Sem Report Group

    37/37

    REFERENCES

    1. ZHANG Zhen-you, WANG Yun-feng, DU Shan (2010) Research the QueryOptimization of Distributed Heterogeneous Database Based On Hibernate, 13.

    2. Erxiang Chen, L.A. and Minghui Liu (2009) Research and Design on LibraryManagement System Based on Struts and Hibernate Framework, 43-44.

    3. Jianxin Chen (2009) Research and Design on Library Management System Based onstruts and hibernate framework,

    4. CHUANLONG XIA, GUANGCAN YU and MENG TANG (2010) Efficient implement ofORM (Object/Relational Mapping) use in J2EE framework: Hibernate

    5. PengWu and Ye Kin (2010) Application Research on a Persistent Technique Basedon Hibernate.

    6. Jing Yang. Lexio leu (2010) Management System for Scientific Research Projectsbased on combined framework of Struts and Hibernate.

    7. Wei Zhang, Lina Xhao (2011) Analysis and Design of Persistent layer in object-oriented application program based on ORM.

    8.

    www.tutorialspoint.com