dineshonjava

Learn with Best Hibernate Tutorial for Beginners



Hibernate Tutorial


This hibernate tutorial provide step by step instructions on using Hibernate 3.0. Hibernate is popular open source object relational mapping tool for Java platform. It provides powerful, ultra-high performance object/relational persistence and query service for Java.

Actually Hibernate is much more than ORM Tool (Object - Relational Mapping) because today its provide lots of features in the persistence data layer.

ORM means Objects to Relational Mapping i.e. Java Persistence Objects are mapped to Relational databases by using ORM tools. 

HIBERNATE :
  • An ORM Tool
  • Used in the Data layer of the applications
  • Implements JPA (Java Persistence API) i.e its have set of standards that have been prescribed for any persistence of any implementation need to be satisfied to persistence rules in the java that given minimal change of codes means follow the all rules of persistence in later if any change in the ORM tools with minimum change in the code.
Why We Have to Use ORM Tools?
Hibernate Mapping 

Here there is one problem to object save in to relational database each entity of the object save individually to the database table in the associated columns. It is more times taken and complex in case of lots of user objects to be save into the database table.


When Inserting into database.

                        Object's Property ID set to ID column
                        Object's Property Name set to Name Column
                        Object's Property Address set to Address Column
                        Object's Property Phone set to Phone Column
                        Object's Property Date of Birth set to DOB Column

When Fetching Result Set from Database Table.

                         Column ID's Value set to Object's ID Property
                         Column Name's Value set to Object's Name Property

                         Column Address's Value set to Object's Address Property

                         Column Phone's Value set to Object's Phone Property

                         Column DOB's Value set to Object's Date of Birth Property



Hibernate ORM

Hibernate

  1. Introduction to Hibernate 3.0
  2. Hibernate Architecture 
  3. Setting Up Hibernate
  4. Writing a First Hibernate Application Using Annotation
  5. Writing a First Hibernate Application Using Mapping File
  6. Understanding Hibernate O/R Mapping 
  7. Saving Objects using Hibernate APIs
  8. Using Annotations vs Configuration files
  9. hbm2ddl Configuration and Name Annotations
  10. Retrieving Objects using session.get
  11. Hibernate Update Query
  12. Hibernate Delete Query
  13. Value Types and Embedding Objects
  14. Saving Collections
  15. Configuring Collections and Adding Keys
  16. Proxy Objects and Eager and Lazy Fetch Types
  17. Hibernate One-To-One Mapping Tutorial   
  18. Hibernate One-To-Many Mapping Tutorial 
  19. Hibernate Many-To-One Mapping Tutorial 
  20. Hibernate Many-To-Many Mapping Tutorial 
  21.  CascadeTypes and Other Things
  22.   Implementing Inheritance in Hibernate (Single Table Strategy, With Table Per Class Strategy, With Joined Strategy)
  23. CRUD Operations Using Hibernate 3 (Annotation and Configuration)
  24. Transient, Persistent and Detached Objects in Hibernate
  25. Understanding State Changes of Object in Hibernate
  26.  Introducing HQL(Hibernate Query Language) and the Query Object
  27. Select and Pagination in HQL
  28. Understanding Parameter Binding and SQL Injection
  29. Named Queries
  30. Introduction to Criteria API
  31. Understanding Restrictions
  32. Cacheing in Hibernate: First Level and Second Level Cache in Hibernate
  33. Using Query Cache in Hibernate
  34. Hibernate Batch Processing




References

This tutorial textual implementation of Java Brain Videos.



Design Patterns Tutorial

What is the design pattern?

If a problem occurs over and over again, a solution to that problem has been used effectively. That solution is described as a pattern. The design patterns are language-independent strategies for solving common object-oriented design problems. When you make a design, you should know the names of some common solutions. Learning design patterns is good for people to communicate each other effectively. In fact, you may have been familiar with some design patterns, you may not use well-known names to describe them. SUN suggests GOF (Gang Of Four--four pioneer guys who wrote a book named "Design Patterns"- Elements of Reusable Object-Oriented Software), so we use that book as our guide to describe solutions. Please make you be familiar with these terms and learn how other people solve the code problems.

How many design patterns?

Many. A site says at least 250 existing patterns are used in OO world, including Spaghetti which refers to poor coding habits. The 23 design patterns by GOF are well known, and more are to be discovered on the way.
1. Creational Patterns 2. Structural Patterns 3. Behavioral Patterns 4. J2EE Patterns
--- Abstract Factory --- Adapter --- Chain of Responsibility --- MVC
--- Builder --- Bridge --- Command --- Business Delegate
--- Factory Method --- Composite --- Interpreter --- Composite Entity
--- Prototype --- Decorator --- Iterator --- Data Access Object
--- Singleton --- Fa├žade --- Mediator --- Front Controller
--- Memento --- Intercepting Filter
--- Service Locator
--- Transfer Object

