This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +35
-42
lines changed
examples/grails-hibernate-groovy-proxy
grails-datastore-gorm-hibernate5
src/test/groovy/grails/gorm/tests/proxy Expand file tree Collapse file tree 9 files changed +35
-42
lines changed Original file line number Diff line number Diff line change 1- group " examples "
2-
3- dependencies {
4- implementation " org.yakworks:hibernate-groovy-proxy: $h ibernateGroovyProxy "
1+ plugins {
2+ id ' groovy '
3+ id ' org.grails.grails-web '
4+ }
55
6- implementation " org.springframework.boot:spring-boot-starter-logging"
7- implementation " org.springframework.boot:spring-boot-autoconfigure"
8- implementation " org.grails:grails-core"
9- implementation " org.grails:grails-dependencies" , {
10- exclude module :' grails-datastore-simple'
11- }
12- implementation " org.grails:grails-web-boot"
13- implementation project(" :grails-plugin" )
6+ version = rootProject. version
7+ group = ' examples'
148
15- implementation " org.hibernate:hibernate-core-jakarta: $h ibernateVersion "
9+ dependencies {
1610
17- runtimeOnly " com.h2database:h2 "
18- runtimeOnly " org.yaml:snakeyaml "
19- runtimeOnly " org.apache.tomcat:tomcat-jdbc "
11+ implementation project( ' :grails-plugin ' )
12+ implementation ' org.grails:grails-core '
13+ implementation " org.yakworks:hibernate-groovy-proxy: $y akworksHibernateGroovyProxyVersion "
2014
21- testImplementation " org.grails:grails-gorm-testing-support"
15+ runtimeOnly ' com.h2database:h2'
16+ runtimeOnly ' com.zaxxer:HikariCP'
17+ runtimeOnly ' org.springframework.boot:spring-boot-autoconfigure'
18+ runtimeOnly ' org.springframework.boot:spring-boot-starter-logging'
2219
23- }
20+ testImplementation ' org.grails:grails-testing-support'
21+ }
Original file line number Diff line number Diff line change 1+ info :
2+ app :
3+ name : ' @info.app.name@'
4+ version : ' @info.app.version@'
5+ grailsVersion : ' @info.app.grailsVersion@'
16---
27grails :
3- profile : web
4- codegen :
5- defaultPackage : datasources
6- info :
7- app :
8- name : ' @info.app.name@'
9- version : ' @info.app.version@'
10- grailsVersion : ' @info.app.grailsVersion@'
11- spring :
12- groovy :
13- template :
14- check-template-location : false
15- main :
16- allow-circular-references : true
17-
8+ profile : web
9+ codegen :
10+ defaultPackage : datasources
1811---
1912dataSource :
2013 pooled : true
21- jmxExport : true
2214 driverClassName : org.h2.Driver
2315 dbCreate : create-drop
2416 url : jdbc:h2:mem:books;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
Original file line number Diff line number Diff line change 77 <appender name =" STDOUT" class =" ch.qos.logback.core.ConsoleAppender" >
88 <encoder >
99 <charset >UTF-8</charset >
10- <pattern >' %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex' </pattern >
10+ <pattern >%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern >
1111 </encoder >
1212 </appender >
1313
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ class Customer implements Serializable {
99
1010 String name
1111
12+ @SuppressWarnings (' unused' )
13+ Customer () {
14+ // no-args constructor for proxying.
15+ // Usually added by ControllerDomainTransformer
16+ // from 'org.grails:grails-plugin-controllers'
17+ }
18+
1219 Customer (Long id , String name ) {
1320 this . id = id
1421 this . name = name
Original file line number Diff line number Diff line change @@ -3,10 +3,7 @@ package datasources
33import grails.boot.GrailsApp
44import grails.boot.config.GrailsAutoConfiguration
55import groovy.transform.CompileStatic
6- import org.springframework.boot.autoconfigure.EnableAutoConfiguration
7- import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
86
9- // @EnableAutoConfiguration(exclude = DataSourceTransactionManagerAutoConfiguration)
107@CompileStatic
118class Application extends GrailsAutoConfiguration {
129 static void main (String [] args ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import org.hibernate.Hibernate
44
55import grails.gorm.transactions.Rollback
66import grails.test.hibernate.HibernateSpec
7- import spock.lang.Ignore
87
98/**
109 * Tests Proxy with hibernate-groovy-proxy
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ groovydocGradlePluginVersion=1.0.1
1111groovyVersion =4.0.24-SNAPSHOT
1212hibernateVersion =5.6.15.Final
1313hibernateValidatorVersion =8.0.1.Final
14- hibernateGroovyProxy =1.1
14+ yakworksHibernateGroovyProxyVersion =1.1
1515jansiVersion =2.4.1
1616javaParserCoreVersion =3.26.2
1717junitJupiterVersion =5.11.3
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ dependencies {
4343 testImplementation " org.hibernate:hibernate-ehcache:$hibernateVersion "
4444
4545 // groovy proxy fixes bytebuddy to be a bit smarter when it comes to groovy metaClass
46- testImplementation " org.yakworks:hibernate-groovy-proxy:$h ibernateGroovyProxy "
46+ testImplementation " org.yakworks:hibernate-groovy-proxy:$y akworksHibernateGroovyProxyVersion "
4747
4848 testImplementation " org.apache.tomcat:tomcat-jdbc:$tomcatVersion "
4949 testRuntimeOnly " org.springframework:spring-aop"
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class ByteBuddyProxySpec extends GormDatastoreSpec {
1717 static HibernateProxyHandler proxyHandler = new HibernateProxyHandler ()
1818
1919 // to show test that fail that should succeed set this to true. or uncomment the
20- // testImplementation "org.yakworks:hibernate-groovy-proxy:$hibernateGroovyProxy " to see pass
20+ // testImplementation "org.yakworks:hibernate-groovy-proxy:$yakworksHibernateGroovyProxy " to see pass
2121 boolean runPending = ClassUtils . isPresent(" yakworks.hibernate.proxy.ByteBuddyGroovyInterceptor" )
2222
2323 @Override
You can’t perform that action at this time.
0 commit comments