This file contains hidden or 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
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentDateMidnight, class: org.joda.time.DateMidnight | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentDateTime, class: org.joda.time.DateTime | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentDateTimeZoneAsString, class: org.joda.time.DateTimeZone | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentDurationAsString, class: org.joda.time.Duration | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentInstantAsMillisLong, class: org.joda.time.Instant | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentInterval, class: org.joda.time.Interval | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentLocalDate, class: org.joda.time.LocalDate | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime, class: org.joda.time.LocalDateTime | |
| 'user-type' type: org.jadira.usertype.dateandtime.joda.PersistentLocalTime, class: org.joda.time.LocalTime | |
| 'user-type' type: org.j |
This file contains hidden or 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 org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService | |
| import org.springframework.security.core.userdetails.UserDetails | |
| import org.springframework.security.core.userdetails.UsernameNotFoundException | |
| import User | |
| class CustomUserDetailsService implements GrailsUserDetailsService { | |
| //this creates a List of GrantedAuthorityImpl | |
| MyAuthoritiesBuilder myAuthoritiesBuilder | |
This file contains hidden or 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
| //activate or deactivate the plugin | |
| grails.plugins.springsecurity.ldap.active=true | |
| if(grails.plugins.springsecurity.ldap.active) { | |
| // specify this when you want to skip attempting to load from db and only use LDAP | |
| grails.plugins.springsecurity.providerNames = ['ldapAuthProvider', 'anonymousAuthenticationProvider'] | |
| } |
This file contains hidden or 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
| package com.wordpress.sergiosmind.command | |
| import grails.validation.Validateable; | |
| import groovy.transform.ToString; | |
| @Validateable | |
| @ToString | |
| class PasswordChangeCommand { | |
| //dependency injection for SpringSecurityService | |
| def springSecurityService | |
This file contains hidden or 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
| def sql = new Sql(dataSource) | |
| def tables =["myTable1", "myTable2"] | |
| tables.each {tab -> | |
| sql.execute("truncate table ${tab}".toString()) //works! | |
| } |
This file contains hidden or 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
| def sql = new Sql(dataSource) | |
| def tables =["myTable1", "myTable2"] | |
| tables.each {tab -> | |
| sql.execute("truncate table ${tab}") //ORA-00903 here | |
| } |
This file contains hidden or 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
| //this will throw ClassNotFoundException | |
| Class clazz = Class.forName(className) | |
| //but this will load the class with success | |
| Class clazz = Class.forName(className, true, Thread.currentThread().contextClassLoader) |
This file contains hidden or 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 CompositeDomainClass implements Serializable { | |
| //this is part of the pk | |
| MyOtherDomainClass otherDomainClass | |
| //other fields here... | |
| //and we try to map this | |
| static mapping { | |
| table 'composite_table' | |
| //id composite: ['id','otherDomainClass'], column: 'my_code_field' | |
| id composite: ['id','otherDomainClass'] | |
| columns { |
This file contains hidden or 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 CompositeDomainClass implements Serializable { | |
| //this is part of the pk | |
| MyOtherDomainClass otherDomainClass | |
| //other fields here... | |
| //and we try to map this | |
| static mapping { | |
| table 'composite_table' | |
| id composite: ['id','otherDomainClass'], column: 'my_code_field' | |
| otherDomainClass(column: 'other_table_id') | |
| } |
This file contains hidden or 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 MyExtendedTagLib { | |
| static namespace = "my" | |
| def grailsApplication | |
| def input = {attrs, body -> | |
| //some custom logic that changes attrs here... | |
| //get the original TagLib, must be the complete path | |
| def myTagLib = grailsApplication.mainContext.getBean("packages.MyTagLib") |