-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to store a byte into an oracle table
PostPosted: Fri Dec 15, 2006 2:38 pm 
Newbie

Joined: Tue Sep 05, 2006 11:11 am
Posts: 11
We have defined a field as RAW(1) in Oracle. Need to store 0x00 to 0xff into it. Using:


<property name="inboundElementSeperator" type="char" >
<column name="INBOUND_ELEMENT_SEPERATOR" length="1" sql-type="raw"/>
</property>


We get an exception from Oracle: ORA-01465: invalid hex number

No field information provided. Specifying sql-type="raw(1)", or type="binary" does not fix it. We can change the field in Oracle or change the hibernate definition or both as long as we can store a single byte and be able to retrieve it into a java char.

Thanks for any suggestions.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 4:20 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Did you try "byte" or maybe write a custom UserType class that will allow you to convert the data by yourself. See http://forum.hibernate.org/viewtopic.ph ... 47#2334047

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 9:34 am 
Newbie

Joined: Tue Sep 05, 2006 11:11 am
Posts: 11
Thanks for the response. I should have mentioned that we tried byte and it did not solve the issue. Custom types seem like an overkill. We ended up using NUMBER instead and added getters that convert the number to char.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.