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.  [ 4 posts ] 
Author Message
 Post subject: Is it a bug of Hibernate 2.1.6?
PostPosted: Mon Sep 13, 2004 4:50 am 
Newbie

Joined: Thu Sep 09, 2004 2:03 am
Posts: 7
Hibernate version:
2.1.6
In net.sf.hibernate.type.TypeFactory, about Line #94, appears to be this code:
basics.put( byte[].class.getName(), Hibernate.BINARY);

for as you see,
byte[].class.getName() is "]B".

When I use MiddleGen r5 to generate hbm.xml, byte[] type will be generated like this:

Mapping documents:
<property
name="data"
type="byte[]"
column="DATA">
.......

Then Exception occures:


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
net.sf.hibernate.MappingException: Error reading resource: Longrawtable.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at example.bo.test.TestLongRaw.main(TestLongRaw.java:35)
Caused by: net.sf.hibernate.MappingException: Could not interpret type: byte[]
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:935)
at net.sf.hibernate.cfg.Binder.bindSimpleValue(Binder.java:435)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1048)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:362)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1257)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:288)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
... 5 more
Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

So , i have to modify hbm.xml, change "byte[]" to "]B".


I wonder whether or not , this is a bug?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 4:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
middlegen should generate "binary"


Top
 Profile  
 
 Post subject: ?
PostPosted: Mon Sep 13, 2004 5:05 am 
Newbie

Joined: Thu Sep 09, 2004 2:03 am
Posts: 7
gavin wrote:
middlegen should generate "binary"

My DB is Oracle 9i and the type of the column is LONG RAW

MiddleGen shows me only 5 choices for this column:
byte[]
java.lang.String
java.lang.Object
java.io.InputStream
java.io.Reader

I can only use byte[].
Hibernate can not interpret java.io.InputStream either.

My MiddleGen version is r5 , Hibernate is 2.1.6

Thanks for help!


Top
 Profile  
 
 Post subject: Help!
PostPosted: Mon Sep 13, 2004 10:43 pm 
Newbie

Joined: Thu Sep 09, 2004 2:03 am
Posts: 7
Any body has sucessful story for this kind of situation?

Thanks in advance!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.