Skip to content

Commit 0128245

Browse files
committed
support for deserializing object property values based on value class
1 parent f75f2f6 commit 0128245

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

querydsl-libraries/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public Class<?> getJavaType(
228228
@Nullable
229229
public <T> T get(ResultSet rs, @Nullable Path<?> path, int i, Class<T> clazz)
230230
throws SQLException {
231-
return getType(path, clazz).getValue(rs, i);
231+
return getType(path, clazz).getValue(rs, i, clazz);
232232
}
233233

234234
/**

querydsl-libraries/querydsl-sql/src/main/java/com/querydsl/sql/types/Type.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ public interface Type<T> {
5151
*/
5252
String getLiteral(T value);
5353

54+
/**
55+
* Get the object from the result set
56+
*
57+
* @param rs result set
58+
* @param startIndex column index in result set
59+
* @param clazz value type
60+
* @return value
61+
* @throws SQLException
62+
*/
63+
@Nullable
64+
default T getValue(ResultSet rs, int startIndex, Class<T> clazz) throws SQLException {
65+
return getValue(rs, startIndex);
66+
}
67+
5468
/**
5569
* Get the object from the result set
5670
*

0 commit comments

Comments
 (0)