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
| 10:49:18.118 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 934ms. Server Running: http://localhost:8080 |
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 codes.recursive.gorm.atp.controller | |
| import groovy.transform.CompileStatic | |
| import io.micronaut.http.annotation.Controller | |
| import io.micronaut.http.annotation.Get | |
| import io.micronaut.http.HttpStatus | |
| @CompileStatic | |
| @Controller("/person") | |
| class PersonController { |
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
| task myRun(type: JavaExec){ | |
| classpath sourceSets.main.runtimeClasspath | |
| main = mainClassName | |
| systemProperties = System.properties | |
| } |
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
| -Doracle.net.tns_admin="/path/to/atp/wallet" | |
| -Djavax.net.ssl.trustStore="/path/to/atp/wallet/truststore.jks" | |
| -Djavax.net.ssl.trustStorePassword="[wallet truststore password]" | |
| -Djavax.net.ssl.keyStore="/path/to/atp/wallet/keystore.jks" | |
| -Djavax.net.ssl.keyStorePassword="[wallet keystore password]" | |
| -Doracle.net.ssl_server_dn_match=true | |
| -Doracle.net.ssl_version="1.2" | |
| -DdataSource.username=user | |
| -DdataSource.password=L33THax0r!!!!~@@~ |
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
| dependencies { | |
| compile 'io.micronaut.configuration:micronaut-hibernate-gorm' | |
| compile group: 'com.oracle.ojdbc', name: 'ojdbc8', version: '19.3.0.0' | |
| compile "io.micronaut:micronaut-http-client" | |
| compile "io.micronaut:micronaut-http-server-netty" | |
| compile "io.micronaut:micronaut-runtime-groovy" | |
| compile "io.micronaut:micronaut-validation" | |
| compileOnly "io.micronaut:micronaut-inject-groovy" | |
| runtime "ch.qos.logback:logback-classic:1.2.3" |
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
| micronaut: | |
| application: | |
| name: demo | |
| dataSource: | |
| pooled: true | |
| dbCreate: validate | |
| url: jdbc:oracle:thin:@barnevents_low?TNS_ADMIN=/path/to/atp/wallet | |
| driverClassName: oracle.jdbc.driver.OracleDriver | |
| hibernate: | |
| dialect: org.hibernate.dialect.Oracle12cDialect |
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 codes.recursive.gorm.atp.model | |
| import grails.gorm.annotation.Entity | |
| import groovy.transform.CompileStatic | |
| import javax.validation.constraints.NotNull | |
| import javax.validation.constraints.Size | |
| @CompileStatic | |
| @Entity |
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 codes.recursive.gorm.atp.service | |
| import codes.recursive.gorm.atp.model.Person | |
| import grails.gorm.services.Service | |
| import groovy.transform.CompileStatic | |
| import javax.validation.constraints.NotNull | |
| @CompileStatic | |
| @Service(Person) |
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
| @Inject PersonService personService |
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
| @Post("/save") | |
| HttpResponse<Map> savePerson(@Body Person person) { | |
| try { | |
| return HttpResponse.ok( [ person: personService.save(person) ] as Map ) | |
| } | |
| catch(ValidationException e) { | |
| return HttpResponse.unprocessableEntity().body( | |
| [ | |
| person: person, | |
| errors: e.errors.allErrors.collect { |