This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch jpa-with-extensions in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git
commit d8594f5dfab848d7042795c5fd612d655dbe5f27 Author: Dan Haywood <[email protected]> AuthorDate: Sun Aug 21 17:23:55 2022 +0100 changes h2 config, ignore case; add p6spy logging. --- .../java/domainapp/modules/simple/dom/so/SimpleObject.java | 4 ++-- webapp/pom.xml | 6 ++++++ webapp/src/main/resources/config/application.properties | 10 +++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java index 7c61b9e..6d5bd43 100644 --- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java +++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java @@ -53,7 +53,7 @@ import domainapp.modules.simple.types.Notes; @Table( schema= SimpleModule.SCHEMA, uniqueConstraints = { - @UniqueConstraint(name = "SimpleObject__name__UNQ", columnNames = {"NAME"}) + @UniqueConstraint(name = "SimpleObject__name__UNQ", columnNames = {"name"}) } ) @NamedQueries({ @@ -101,7 +101,7 @@ public class SimpleObject implements Comparable<SimpleObject> { @Title @Name - @Column(length = Name.MAX_LEN, nullable = false) + @Column(length = Name.MAX_LEN, nullable = false, name = "name") @Getter @Setter @ToString.Include @PropertyLayout(fieldSetId = LayoutConstants.FieldSetId.IDENTITY, sequence = "1") private String name; diff --git a/webapp/pom.xml b/webapp/pom.xml index 7bf3d96..c75235d 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -113,6 +113,12 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> + + <dependency> + <groupId>com.github.gavlyukovskiy</groupId> + <artifactId>p6spy-spring-boot-starter</artifactId> + <version>1.8.0</version> + </dependency> </dependencies> <profiles> diff --git a/webapp/src/main/resources/config/application.properties b/webapp/src/main/resources/config/application.properties index 8a7dcce..d516a75 100644 --- a/webapp/src/main/resources/config/application.properties +++ b/webapp/src/main/resources/config/application.properties @@ -11,7 +11,7 @@ spring.flyway.enabled=false spring.sql.init.platform=h2 -spring.datasource.url=jdbc:h2:mem:simple;DATABASE_TO_UPPER=false +spring.datasource.url=jdbc:h2:mem:simple;DATABASE_TO_UPPER=false;IGNORECASE=TRUE spring.datasource.driver-class-name=org.h2.Driver isis.persistence.schema.create-schema-sql-template=CREATE SCHEMA IF NOT EXISTS %s @@ -29,3 +29,11 @@ eclipselink.jpa.upper-case-column-names=false #isis.testing.fixtures.initial-script = domainapp.webapp.application.fixture.scenarios.DomainAppDemo +# Register P6LogFactory to log JDBC events +decorator.datasource.p6spy.enable-logging=true + +# Use com.p6spy.engine.spy.appender.MultiLineFormat instead of com.p6spy.engine.spy.appender.SingleLineFormat +decorator.datasource.p6spy.multiline=true + +# Use logging for default listeners [slf4j, sysout, file, custom] +decorator.datasource.p6spy.logging=sysout
