This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConstraintRegistrar { | |
static void registerConstraints() { | |
List<GrailsDomainClass> domainClasses = Holders.getGrailsApplication().getArtefacts("Domain") | |
domainClasses.each ConstraintRegistrar.®isterConstraints | |
} | |
static void registerConstraints(Class clazz) { | |
GrailsDomainClass domainClass = Holders.getGrailsApplication().getDomainClass(clazz.name) | |
registerConstraints(domainClass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|Loading Grails 2.3.4 | |
|Configuring classpath | |
. | |
|Environment set to development | |
... | |
|Obtaining dependency data... | |
.. | |
build - Dependencies for the build system only (total: 23) | |
+--- xalan:serializer:2.7.1 | |
+--- org.grails:grails-bootstrap:2.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cache: module revision found in cache: org.codehaus.griffon#swingxbuilder;0.3 | |
found org.codehaus.griffon#swingxbuilder;0.3 in cache | |
== resolving dependencies org.codehaus.griffon.internal#cracha-inteligente;0.1->org.codehaus.griffon#swingxbuilder;0.3 [compile->runtime] | |
== resolving dependencies org.codehaus.griffon.internal#cracha-inteligente;0.1->org.codehaus.griffon#swingxbuilder;0.3 [compile->compile] | |
excluding dependency: org.codehaus.groovy#groovy-all;1.8.8 {compile=[compile(*), master(*)], runtime=[runtime(*)]} in compile | |
== resolving dependencies org.codehaus.griffon#swingxbuilder;0.3->org.swinglabs#swing-worker;1.1 [compile->master(*)] | |
excluding dependency: org.codehaus.groovy#groovy-all;1.8.8 {compile=[compile(*), master(*)], runtime=[runtime(*)]} in compile | |
cache: Checking cache for: dependency: org.swinglabs#swing-worker;1.1 {compile=[compile(*), master(*)], runtime=[runtime(*)]} | |
cache: module revision found in cache: org.swinglabs#swing-worker;1.1 | |
found org.swinglabs#swing-worker;1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println grailsApplication.config.grails.databinding.useSpringBinder | |
Colaborador c = new Colaborador(nome: 'Sérgio Michels', dtAdmissao: '01/03/2007', dtNascimento: '11/10/1989', cpf: '020.234.920-92', matricula: 232040L) | |
c.validate() | |
println c.errors | |
Outputs: | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# A fatal error has been detected by the Java Runtime Environment: | |
# | |
# SIGSEGV (0xb) at pc=0x00007f1cf3693880, pid=4579, tid=139762827405056 | |
# | |
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18) | |
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops) | |
# Problematic frame: | |
# C 0x00007f1cf3693880 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error Error executing script MavenInstall: null | |
java.lang.StackOverflowError | |
at java.util.regex.Pattern$CharProperty$1.isSatisfiedBy(Pattern.java:3337) | |
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345) | |
at java.util.regex.Pattern$Branch.match(Pattern.java:4114) | |
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168) | |
at java.util.regex.Pattern$Loop.match(Pattern.java:4295) | |
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227) | |
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078) | |
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grails.util.GrailsNameUtils | |
includeTargets << grailsScript("_GrailsBootstrap") //https://github.com/grails/grails-core/blob/master/scripts/_GrailsBootstrap.groovy | |
includeTargets << grailsScript("_GrailsCreateArtifacts") //https://github.com/grails/grails-core/blob/master/scripts/_GrailsCreateArtifacts.groovy | |
target ('default': 'Validates if the argument is a domain class') { | |
depends(loadApp) | |
promptForName(type: type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController { | |
def grailsApplication | |
def index() { | |
def domainClass = grailsApplication.getDomainClass("package.DomainClassName") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grails.plugin.jodatime.Html5DateTimeFormat | |
import org.grails.databinding.converters.ValueConverter | |
import org.joda.time.DateTime | |
import org.joda.time.Instant | |
import org.joda.time.LocalDate | |
import org.joda.time.LocalDateTime | |
import org.joda.time.LocalTime | |
import org.joda.time.format.DateTimeFormat | |
import org.joda.time.format.DateTimeFormatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grails.plugin.spock.IntegrationSpec | |
import org.springframework.web.context.request.RequestContextHolder | |
class MyTestSpec extends IntegrationSpec { | |
/* Normally in your code you will use something like RequestContextUtils.getLocale(request) to get's the Locale to | |
* be used. Here we set the locale that will be returned by RCU to our tests. | |
*/ | |
def setup() { |
NewerOlder