Giter VIP home page Giter VIP logo

try-hibernate's Introduction

try-hibernate

CI Status

  • Build Status

Goal

Try features of Hibernate without install database.

Hibernate version

  • 4.3.5.Final

Usage:

  • Step 1: Clone the project
  • Step 2: Load to your favorite Java IDE with Gralde support.
  • Step 3. Check unit test of this Project. One ut case is just one complete Hibernate usage example.

Cases

  • HQL multiple count:

TODO

  • Add CI. Or the project is rubbish.
  • Refactor: for every test (java), one database, data, one hibernate config, one domain model. One session.
  • Stick to HSQL and learn HSQL. It is better choice for this project. More details check HSQL chapter.
  • Easy to prepare table, data, bean.

Some tips when you run into some problems

  • Every test method tagged with annotation @Test has its own in-memory database, hibernate config.

  • Hibernate config seems not update. Try to run gradle processTestResources to update the hibernate.cfg.xml.

HSQL

Reference:

Database

Usage:

  • Check the Unit Test to see the demo of how to use Hibernate.
  • Load the project into IntelliJ and debug the unit test.
  • Before running single case, you'd better run cleanMockData to clean database.

Some tips when you run into some errors.

  • Suggest use gradle task 'gradle cleanMockData' to remove database before you test.

Issues

  • The cases are not independent. All of them are using the same database. So Only run one test case every time and run cleanMockData before.

Helpful links

try-hibernate's People

Contributors

jicahoo avatar lianwaiyuchanchan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.