@Test public void testIsUnsignedColumnMetadataMysqlNativeType() { try { assertTrue("Bit native type should return true", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.BIT))); assertFalse("Signed varchar should return false", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.VARCHAR))); assertFalse("Signed date should return false", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.DATE))); MysqlType[] mysqlTypes = { MysqlType.TINYINT, MysqlType.SMALLINT, MysqlType.INT, MysqlType.BIGINT, MysqlType.FLOAT, MysqlType.DOUBLE, MysqlType.DECIMAL, }; for (MysqlType mysqlType : mysqlTypes) { ColumnMetadata cm = new ColumnMetadata(); assertFalse(mysqlType.toString() + " should return false", MysqlNativeTypeUtils.isUnsigned(cm, new MysqlNativeType(MysqlType.INT))); cm.setUnsigned(true); assertTrue(mysqlType.toString() + " should return true", MysqlNativeTypeUtils.isUnsigned(cm, new MysqlNativeType(MysqlType.INT))); } } catch (Exception e) { failWithStackTrace(e); } }
public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); }
MysqlNativeTypeUtils { public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); } }
MysqlNativeTypeUtils { public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); } private  MysqlNativeTypeUtils(); }
MysqlNativeTypeUtils { public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); } private  MysqlNativeTypeUtils(); static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType); static boolean isUnsigned(ColumnMetadata columnMetadata); }
MysqlNativeTypeUtils { public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); } private  MysqlNativeTypeUtils(); static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType); static boolean isUnsigned(ColumnMetadata columnMetadata);  }