Bridge Design Pattern

“Decouple an abstraction from its implementation so that the two can vary independently” is the intent for bridge design pattern as stated by GoF. Bridge design pattern is a modified version of the notion of “prefer composition over inheritance”. Problem and Need for Bridge Design Pattern When there are inheritance hierarchies creating concrete implementation, you loose [...]

Facade Design Pattern

GoF definition for facade design pattern is, “Provide a unified interface to a set of interfaces in a subsystem. Facade Pattern defines a higher-level interface that makes the subsystem easier to use.” How do we infer the above definition? Think of a component that solves a complex business problem. That component may expose lot of [...]

Decorator Design Pattern

To extend or modify the behaviour of ‘an instance’ at runtime decorator design pattern is used. Inheritance is used to extend the abilities of ‘a class’. Unlike inheritance, you can choose any single object of a class and modify its behaviour leaving the other instances unmodified. In implementing the decorator pattern you construct a wrapper [...]

 

Adapter Design Pattern

An adapter helps two incompatible interfaces to work together. This is the real world definition for an adapter. Adapter design pattern is used when you want two different classes with incompatible interfaces to work together. The name says it all. Interfaces may be incompatible but the inner functionality should suit the need. In real world the [...]

Singleton Design Pattern

Singleton design pattern is the first design pattern I learned (many years back). In early days when someone asks me, “do you know any design pattern?” I quickly and promptly answer “I know singleton design pattern” and the question follows, “do you know anything other than singleton” and I stand stumped! A java beginner will [...]

Prototype Design Pattern

When creating an object is time consuming and a costly affair and you already have a most similar object instance in hand, then you go for prototype pattern. Instead of going through a time consuming process to create a complex object, just copy the existing similar object and modify it according to your needs. Its [...]

Builder Design Pattern

Builder pattern is used to construct a complex object step by step and the final step will return the object. The process of constructing an object should be generic so that it can be used to create different representations of the same object. For example, you can consider construction of a home. Home is the [...]

Abstract Factory Design Pattern

Factory of factories. To keep things simple you can understand it like, you have a set of ‘related’ factory method design pattern. Then you will put all those set of simple factories inside a factory pattern. So in turn you need not be aware of the final concrete class that will be instantiated. You can [...]

Factory Method Design Pattern

A factory method pattern is a creational pattern. It is used to instantiate an object from one among a set of classes based on a logic. Assume that you have a set of classes which extends a common super class or interface. Now you will create a concrete class with a method which accepts one [...]

Expert in Java Web and Desktop Application


Expert in Java Web and Desktop Application


We would like to work for some organizations where we provide excelent services of java in the web and desktop based application with excelent User Intreface, we used our experiences and skills for greatly enhance the organization success and our client's organistion growth.
http://www.dineshonjava.com/

Professional Summary


Currently working as Assistance Tech Lead at Times Group Ltd Noida. Having expertise in Latest Version of Spring Framework, Spring Batch, Spring Security, AOP, Struts2, JSP, Hibernate3, Solr3, JQuery, Web Services (REST, JAX-WS), MongoDB and Web Application Architecture. I have expertise with working using AGILE Methodology (JIRA). Having expertise in the code management repository like GitHub and CVS. I had worked with Paytm.com I was first developer Paytm.com. With this product I have very good development experience on spring struts integration with hibernate, JSP and Servlet with MySql5 on the Eclipse3.4 with Tomcat.

I have also like to write the technical blogs related to the latest java technologies and provide online assist to developers across the world in spare time. I have my own blog www.dineshonjava.com which have approx 12000 page views per day.

Experience Summary


MagicBricks Reality Services Ltd Noida (Times Group- MagicBricks.com) (June2011 – Till Date)
My responsibility includes:
  • Working as Assistance Tech Lead & Developer in API team, Design and developing Services Integration (REST) with Mobile apps, m site and others third party application.
  • Discussing Features and Enhancements with product and taking their requirement and design technical document and development with technologies (Latest version of Spring Framework, Spring REST, Tiles JSON, Jackson, JSP, Hibernate, for bulk operation using Spring Batch Web Services REST and MongoDB, Search Technology Solr).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Communicate with third parties for integration web services with their applications.
  • Using GitHub and CVS for code management, branching and tagging.
  • Functional, Unit and Integration testing of the applications. 
  • Conduct User acceptance testing.
  • Understanding user requirement.

