reindent code and linked #2514

This commit is contained in:
Roland Praml
2022-01-27 16:43:35 +01:00
parent 3e8cc87f01
commit 5b63434f13
3 changed files with 11 additions and 12 deletions
@@ -1,6 +1,5 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebean.config.dbplatform.DbPlatformType;
import io.ebean.config.dbplatform.DbType;
@@ -10,6 +9,7 @@ import java.sql.Types;
/**
* DB2 specific platform for i Series.
*
* @author Cédric Sougné
*/
public class DB2ForIPlatform extends BaseDB2Platform {
@@ -18,23 +18,22 @@ public class DB2ForIPlatform extends BaseDB2Platform {
super();
this.platform = Platform.DB2FORI;
// Note: IBM i from 7.1 allow up to to 128
// TODO: Check if we need to introduce older platform (DB2ForI_6 ? but older documentation is not anymore published on ibm.com),
// TODO: Check if we need to introduce older platform (DB2ForI_6 ? but older
// documentation is not anymore published on ibm.com),
this.maxTableNameLength = 128;
this.maxConstraintNameLength = 128;
this.dbIdentity.setSupportsIdentity(true);
this.exceptionTranslator =
new SqlErrorCodes()
.addAcquireLock("57033") // key -913
this.exceptionTranslator = new SqlErrorCodes().addAcquireLock("57033") // key -913
.addDuplicateKey("23505") // -803
// .addDataIntegrity("-407","-530","-531","-532","-543","-544","-545","-603","-667")
// we need SQLState, not code: https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/codes/src/tpc/db2z_n.html
.addDataIntegrity("23502","23503","23504","23507","23511","23512","23513","42917","23515")
// we need SQLState, not code:
// https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/codes/src/tpc/db2z_n.html
.addDataIntegrity("23502", "23503", "23504", "23507", "23511", "23512", "23513", "42917", "23515")
.build();
booleanDbType = Types.SMALLINT;
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("smallint default 0"));
}
}
}
@@ -106,7 +106,7 @@ public class DatabasePlatformFactory {
return new SqlAnywherePlatform();
}
if (dbName.equals("db2")) {
throw new IllegalArgumentException("Please choose the more specific db2luw/db2zos/db2fori platform. Refer to issue #xxxx for details");
throw new IllegalArgumentException("Please choose the more specific db2luw/db2zos/db2fori platform. Refer to issue #2514 for details");
}
if (dbName.equals("db2legacy")) {
return new DB2LegacyPlatform();
@@ -174,7 +174,7 @@ public class DatabasePlatformFactory {
} else if (dbProductName.contains("sqlite")) {
return new SQLitePlatform();
} else if (dbProductName.contains("db2")) {
throw new IllegalArgumentException("For DB2 please explicitly choose either db2legacy/db2luw/db2zos/db2fori platform. Refer to issue #xxxx for details");
throw new IllegalArgumentException("For DB2 please explicitly choose either db2legacy/db2luw/db2zos/db2fori platform. Refer to issue #2514 for details");
} else if (dbProductName.contains("sql anywhere")) {
return new SqlAnywherePlatform();
} else if (dbProductName.contains("hdb")) {
@@ -834,7 +834,7 @@ public class DefaultDbMigration implements DbMigration {
case SQLSERVER:
throw new IllegalArgumentException("Please choose the more specific SQLSERVER16 or SQLSERVER17 platform. Refer to issue #1340 for details");
case DB2:
logger.warn("Using DB2LegacyPlatform. It is recommended to migrate to db2luw/db2zos/db2fori. Refer to issue #xxxx for details");
logger.warn("Using DB2LegacyPlatform. It is recommended to migrate to db2luw/db2zos/db2fori. Refer to issue #2514 for details");
return new DB2LegacyPlatform();
case DB2LUW:
return new DB2LuwPlatform();