@Override public Type getJavaType(Column column) { final String type = column.getDatabaseType(); switch (type) { case "java.lang.Byte" : return byte.class; case "java.lang.Short" : return short.class; case "java.lang.Integer" : return int.class; case "java.lang.Long" : return long.class; case "java.lang.Float" : return float.class; case "java.lang.Double" : return double.class; case "java.lang.Boolean" : return boolean.class; case "java.lang.Character" : return char.class; default : throw new UnsupportedOperationException( "Type " + type + " is not a wrapper for a primitive type." ); } }
private boolean isCastingRequired(Column column, String getterName) { return ("getObject".equals(getterName) && !Object.class.getName().equals(column.getDatabaseType())); }
.filter(c -> c.getId().equals(column.getId())) .filter(c -> c.getDatabaseType().equals(column.getDatabaseType()))
file.add(Import.of(SimpleType.create(c.getDatabaseType()))); sb.append("(").append(shortName(c.getDatabaseType())).append(") "); } else { if (isCastingRequired(c, getterName)) { file.add(Import.of(SimpleType.create(c.getDatabaseType()))); sb.append("(").append(shortName(c.getDatabaseType())).append(") ");
ImmutableColumn(ImmutableTable parent, Map<String, Object> data) { super(parent, data); final Column prototype = new ColumnImpl(parent, data); this.enabled = prototype.isEnabled(); this.id = prototype.getId(); this.name = prototype.getName(); this.alias = prototype.getAlias(); this.nullable = prototype.isNullable(); this.nullableImplementation = prototype.getNullableImplementation(); this.autoincrement = prototype.isAutoIncrement(); this.typeMapper = prototype.getTypeMapper(); this.databaseType = prototype.getDatabaseType(); this.databaseTypeObject = prototype.findDatabaseType(); this.enumConstants = prototype.getEnumConstants(); this.decimalDigits = prototype.getDecimalDigits(); this.columnSize = prototype.getColumnSize(); this.ordinalPosition = prototype.getOrdinalPosition(); }
final Type databaseType = SimpleType.create(column.getDatabaseType()); final TypeMapper.Category category = tm.getJavaTypeCategory(column);
private boolean isCastingRequired(Column column, String getterName) { return ("getObject".equals(getterName) && !Object.class.getName().equals(column.getDatabaseType())); }
file.add(Import.of(SimpleType.create(c.getDatabaseType()))); sb.append("(").append(shortName(c.getDatabaseType())).append(") "); } else { if (isCastingRequired(c, getterName)) { file.add(Import.of(SimpleType.create(c.getDatabaseType()))); sb.append("(").append(shortName(c.getDatabaseType())).append(") ");
final Type databaseType = SimpleType.create(column.getDatabaseType()); final TypeMapper.Category category = tm.getJavaTypeCategory(column);