Use switch for consistency
This commit is contained in:
parent
eb71ec395d
commit
a63d23f724
|
@ -22,16 +22,26 @@ public class InformixIdentityColumnSupport extends IdentityColumnSupportImpl {
|
||||||
@Override
|
@Override
|
||||||
public String getIdentitySelectString(String table, String column, int type)
|
public String getIdentitySelectString(String table, String column, int type)
|
||||||
throws MappingException {
|
throws MappingException {
|
||||||
return type == Types.BIGINT
|
switch (type) {
|
||||||
? "select dbinfo('serial8') from informix.systables where tabid=1"
|
case Types.BIGINT:
|
||||||
: "select dbinfo('sqlca.sqlerrd1') from informix.systables where tabid=1";
|
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
|
@Override
|
||||||
public String getIdentityColumnString(int type) throws MappingException {
|
public String getIdentityColumnString(int type) throws MappingException {
|
||||||
return type == Types.BIGINT ?
|
switch (type) {
|
||||||
"serial8 not null" :
|
case Types.BIGINT:
|
||||||
"serial not null";
|
return "serial8 not null";
|
||||||
|
case Types.INTEGER:
|
||||||
|
return "serial not null";
|
||||||
|
default:
|
||||||
|
throw new MappingException("illegal identity column type");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue