diff --git a/querydsl-sql/src/main/java/com/mysema/query/sql/Configuration.java b/querydsl-sql/src/main/java/com/mysema/query/sql/Configuration.java index 6d8c68e11..cbc7eb7de 100644 --- a/querydsl-sql/src/main/java/com/mysema/query/sql/Configuration.java +++ b/querydsl-sql/src/main/java/com/mysema/query/sql/Configuration.java @@ -100,34 +100,33 @@ public class Configuration { } /** - * Register the given Type + * Register the given Type to be used * * @param type */ - public void register(Type type) { + public void registerCustomType(Type type) { javaTypeMapping.register(type); } - - /** - * Set the java type for the given JDBC type - * - * @param jdbcType - * @param javaType - */ - public void setType(int jdbcType, Class javaType) { - jdbcTypeMapping.register(jdbcType, javaType); - } /** - * Set the java type for the given table and column + * Register the given Type for the given table and column * * @param table * @param column * @param type */ - public void setType(String table, String column, Type type) { + public void registerCustomType(String table, String column, Type type) { javaTypeMapping.setType(table, column, type); } + /** + * Set the given java type to be used for the given JDBC type + * + * @param jdbcType + * @param javaType + */ + public void setJavaType(int jdbcType, Class javaType) { + jdbcTypeMapping.register(jdbcType, javaType); + } } diff --git a/querydsl-sql/src/test/java/com/mysema/query/sql/ConfigurationTest.java b/querydsl-sql/src/test/java/com/mysema/query/sql/ConfigurationTest.java index ef29a9dfc..d155b7288 100644 --- a/querydsl-sql/src/test/java/com/mysema/query/sql/ConfigurationTest.java +++ b/querydsl-sql/src/test/java/com/mysema/query/sql/ConfigurationTest.java @@ -22,18 +22,18 @@ public class ConfigurationTest { @Test public void Various(){ Configuration configuration = new Configuration(new H2Templates()); - configuration.setType(Types.DATE, java.util.Date.class); - configuration.setType("person", "secureId", new EncryptedString()); - configuration.setType("person", "gender", new EnumByNameType(Gender.class)); - configuration.register(new StringType()); + configuration.setJavaType(Types.DATE, java.util.Date.class); + configuration.registerCustomType("person", "secureId", new EncryptedString()); + configuration.registerCustomType("person", "gender", new EnumByNameType(Gender.class)); + configuration.registerCustomType(new StringType()); assertEquals(Gender.class, configuration.getJavaType(java.sql.Types.VARCHAR, "person", "gender")); } @Test public void Custom_Type(){ Configuration configuration = new Configuration(new H2Templates()); - configuration.setType(Types.BLOB, InputStream.class); - configuration.register(new InputStreamType()); + configuration.setJavaType(Types.BLOB, InputStream.class); + configuration.registerCustomType(new InputStreamType()); assertEquals(InputStream.class, configuration.getJavaType(Types.BLOB, "", "")); } diff --git a/querydsl-sql/src/test/java/com/mysema/query/sql/CustomTypesTest.java b/querydsl-sql/src/test/java/com/mysema/query/sql/CustomTypesTest.java index 50cbd7944..c66db0783 100644 --- a/querydsl-sql/src/test/java/com/mysema/query/sql/CustomTypesTest.java +++ b/querydsl-sql/src/test/java/com/mysema/query/sql/CustomTypesTest.java @@ -43,10 +43,10 @@ public class CustomTypesTest extends AbstractJDBCTest{ // create configuration configuration = new Configuration(new HSQLDBTemplates()); - configuration.setType(Types.DATE, java.util.Date.class); - configuration.setType("person", "secureId", new EncryptedString()); - configuration.setType("person", "gender", new EnumByNameType(Gender.class)); - configuration.register(new StringType()); + configuration.setJavaType(Types.DATE, java.util.Date.class); + configuration.registerCustomType("person", "secureId", new EncryptedString()); + configuration.registerCustomType("person", "gender", new EnumByNameType(Gender.class)); + configuration.registerCustomType(new StringType()); }