From a63d23f724ebc8feac03e07d09654f1d768acec4 Mon Sep 17 00:00:00 2001 From: gavinking Date: Thu, 30 Jan 2020 15:23:17 +0100 Subject: [PATCH] Use switch for consistency --- .../InformixIdentityColumnSupport.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/identity/InformixIdentityColumnSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/identity/InformixIdentityColumnSupport.java index 1b75f32223..046461bed2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/identity/InformixIdentityColumnSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/identity/InformixIdentityColumnSupport.java @@ -22,16 +22,26 @@ public class InformixIdentityColumnSupport extends IdentityColumnSupportImpl { @Override public String getIdentitySelectString(String table, String column, int type) throws MappingException { - return type == Types.BIGINT - ? "select dbinfo('serial8') from informix.systables where tabid=1" - : "select dbinfo('sqlca.sqlerrd1') from informix.systables where tabid=1"; + switch (type) { + case Types.BIGINT: + return "select dbinfo('serial8') from informix.systables where tabid=1"; + case Types.INTEGER: + return "select dbinfo('sqlca.sqlerrd1') from informix.systables where tabid=1"; + default: + throw new MappingException("illegal identity column type"); + } } @Override public String getIdentityColumnString(int type) throws MappingException { - return type == Types.BIGINT ? - "serial8 not null" : - "serial not null"; + switch (type) { + case Types.BIGINT: + return "serial8 not null"; + case Types.INTEGER: + return "serial not null"; + default: + throw new MappingException("illegal identity column type"); + } } @Override