PayTM.com (One97 Communication Ltd Noida Company) (Sep 2010 – 06 June2011)
My responsibility includes:
·         Understanding product requirement.
  • Software application development (Spring, Struts and Hibernate Integration, MySQL, JSP, XML, DOJO, AJAX, JQuery).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Using SVN as repository management
  • Functional, Unit and Integration testing of the applications Bug fixing.

 Daffodil Software Ltd Gurgaon (April 2010– 12 Sep 2010)
 My responsibility includes:
  • Understanding user requirement.
  • Software application development (Core Java, Servlet, JSP, Struts2, Hibernate3, XML, MySql Eclipse Galileo, JQuery).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Functional, Unit and Integration testing of the applications Bug fixing. 
  • Conduct User acceptance testing.
Softgains Technologies Greater Noida (Aug 2009-April 2010)
  • Working as Software Trainee
  • Software application development (Core Java, Servlet, JSP, Spring, Hibernate)

Professional Skills


·         Servers                                :   Apache Tomcat, JBOSS, BEA weblogic.
·         Languages                          :    JAVA/J2EE.
·         Repository Tool                   :    Git, CVS, Tortoise SVN.
·         Development Tools    : Core Java, Spring Framework, Hibernate ORM framework, REST and SOAP web            Services, NoSQL MongoDB, Struts2, JSP, Thymeleaf, Apache Tiles, Servlet, JQuery, Servlet, iBatis, Hadoop and Search Technology Solr, DS & Algorithms.
·         Scripting Language             :     JQuery, JavaScript. AJAX, DWR, DOJO
·         Databases                           :     DB2, MySql, NoSQL MongoDB
·         SDLC                                   :    AGILE (JIRA)
·         Java IDE                              :    STS, My Eclipse, Eclipse Galileo3.5, NetBeans
·         Operating System               :    Windows Platform, Linux Platform
·         Others                                 :    JIRA, FileZilla, BugZilla, Putty.

Awards and Certifications              


·         I am certified for M101J: MongoDB for Java Developers and M102: MongoDB DBA a course of study offered by 10gen, The MongoDB Company.
·         I am awarded for Extra Mile Club TBSL for clean, optimized and crucial feature (advice.magicbricks.com) release with minimum time line.
·         Secured ---first position in graduation qualification in college.
·         I was selected for Advanced Training Program for Mathematics organized by Science and Technology Department of Delhi.


Projects                                                                                                                 


1: Project Title

REST API services for www.magicbricks.com
Domain Name : api.magicbricks.com 
Software Platform
Spring3.2, Hibernate3.0, JSP, JQuery, JSON, Velocity, STS,DB2, Spring Batch Process, DWR, Apache Solr, MongoDB
Project Details
www.magicbricks.com is a product of MagicBricks Reality Services Ltd.

This is a commercial web application based on real estate web search engine and advertisement tool for all new property and new project across world. 

www.magicbricks.com is an effort to more searches about property related data provide to the client and give relevance offer to user for posting the properties, requirements, new projects, agents and brokers and its related searches.

Roles And Responsibilities:
  • Understanding user requirement.
  • Assistance Tech Lead of API team, Design and developing Services Integration (REST) with Mobile apps, m site and others third party application.
  • Discussing Features and Enhancements with product and taking their requirement and design technical document and development with technologies (Latest version of Spring Framework, Spring REST, Tiles JSON, Jackson, JSP, Hibernate, for bulk operation using Spring Batch Web Services REST and MongoDB, Search Technology Solr).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Communicate with third parties for integration web services with their applications.
  • Using GitHub and CVS for code management, branching and tagging.
  • Functional, Unit and Integration testing of the applications. 
  • Conduct User acceptance testing.

2: Project Title
M Site Magic Bricks
url : m.magicbricks.com
Software Platform
Spring MVC, JSP, REST, Eclipse3.5, DB2, JSON
Project Details
m.magicbricks.com is a product of MagicBricks Reality Services Ltd.

This is a commercial mobile web application based on real estate web search engine and advertisement tool for all new property and new project across world. 

m.magicbricks.com is an effort to more searches about property related data provide to the client and give relevance offer to user for posting the properties, requirements, new projects, agents and brokers and its related searches.
Roles And Responsibilities:
  • Understanding user requirement.
  • Software development (SpringMVC, JSP, REST, Eclipse3.5, DB2, JSON).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Using GitHub and CVS for code management, branching and tagging.
  • Functional, Unit and Integration testing of the applications.
  • Make Release plan for live

