Merge remote-tracking branch 'upstream/master' into ebean-new

# Conflicts:
#	ebean-api/pom.xml
#	ebean-api/src/main/java/io/ebean/config/dbplatform/db2/DB2Platform.java
#	ebean-autotune/pom.xml
#	ebean-bom/pom.xml
#	ebean-core-type/pom.xml
#	ebean-core/pom.xml
#	ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeManager.java
#	ebean-ddl-generator/pom.xml
#	ebean-externalmapping-api/pom.xml
#	ebean-externalmapping-xml/pom.xml
#	ebean-postgis/pom.xml
#	ebean-querybean/pom.xml
#	ebean-redis/pom.xml
#	ebean-test/pom.xml
#	ebean-test/src/test/resources/ebean.properties
#	ebean-test/testconfig/ebean-mariadb-10.3.properties
#	ebean-test/testconfig/ebean-mariadb.properties
#	ebean-test/testconfig/ebean-mysql.properties
#	ebean-test/testconfig/ebean-sqlserver17.properties
#	ebean/pom.xml
#	kotlin-querybean-generator/pom.xml
#	pom.xml
#	querybean-generator/pom.xml
This commit is contained in:
Roland Praml
2021-12-17 08:27:59 +01:00
96 changed files with 3220 additions and 190 deletions
@@ -2,6 +2,8 @@ package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@@ -127,6 +129,13 @@ public interface DtoQuery<T> extends CancelableQuery {
*/
DtoQuery<T> setParameter(String name, Object value);
/**
* Bind the named multi-value array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
*/
DtoQuery<T> setArrayParameter(String name, Collection<?> values);
/**
* Bind the parameter by its index position (1 based like JDBC).
*/
@@ -1,5 +1,7 @@
package io.ebean;
import java.util.Collection;
/**
* A SqlUpdate for executing insert update or delete statements.
* <p>
@@ -324,6 +326,13 @@ public interface SqlUpdate {
*/
SqlUpdate setParameter(String name, Object param);
/**
* Bind the named multi-value array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
*/
SqlUpdate setArrayParameter(String name, Collection<?> values);
/**
* Set a named parameter that has a null value. Exactly the same as
* {@link #setNullParameter(String, int)}.
@@ -396,7 +396,7 @@ public class PlatformConfig {
BINARY(false, true, false),
/**
* Store using DB BINARY(16).
* Store using DB BINARY(16) with optimized packing.
*/
BINARY_OPTIMIZED(false, true, true);
@@ -22,8 +22,8 @@ public class DB2Platform extends DatabasePlatform {
this.platform = Platform.DB2;
// Note: DB2 (at least LUW supports length up to 128)
// TOOD: Check if we need to introduce a new platform (DB2_LUW_11 ?)
this.maxTableNameLength = 128;
this.maxConstraintNameLength = 128;
this.maxTableNameLength = 18;
this.maxConstraintNameLength = 18;
this.truncateTable = "truncate table %s reuse storage ignore delete triggers immediate";
this.sqlLimiter = new Db2SqlLimiter();
@@ -24,6 +24,7 @@ public class SQLitePlatform extends DatabasePlatform {
this.dbDefaultValue.setFalse("0");
this.dbDefaultValue.setTrue("1");
this.dbDefaultValue.setNow("CURRENT_TIMESTAMP");
this.supportsResultSetConcurrencyModeUpdatable = false;
dbTypeMap.put(DbType.BIT, new DbPlatformType("int"));
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("int"));
@@ -43,6 +43,12 @@ public interface BeanPersistRequest<T> {
return transaction();
}
/**
* Return true if this request is due to cascading persist.
* False implies this is a "top level" request.
*/
boolean isCascade();
/**
* For an update or delete of a partially populated bean this is the set of
* loaded properties and otherwise returns null.