Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reference_description_with_linked_URLs____________________________Notes_______________________________________________________________




https://objectcomputing.com/files/6415/6694/2515/slide_deck_Groovy_3_and_Beyond_webinar.pdf

https://drive.google.com/open?id=1-BgJaeRWcU1Dl5Aa_-LUqNFDWkOUstYN

Groovy 3 and beyond
http://www.groovy-lang.org/closures.html#_groovy_closures_vs_lambda_expressionsGroovy closures vs Lambda expressions

file:///C:/Users/Jim%20Mason/Google%20Drive/_docs/howto/groovy/regex%20-%20Regular%20Expressions%20-%20A%20Gentle%20
User%20Guide%20and%20Tutorial.pdf

Regex rules

Slide_Deck_Groovy_for_Data_Science_Webinar.pdf

Groovy Data Science Tools - Paul King



Groovy 3x changes
http://groovy-lang.org/releasenotes/groovy-3.0.htmlGroovy 3x supports Lambda expressions too
https://docs.groovy-lang.org/docs/groovy-3.0.0-rc-1/html/documentation/Groovy 3x documentation


GORM
https://gorm.grails.org/
https://docs.grails.org/3.0.x/guide/GORM.html
https://gorm.grails.org/

gorm-tips-gr8conf-eu-2018-180601112357.pdf

https://www.slideshare.net/alvarosanchezmariscal/6-things-
you-need-to-know-about-gorm-6


gorm-data-access-toolkit-gids2017nareshagorm-170427103711.pdf

https://www.slideshare.net/nareshak/gorm-the-polyglot-data-access-toolkit


gorm-overview-2012-gormoverviewforsdforumjavasig2009-1231454414107214-1.pdf

https://www.slideshare.net/chris.e.richardson/overview-of-grails-object-relational-mapping-gorm-presentation


gorm-basics-2014-grailsgorm-141201080405-conversion-gate02.pdf
gorm-overview-2012-gormoverviewforsdforumjavasig2009-1231454414107214-1.pdf
gorm-data-access-toolkit-gids2017nareshagorm-170427103711.pdf
gorm-tips-gr8conf-eu-2018-180601112357.pdf


gorm-basics-2014-grailsgorm-141201080405-conversion-gate02.pdf

https://www.slideshare.net/TedVinke/grails-gorm


gorm-inside-and=out-jeff-scott-brown-2015--141105160207-conversion-gate01.pdf

https://www.slideshare.net/SpringCentral/gorm-inside-andout


advanced-gorm-graeme-rocher-141103185142-conversion-gate01.pdf

https://www.slideshare.net/SpringCentral/2-gx-2014-advanced-gorm


grails-gorm-2014-141201080405-conversion-gate02.pdf


gorm-inside-and-out-2016-g-rocher-160607123907.pdf

https://www.slideshare.net/graemerocher/gr8conf-2016-gorm-inside-and-out


http://daviddawson.me/blog/2017/09/06/groovy-gorm-shell-script.html

groovy-gorm-shell-scripting-daviddawson.me-Groovy Gorm Shell Script.pdf

Groovy Gorm Shell Scripting




Groovy DSLs




https://www.slideshare.net/paulk_asert/groovy-dsls-from-beginner-to-expertGroovy DSLs - Paul King, Guillaume LaForge - detailed
https://www.slideshare.net/glaforge/practical-groovy-dslGroovy DSLs in Practice - Guillaume LaForge - good
https://www.slideshare.net/NexThoughts/groovy-dsl-62615687DSL in Groovy - short
https://www.slideshare.net/paulbowler/dsls-with-groovyDSLs with Groovy - Paul Bowler


Groovy Frameworks

https://examples.javacodegeeks.com/core-java/spock-tutorial-beginners/Groovy Spock Tutorial for use case tests: given, when, then, so
https://gebish.org/Geb - web automation w WebDriver, JQuery, Objects
Gradle
https://docs.gradle.org/current/userguide/getting_started.htmlGradle Getting Started
https://gradle.org/guides/Gradle basics
https://docs.gradle.org/current/userguide/declaring_repositories.htmlGradle for builds
https://circleci.com/docs/2.0/language-java/CircleCi gradle builds
Libraries

Mavencentral for libraries

Github for libraries

JCenter for Java libs










...

Step-by-step guide for Example


GORM Shell Scripting needs transaction context

http://daviddawson.me/blog/2017/09/06/groovy-gorm-shell-script.html


Set a transaction context for a data source in GORM

Gorm has come along well and is pretty isolated from the surrounding Grails infrastructure now. All you need to do is to create a HibernateDatastore (or other) and pass in a config and your domain classes for initialisation. Then, you can start to use them as you do in Grails.

One rub is that there is no natural place to wrap a transactional Session around. This appears as a hiernate exception related to no session being present. This is something often not noticed in a grails app, as its all created automatically by Grails, and is also created by a full fat standalone Gorm app when you’re using services with any form of transactional annotation. Yet, you need a session to use hibernate, which the RDBMS version of Gorm uses.

The solution is to use the .withTransaction method added onto all grails domain classes. This creates a session and puts it into the thread context.

I did a light bit of syntax sugaring to hide that stuff and make things more readable, and its good to go!


Code Block
languagegroovy
titleGORM hibernate script


#!/usr/bin/env groovy

@Grapes([
        @Grab("org.grails:grails-datastore-gorm-hibernate5:6.1.4.RELEASE"),
        @Grab("com.h2database:h2:1.4.192"),
        @Grab("org.apache.tomcat:tomcat-jdbc:8.5.0"),
        @Grab("org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"),
        @Grab("org.slf4j:slf4j-api:1.7.10")
])
import grails.gorm.annotation.Entity
import org.grails.datastore.gorm.GormEntity
import org.grails.orm.hibernate.HibernateDatastore

// Create the domain classes you want
@Entity
class Person implements GormEntity<Person> {

    String firstName
    String lastName

    static mapping = {
        firstName blank: false
        lastName blank: false
    }
}

//Guts of the script, do your db stuff here with the power of Gorm
gormScript {
    new Person(firstName: 'Dave', lastName: 'Ronald').save()
    new Person(firstName: 'Jeff', lastName: 'Happy').save()
    new Person(firstName: 'Sergio', lastName: 'del Amo').save()
    new Person(firstName: 'Monica', lastName: 'Crazy').save()

    println "People = ${Person.count()}"

    def sergio = Person.findByFirstName("Sergio")

    println "Got ${sergio.firstName} ${sergio.lastName}"
}


def gormScript(Closure exec) {
    Map configuration = [
            'hibernate.hbm2ddl.auto':'create-drop',
            'dataSource.url':'jdbc:h2:mem:myDB'
    ]
    HibernateDatastore datastore = new HibernateDatastore( configuration, Person)

    Person.withTransaction {
        exec()
    }
}










Info


sample code block

Code Block
languagetext
titlesample code block
linenumberstrue
collapsetrue

...