3: Project Title
advice.magicbricks.com
Software Platform
Spring3.2, Hibernate3.0, JSP, JQuery, JSON, Velocity, STS,DB2, Spring Batch Process, DWR, Apache Solr, MongoDB
Project Details
advice.magicbricks.com is a product of MagicBricks Reality Services Ltd.
.
This application for Get Property Advice, Compare rates and trends, get insights into buyer demand & other real estate related expert advice with various tools by MagicBricks.com. 
Roles And Responsibilities:
  • Discussing Features and Enhancements with product and taking their requirement and design technical document and development with technologies (Latest version of Spring Framework, Spring REST, Tiles JSON, Jackson, JSP, Hibernate, for bulk operation using Spring Batch Web Services REST and MongoDB, Search Technology Solr).
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Communicate with third parties for integration web services with their applications.
  • Using GitHub and CVS for code management, branching and tagging.
  • Functional, Unit and Integration testing of the applications. 
  • Conduct User acceptance testing.
  • Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Using SVN for code management, branching and tagging.

4: Project Title
PayTM.com (02 Feb 2011 – 30 May 2011).

Client Name
Product and service of One97.

Software Platform
SpringMVC, JSP, MySql5, Eclipse3.5, iBatis.

Project Details
This is a commercial web application based on mobile prepaid recharge and DTH recharge with offering some coupons based recharge type. 

PayTM.com is an effort to offer a secure, easy and reliable medium for mobile users to recharge their prepaid mobile phone and get special offers/deals. At PayTM.com, you can buy instant mobile recharge for mobile operators, such as Airtel, Vodafone, Reliance, Idea, BSNL, Uninor, Tata Indicom, Aircel, Tata Docomo, Loop Mobile, MTS, STel, and Videocon, among others.


Roles And Responsibilities:
  • Understanding user requirement.
  • Software development (JSP, MySql, SpringMVC, iBatis).
  • Functional, Unit and Integration testing of the applications.
  • We working under AGILE methodology (SDLC) for development and cross teams communication
  • . Using Software development tool used by my team JIRA Software is built for every member of your software team to plan, track, and release great software.
  • Using SVN for code management, branching and tagging.       



5: Project Title
Faculty Management Software (Aug 2009 to Nov 2009)
Software Platform
 Core Java, JSP, Servlet, MySql.
Project Details
This software manages all processes to assigning faculties to subjects and gives previous year feedback of faculties.
Modules are given below.
1) Registration  Module
2) Feedback Module
3) Subject Assigning Module

Mail Id:          admin@dineshonjava.com

Contact No : +91 9582486434

Web: http://www.dineshonjava.com/

Eclipse Shortcuts

Editors are an integral part of a programmer’s life. If you have good proficiency in using an editor thats a great advantage. It comes very handy to debug. Traditional notepad and SOPs (System.out.println) are the way we start learning a language but that is not sufficient, so beginners start using an IDE and most importantly know the shortcuts. For java developers there is a huge list and some popular areEclipse, Netbeans, IntelliJ Idea. I use Eclipse as my IDE and vim as a light weight editor.
This article is for those who use or intend to use Eclipse as IDE. Keyboard shortcuts are very important for comfortable and quick editing. I have abridged the following list of eclipse shortcuts from my own experience and literature.

File Navigation – Eclipse Shortcuts

  • CTRL SHIFT R – Open a resource. You need not know the path and just part of the file name is enough.
  • CTRL E – Open a file (editor) from within the list of all open files.
  • CTRL PAGE UP or PAGE DOWN – Navigate to previous or next file from within the list of all open files.
  • ALT <- or ALT -> – Go to previous or next edit positions from editor history list.

Java Editing – Eclipse Shortcuts

  • CTRL SPACE – Type assist
  • CTRL SHIFT F – Format code.
  • CTRL O – List all methods of the class and again CTRL O lists including inherited methods.
  • CTRL SHIFT O – Organize imports.
  • CTRL SHIFT U – Find reference in file.
  • CTRL / – Comment a line.
  • F3 – Go to the declaration of the variable.
  • F4 – Show type hierarchy of on a class.
  • CTRL T – Show inheritance tree of current token.
  • SHIFT F2 – Show Javadoc for current element.
  • ALT SHIFT Z – Enclose block in try-catch.

General Editing – Eclipse Shortcuts

  • F12 – Focus on current editor.
  • CTRL L – Go to line number.
  • CTRL D – Delete a line.
  • CTRL <- or -> – Move one element left or
References-
http://javapapers.com/
http://www.eclipse.org/