Skip to content

Instantly share code, notes, and snippets.

@manuelbernhardt
Last active August 29, 2015 14:23
Show Gist options
  • Save manuelbernhardt/531261f954afc4342536 to your computer and use it in GitHub Desktop.
Save manuelbernhardt/531261f954afc4342536 to your computer and use it in GitHub Desktop.
DefaultDataType.java
diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java
index 5231af3..fd19cce 100644
--- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java
+++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java
@@ -720,6 +717,15 @@ public class DefaultDataType<T> implements DataType<T> {
if (dialect != null) {
result = TYPES_BY_TYPE[dialect.family().ordinal()].get(type);
+
+ // check if we know about interfaces implemented by the type
+ if (result == null) {
+ for (Map.Entry<Class<?>, DataType<?>> knownType : TYPES_BY_TYPE[dialect.family().ordinal()].entrySet()) {
+ if(knownType.getKey().isAssignableFrom(type)) {
+ result = knownType.getValue();
+ }
+ }
+ }
}
if (result == null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment