diff --git a/NOTICE b/NOTICE index d859cc2c..feb9b84e 100644 --- a/NOTICE +++ b/NOTICE @@ -25,7 +25,7 @@ spring-projects/spring-data-commons https://github.com/spring-projects/spring-data-commons -Spring Data Commons 2.2 RC2 +Spring Data Commons 2.3.0.RELEASE Copyright (c) [2010-2019] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -71,7 +71,7 @@ spring-projects/spring-data-jdbc https://github.com/spring-projects/spring-data-jdbc -Spring Data JDBC 1.1 RC2 +Spring Data JDBC 2.0.0.RELEASE Copyright (c) [2017-2019] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). diff --git a/README.md b/README.md index d64fca7c..162c73d4 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,15 @@ buildscript { } } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.6.RELEASE") + classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE") } } dependencies { - implementation("com.navercorp.spring:spring-boot-starter-data-jdbc-plus-sql:2.0.0.RC2") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("com.navercorp.spring:spring-boot-starter-data-jdbc-plus-sql:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") } ``` @@ -51,22 +51,22 @@ dependencies { com.navercorp.spring spring-boot-starter-data-jdbc-plus-sql - 2.0.0.RC2 + 2.0.0.RELEASE org.springframework.data spring-data-jdbc - 2.0.0.RC2 + 2.0.0.RELEASE org.springframework.data spring-data-relational - 2.0.0.RC2 + 2.0.0.RELEASE org.springframework.data spring-data-commons - 2.3.0.RC2 + 2.3.0.RELEASE ``` diff --git a/build.gradle b/build.gradle index e7c47c46..c825a93c 100644 --- a/build.gradle +++ b/build.gradle @@ -9,13 +9,13 @@ buildscript { } } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.6.RELEASE") + classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE") } } allprojects { group = "com.navercorp.spring" - version = "2.0.0.RC3-SNAPSHOT" + version = "2.0.0.RELEASE" } subprojects { diff --git a/guide-projects/plus-repository-guide/build.gradle b/guide-projects/plus-repository-guide/build.gradle index f74054f8..3949d413 100644 --- a/guide-projects/plus-repository-guide/build.gradle +++ b/guide-projects/plus-repository-guide/build.gradle @@ -5,9 +5,9 @@ dependencies { implementation("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") testImplementation("org.springframework.boot:spring-boot-starter-test") { exclude group: "org.junit.vintage", module: "junit-vintage-engine" diff --git a/guide-projects/plus-sql-java-groovy-guide/build.gradle b/guide-projects/plus-sql-java-groovy-guide/build.gradle index 71a9cbb7..75d5d890 100644 --- a/guide-projects/plus-sql-java-groovy-guide/build.gradle +++ b/guide-projects/plus-sql-java-groovy-guide/build.gradle @@ -43,15 +43,15 @@ dependencies { implementation("org.codehaus.groovy:groovy:2.5.8") implementation("com.h2database:h2") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") implementation project(":spring-data-plus-sql-gen") annotationProcessor project(":spring-data-plus-sql-gen") - annotationProcessor("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - annotationProcessor("org.springframework.data:spring-data-relational:2.0.0.RC2") - annotationProcessor("org.springframework.data:spring-data-commons:2.3.0.RC2") + annotationProcessor("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + annotationProcessor("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + annotationProcessor("org.springframework.data:spring-data-commons:2.3.0.RELEASE") compileOnly("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") diff --git a/guide-projects/plus-sql-java-kotlin-guide/build.gradle b/guide-projects/plus-sql-java-kotlin-guide/build.gradle index 37ca779f..9d6568a2 100644 --- a/guide-projects/plus-sql-java-kotlin-guide/build.gradle +++ b/guide-projects/plus-sql-java-kotlin-guide/build.gradle @@ -37,9 +37,9 @@ dependencies { implementation("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") testImplementation("org.springframework.boot:spring-boot-starter-test") { exclude group: "org.junit.vintage", module: "junit-vintage-engine" diff --git a/guide-projects/plus-sql-kotlin-guide/build.gradle.kts b/guide-projects/plus-sql-kotlin-guide/build.gradle.kts index f4fa966e..f1e0cd1c 100644 --- a/guide-projects/plus-sql-kotlin-guide/build.gradle.kts +++ b/guide-projects/plus-sql-kotlin-guide/build.gradle.kts @@ -27,9 +27,9 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("com.h2database:h2") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") testImplementation("org.springframework.boot:spring-boot-starter-test") { exclude(group = "org.junit.vintage", module = "junit-vintage-engine") diff --git a/spring-boot-autoconfigure-data-jdbc-plus/build.gradle b/spring-boot-autoconfigure-data-jdbc-plus/build.gradle index 7b107aa5..3cef5cc5 100644 --- a/spring-boot-autoconfigure-data-jdbc-plus/build.gradle +++ b/spring-boot-autoconfigure-data-jdbc-plus/build.gradle @@ -5,9 +5,9 @@ dependencies { implementation project(":spring-data-jdbc-plus-sql") implementation project(":spring-data-jdbc-plus-repository") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") implementation("io.projectreactor:reactor-core") testImplementation("org.junit.jupiter:junit-jupiter") diff --git a/spring-boot-starter-data-jdbc-plus-repository/build.gradle b/spring-boot-starter-data-jdbc-plus-repository/build.gradle index bc845afb..7bc7dd2b 100644 --- a/spring-boot-starter-data-jdbc-plus-repository/build.gradle +++ b/spring-boot-starter-data-jdbc-plus-repository/build.gradle @@ -3,7 +3,7 @@ dependencies { compile(project(":spring-data-jdbc-plus-repository")) compile("org.springframework.boot:spring-boot-starter-jdbc") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") } diff --git a/spring-boot-starter-data-jdbc-plus-sql/build.gradle b/spring-boot-starter-data-jdbc-plus-sql/build.gradle index 2c5e70b7..97bec09b 100644 --- a/spring-boot-starter-data-jdbc-plus-sql/build.gradle +++ b/spring-boot-starter-data-jdbc-plus-sql/build.gradle @@ -3,7 +3,7 @@ dependencies { compile(project(":spring-data-jdbc-plus-sql")) compile("org.springframework.boot:spring-boot-starter-jdbc") - implementation("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - implementation("org.springframework.data:spring-data-relational:2.0.0.RC2") - implementation("org.springframework.data:spring-data-commons:2.3.0.RC2") + implementation("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + implementation("org.springframework.data:spring-data-commons:2.3.0.RELEASE") } diff --git a/spring-data-jdbc-plus-repository/build.gradle b/spring-data-jdbc-plus-repository/build.gradle index d6260e70..59f5ed8e 100644 --- a/spring-data-jdbc-plus-repository/build.gradle +++ b/spring-data-jdbc-plus-repository/build.gradle @@ -1,9 +1,9 @@ compileJava.dependsOn(processResources) dependencies { - compile("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - compile("org.springframework.data:spring-data-relational:2.0.0.RC2") - compile("org.springframework.data:spring-data-commons:2.3.0.RC2") + compile("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + compile("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + compile("org.springframework.data:spring-data-commons:2.3.0.RELEASE") testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter-api") diff --git a/spring-data-jdbc-plus-sql/build.gradle b/spring-data-jdbc-plus-sql/build.gradle index 7ac1c2c9..78a456ef 100644 --- a/spring-data-jdbc-plus-sql/build.gradle +++ b/spring-data-jdbc-plus-sql/build.gradle @@ -2,9 +2,9 @@ compileJava.dependsOn(processResources) dependencies { compile project(":spring-jdbc-plus-support") - compile("org.springframework.data:spring-data-jdbc:2.0.0.RC2") - compile("org.springframework.data:spring-data-relational:2.0.0.RC2") - compile("org.springframework.data:spring-data-commons:2.3.0.RC2") + compile("org.springframework.data:spring-data-jdbc:2.0.0.RELEASE") + compile("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + compile("org.springframework.data:spring-data-commons:2.3.0.RELEASE") implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.70") implementation("org.jetbrains.kotlin:kotlin-reflect:1.3.70") implementation("io.projectreactor:reactor-core") diff --git a/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/SqlGenerator.java b/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/SqlGenerator.java index 5713e025..a0e19e24 100644 --- a/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/SqlGenerator.java +++ b/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/SqlGenerator.java @@ -56,9 +56,11 @@ import org.springframework.data.relational.core.sql.DeleteBuilder; import org.springframework.data.relational.core.sql.Expression; import org.springframework.data.relational.core.sql.Expressions; +import org.springframework.data.relational.core.sql.From; import org.springframework.data.relational.core.sql.Functions; import org.springframework.data.relational.core.sql.Insert; import org.springframework.data.relational.core.sql.InsertBuilder; +import org.springframework.data.relational.core.sql.LockMode; import org.springframework.data.relational.core.sql.OrderByField; import org.springframework.data.relational.core.sql.SQL; import org.springframework.data.relational.core.sql.Select; @@ -1040,7 +1042,8 @@ Set getUpdateableColumns() { } /** - * DIFF + * DIFF: org.springframework.data.relational.core.sql.DefaultSelect + * Only support Select columns for selectColumns */ class SimpleSelect implements Select { @@ -1064,6 +1067,11 @@ public void visit(Visitor visitor) { visitor.leave(this); } + @Override + public From getFrom() { + throw new UnsupportedOperationException("SimpleSelect does not support from clause."); + } + @Override public List getOrderBy() { return Collections.emptyList(); @@ -1083,5 +1091,10 @@ public OptionalLong getOffset() { public boolean isDistinct() { return false; } + + @Override + public LockMode getLockMode() { + return null; + } } } diff --git a/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AnsiDialect.java b/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AnsiDialect.java index 992525f6..6a2bb77c 100644 --- a/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AnsiDialect.java +++ b/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AnsiDialect.java @@ -3,7 +3,9 @@ import org.springframework.data.relational.core.dialect.AbstractDialect; import org.springframework.data.relational.core.dialect.ArrayColumns; import org.springframework.data.relational.core.dialect.LimitClause; +import org.springframework.data.relational.core.dialect.LockClause; import org.springframework.data.relational.core.sql.IdentifierProcessing; +import org.springframework.data.relational.core.sql.LockOptions; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -18,6 +20,9 @@ public class AnsiDialect extends AbstractDialect { * Singleton instance. */ public static final AnsiDialect INSTANCE = new AnsiDialect(); + + protected AnsiDialect() {} + private static final LimitClause LIMIT_CLAUSE = new LimitClause() { /* @@ -56,10 +61,29 @@ public Position getClausePosition() { return Position.AFTER_ORDER_BY; } }; - private final AnsiArrayColumns arrayColumns = new AnsiArrayColumns(); - protected AnsiDialect() { - } + static final LockClause LOCK_CLAUSE = new LockClause() { + + /* + * (non-Javadoc) + * @see org.springframework.data.relational.core.dialect.LockClause#getLock(LockOptions) + */ + @Override + public String getLock(LockOptions lockOptions) { + return "FOR UPDATE"; + } + + /* + * (non-Javadoc) + * @see org.springframework.data.relational.core.dialect.LimitClause#getClausePosition() + */ + @Override + public Position getClausePosition() { + return Position.AFTER_ORDER_BY; + } + }; + + private final AnsiArrayColumns ARRAY_COLUMNS = new AnsiArrayColumns(); /* * (non-Javadoc) @@ -72,16 +96,20 @@ public LimitClause limit() { /* * (non-Javadoc) - * @see org.springframework.data.relational.core.dialect.Dialect#getArraySupport() + * @see org.springframework.data.relational.core.dialect.Dialect#lock() */ @Override - public ArrayColumns getArraySupport() { - return arrayColumns; + public LockClause lock() { + return LOCK_CLAUSE; } + /* + * (non-Javadoc) + * @see org.springframework.data.relational.core.dialect.Dialect#getArraySupport() + */ @Override - public IdentifierProcessing getIdentifierProcessing() { - return IdentifierProcessing.ANSI; + public ArrayColumns getArraySupport() { + return ARRAY_COLUMNS; } static class AnsiArrayColumns implements ArrayColumns { @@ -107,4 +135,9 @@ public Class getArrayType(Class userType) { return ClassUtils.resolvePrimitiveIfNecessary(userType); } } + + @Override + public IdentifierProcessing getIdentifierProcessing() { + return IdentifierProcessing.ANSI; + } } diff --git a/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/NonQuotingDialect.java b/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/NonQuotingDialect.java index 70df46a5..d77b510a 100644 --- a/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/NonQuotingDialect.java +++ b/spring-data-jdbc-plus-sql/src/test/java/com/navercorp/spring/data/jdbc/plus/sql/convert/NonQuotingDialect.java @@ -4,6 +4,7 @@ import org.springframework.data.relational.core.dialect.Dialect; import org.springframework.data.relational.core.dialect.HsqlDbDialect; import org.springframework.data.relational.core.dialect.LimitClause; +import org.springframework.data.relational.core.dialect.LockClause; import org.springframework.data.relational.core.sql.IdentifierProcessing; /** @@ -22,10 +23,13 @@ public LimitClause limit() { return HsqlDbDialect.INSTANCE.limit(); } + @Override + public LockClause lock() { + return HsqlDbDialect.INSTANCE.lock(); + } + @Override public IdentifierProcessing getIdentifierProcessing() { - return IdentifierProcessing.create( - new IdentifierProcessing.Quoting(""), - IdentifierProcessing.LetterCasing.AS_IS); + return IdentifierProcessing.create(new IdentifierProcessing.Quoting(""), IdentifierProcessing.LetterCasing.AS_IS); } } diff --git a/spring-data-plus-sql-gen/build.gradle b/spring-data-plus-sql-gen/build.gradle index 42df7f66..d2bb8b40 100644 --- a/spring-data-plus-sql-gen/build.gradle +++ b/spring-data-plus-sql-gen/build.gradle @@ -1,6 +1,6 @@ dependencies { - compile("org.springframework.data:spring-data-relational:2.0.0.RC2") - compile("org.springframework.data:spring-data-commons:2.3.0.RC2") + compile("org.springframework.data:spring-data-relational:2.0.0.RELEASE") + compile("org.springframework.data:spring-data-commons:2.3.0.RELEASE") compile project(":spring-data-jdbc-plus-sql") compile("com.squareup:javapoet:1.12.1")