Coder Social home page Coder Social logo

basic-hibernate-example's Introduction

#This project covers basic hibernate concepts

Concepts Covered

1)CRUD operations
2)Embedding value types
3)Saving collections
4)Eager and Lazy fetching
5)Primary key auto generation strategy
6)One to One mapping
7)One to Many mapping
8)Many to One mapping
9)Many to Many mapping
10)Cascade types
11)Single Table strategy
12)Table per Class startegy
13)Joined strategy
14)Transient, Persistent and Detached objects
15)HQL and HQL pagination
16)Named queries and named native queries
17)Criteria API
18)Restrictions
19)Query by Example

Points to be noted

  • Make sure HSQL DB server is running before running the test case. (Download HSQL DB from https://sourceforge.net/projects/hsqldb/files/ )
  • Run individual test cases inside /HibernateSample/src/test/java/com/home/hibernate/test/HibernateTest.java as JUnit test.
  • TestCase name is self explanatory
  • Modify the hibernate.cfg.xml file as per your DB details
  • After running the test case, check the console output to understand the flow
  • Comment non related annotations (refer the entity class annotations and the test case)
  • Uncomment the required annotations(refer the entity class annotations and the test case)

Note: This project needs to be refactored to use best practices which will be done later. As of now this code should be used only for understanding purposes.

  • Note: Run individual test cases instead of running all the test cases together to understand better. Comment non related annotations and uncomment required annotations by refering the test case and entity class so that you will not get confused.

basic-hibernate-example's People

Contributors

jgpreetham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.