Coder Social home page Coder Social logo

gorm-standalone-example-2_4_x's Introduction

Using GORM without Grails

Summary

This is a simple example demonstrating the usage of GORM outside Grails.

It’s a continuation of the GORM standalone example (Grails 2.x prior to version 2.3) project adapted for Grails 2.4.x.

Spring Boot is used to handle the configuration and bootstrapping.

References

Notes

  • This is a quick experiment and has been tested on JDK7 OSX only.
  • Gradle is used as build system.

Configuration and Data

Here are the main resources of the project:

  • Gradle build file (build.gradle)
  • Resource bundle for validation errors translations (src/main/resources/message.properties)
  • Log4j configuration (src/main/resources/log4j.properties)

Gotchas

  • Dependency resolution and GORM (methods missing in some Spring Framework releases expected to be found by specific GORM versions)
  • Other dependencies issues depending on the versions of Grails (grails-bootstrap), Spring Framework and GORM (grails-gorm)
  • For domain operations, either use transactional services or make sure that the Hibernate session is bound:
    • domainClass.withNewSession
    • domainClass.withTransaction

Running the application

Execute the following targets to test and run the application

On Unix/Linux platforms, run the following command:

./gradlew bootRun

For MS Windows please run the following command:

gradlew.bat bootRun

Generating IDE project files

This is for people who would rather not use Gradle.

Unix/Linux platforms

Please run the following command:

./gradlew idea eclipse

Windows

Please run the following command:

gradlew.bat idea eclipse

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.