Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

rimerosolutions/gorm-standalone-example-2_4_x

Repository files navigation

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

About

Gorm standalone example - Spring boot

Resources

Stars

Watchers

Forks

Languages