From 71c9bda2645c65c7bdcc0900fbebac33e1f37dc5 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 3 Feb 2012 17:46:40 +0000 Subject: [PATCH] [#1111] VARRAY element type information is lost when unnesting VARRAY's returned from functions in Oracle --- jOOQ/src/main/java/org/jooq/impl/ArrayTable.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java b/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java index 8ec83a3263..64a89aea68 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java @@ -38,6 +38,7 @@ package org.jooq.impl; import java.util.Collections; import java.util.List; +import org.jooq.ArrayRecord; import org.jooq.Attachable; import org.jooq.BindContext; import org.jooq.Configuration; @@ -75,6 +76,8 @@ class ArrayTable extends AbstractTable { super(alias); Class arrayType; + + // TODO [#523] Solve this in a more object-oriented way... if (array.getDataType().getType().isArray()) { arrayType = array.getDataType().getType().getComponentType(); } @@ -84,6 +87,14 @@ class ArrayTable extends AbstractTable { arrayType = array.getDataType().getType(); } + // [#1111] Keep track of element type information of Oracle + // VARRAY / TABLE types returned from functions + else if (ArrayRecord.class.isAssignableFrom(array.getDataType().getType())) { + // TODO [#523] This information should be available in ARRAY meta-data + ArrayRecord dummy = Util.newArrayRecord((Class>) array.getDataType().getType(), DefaultConfiguration.DEFAULT_CONFIGURATION); + arrayType = dummy.getDataType().getType(); + } + // Is this case possible? else { arrayType = Object.class;