Hi Lukas, no problem, I have attached the DDL scripts.
The Java code is:
Class.forName ("oracle.jdbc.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcu",
"user", "pass");
Settings settings = new Settings().withRenderSchema(false);
DSLContext context = DSL.using(con, SQLDialect.ORACLE, settings);
Ausgabe ausgabe = new Ausgabe();
OTestRecord record = new OTestRecord();
record.setTestattrib("test");
ausgabe.setPTest(record);
ausgabe.execute(context.configuration());
System.out.println(ausgabe.getPTest().getTestattrib());
OTestRecord ausgabe2 = Test.ausgabe(context.configuration(), record);
System.out.println(ausgabe2.getTestattrib());
I have also attached the two configuration files I use.
When generating with "test-working.xml" everything is working just fine,
but using "test-not-working.xml" the described Exception is thrown.
Setting withRenderSchema(true) does not make any difference.
Regards
Dominik
On Monday, July 22, 2013 9:43:51 AM UTC+2, Lukas Eder wrote:
>
> Hi Dominik,
>
> Sorry for the delay. This does indeed look like a bug, but it might not be
> easy to reproduce this from your recent mail. Could you provide:
>
> - The DDL of the type TEST
> - The DDL of the package pack_test
> - Some sample Java code to reproduce the issue
>
> Thanks
> Lukas
>
> 2013/7/16 <[email protected] <javascript:>>
>
>> Hi Lukas,
>>
>> I am fairly new to jOOQ, but it seems like I found a bug that is maybe
>> related to this.
>>
>> I am generating from an Oracle Schema using the "default schema" as
>> output schema (empty <outputSchema> tag). When executing a stored
>> procedure I get a ClassCastException:
>>
>> java.lang.ClassCastException: oracle.sql.STRUCT cannot be cast to
>> de.test.jooq.udt.records.TestRecord
>> at
>> de.test.y.jooq.packages.pack_test.TestRetrieve.getTest(TestRetrieve.java:106)
>>
>> However when generation has run with:
>>
>> <inputSchema>TEST</inputSchema>
>> <outputSchema>TEST</outputSchema>
>>
>> and
>>
>> Settings settings = new Settings().withRenderSchema(false);
>>
>> everything is fine.
>>
>> Is it a bug or am I missing something?
>>
>> Regards
>> Dominik
>>
>> BTW: In the case where the Exception occurs setting:
>>
>> Settings settings = new Settings().withRenderSchema(false);
>>
>> Does also lead to the ClassCastException.
>>
>> On Friday, June 14, 2013 4:49:19 PM UTC+2, Lukas Eder wrote:
>>
>>> Hi James,
>>>
>>> Thanks for reporting this. This is a bug. I have created #2522 for this.
>>> https://github.com/jOOQ/jOOQ/**issues/2522<https://github.com/jOOQ/jOOQ/issues/2522>
>>>
>>> This bug may be related to another bug that was fixed some time ago.
>>> https://github.com/jOOQ/jOOQ/**issues/1693<https://github.com/jOOQ/jOOQ/issues/1693>
>>>
>>> Cheers
>>> Lukas
>>>
>>>
>>> 2013/6/12 <[email protected]>
>>>
>>>> Hi,
>>>> i have found a problem while mapping a different schema at runtime;
>>>> the mapping doesn't work with udts (types and records).
>>>> the piece of code involved in the mapping operation is the following
>>>>
>>>> DataSourceConnectionProviderFa**ctory dsFactory =
>>>> DataSourceConnectionProviderFa**ctory.getInstance(config);
>>>> ConnectionProvider cp =
>>>> dsFactory.**getDataSourceConnectionProvide**r(type,
>>>> ds);
>>>> Settings st = new Settings()
>>>> .withRenderMapping(new RenderMapping()
>>>> .withSchemata(
>>>> new MappedSchema().withInput("DEV"**).withOutput("PRODUCTION")));
>>>> Configuration cfg = new DefaultConfiguration().set(cp)**
>>>> .set(dialect).set(st);
>>>> return DSL.using(cfg);
>>>>
>>>> The same problem occurs if classes are generated by the generation
>>>> tool (input/output schema defined in configuration xml).
>>>>
>>>> Is this a bug or am I doing something wrong?
>>>>
>>>> thanks
>>>> James
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jOOQ User Group" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to jooq-user+...@**googlegroups.com.
>>>>
>>>> For more options, visit
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
create or replace TYPE o_test AS OBJECT ( TESTATTRIB VARCHAR2(20) ); /
CREATE OR REPLACE PACKAGE test AS PROCEDURE ausgabe (p_test IN OUT O_TEST); END; /
CREATE OR REPLACE PACKAGE BODY test
AS
PROCEDURE ausgabe (p_test IN OUT O_TEST)
IS
BEGIN
DBMS_OUTPUT.put_line ('AUSGABE => ' || p_test.TESTATTRIB);
p_test.TESTATTRIB := 'PROCESSED';
END;
END;
/
test-not-working.xml
Description: XML document
test-working.xml
Description: XML document
