You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Maxim Kuleshov <ku...@org.vrn.ru> on 2006/06/14 10:40:02 UTC

JAVA_OBJECT and type mapping via OJB

Hello!

I've tried to use type-mapping feature of JDBC in apache OJB but failed.
Broker reports the following error:

...
Caused by: org.apache.ojb.broker.OJBRuntimeException: The type 
JAVA_OBJECT can not be handled by OJB. Please specify only types as 
defined by java.sql.Types.
...

Are any work-arounds to bypass that restriction? For example, is it 
possible to read oracle object types using field-type conversion 
facility while declaring that fields of type blob or likely?

PS: I'm definetly walked through all steps before use type-mapping, i.e. 
create necessary class which implements SQLData, create simple proxy of 
standard ConnectionFactory those function is modify type map, if its empty.

--
WBR, Maxim Kuleshov

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: JAVA_OBJECT and type mapping via OJB

Posted by Armin Waibel <ar...@apache.org>.
Hi again,

I checked in a first version of JAVA_OBJECT type support. I test it 
against hsql, mysql and maxDB. It could be the case that OJB need 
additional tweak to support other databases.

If possible for you, please check out latest from SVN (OJB_1_0_RELEASE 
branch!).

regards,
Armin

Armin Waibel wrote:
> Hi Maxim,
> 
> Maxim Kuleshov wrote:
>> Hello!
>>
>> I've tried to use type-mapping feature of JDBC in apache OJB but failed.
>> Broker reports the following error:
>>
>> ...
>> Caused by: org.apache.ojb.broker.OJBRuntimeException: The type 
>> JAVA_OBJECT can not be handled by OJB. Please specify only types as 
>> defined by java.sql.Types.
>> ...
>>
> 
> I open a bug report in JIRA
> http://issues.apache.org/jira/browse/OJB-113
> will fix this ASAP
> 
> 
>> Are any work-arounds to bypass that restriction? For example, is it 
>> possible to read oracle object types using field-type conversion 
>> facility while declaring that fields of type blob or likely?
>>
> 
> You could try to define the field as LONGVARBINARY and implement a 
> FieldConversion which serialize/deserialize the java object.
> 
> regards,
> Armin
> 
> 
>> PS: I'm definetly walked through all steps before use type-mapping, 
>> i.e. create necessary class which implements SQLData, create simple 
>> proxy of standard ConnectionFactory those function is modify type map, 
>> if its empty.
>>
>> -- 
>> WBR, Maxim Kuleshov
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: JAVA_OBJECT and type mapping via OJB

Posted by Armin Waibel <ar...@apache.org>.
Hi Maxim,

Maxim Kuleshov wrote:
> Hello!
> 
> I've tried to use type-mapping feature of JDBC in apache OJB but failed.
> Broker reports the following error:
> 
> ...
> Caused by: org.apache.ojb.broker.OJBRuntimeException: The type 
> JAVA_OBJECT can not be handled by OJB. Please specify only types as 
> defined by java.sql.Types.
> ...
> 

I open a bug report in JIRA
http://issues.apache.org/jira/browse/OJB-113
will fix this ASAP


> Are any work-arounds to bypass that restriction? For example, is it 
> possible to read oracle object types using field-type conversion 
> facility while declaring that fields of type blob or likely?
>

You could try to define the field as LONGVARBINARY and implement a 
FieldConversion which serialize/deserialize the java object.

regards,
Armin


> PS: I'm definetly walked through all steps before use type-mapping, i.e. 
> create necessary class which implements SQLData, create simple proxy of 
> standard ConnectionFactory those function is modify type map, if its empty.
> 
> -- 
> WBR, Maxim Kuleshov
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org