-->
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.  [ 12 posts ] 
Author Message
 Post subject: Artifact generation problem:JDBCBinderException.
PostPosted: Fri Oct 07, 2005 7:42 am 
Newbie

Joined: Fri Oct 07, 2005 7:22 am
Posts: 5
Hi,
I am using Eclipse 3.1 with the latest tool (3.0 alpha 5) . I am creating a prototype apllication with Oracle database. I have created cfg.xml and console configuration successfully but When I am trying to do Artifact generation following exception occurs. as i said I m trying to connect to an Oracle Database schema. I tried locating solution of this everywhere but couldn't. Can someone help me on this plz.


org.hibernate.cfg.JDBCBinderException: The type java.lang.Object spans multiple columns. Only single column types allowed for single columns.
at org.hibernate.cfg.JDBCBinder.guessAndAlignType(JDBCBinder.java:453)
at org.hibernate.cfg.JDBCBinder.bindColumnToSimpleValue(JDBCBinder.java:403)
at org.hibernate.cfg.JDBCBinder.bindBasicProperty(JDBCBinder.java:395)
at org.hibernate.cfg.JDBCBinder.bindColumnsToProperties(JDBCBinder.java:380)
at org.hibernate.cfg.JDBCBinder.createPersistentClasses(JDBCBinder.java:163)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:249)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:71)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:246)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:165)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:133)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:99)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 07, 2005 12:22 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you have oracle specific type FLOAT, BFILE or like in table probably
Try use reveng.xml for this types


Top
 Profile  
 
 Post subject: I'm having the same problem
PostPosted: Fri Oct 07, 2005 4:43 pm 
Beginner
Beginner

Joined: Thu Aug 04, 2005 2:24 pm
Posts: 45
I'm having the same problem...

You said: "use reveng.xml for this types", but i'm sorry i don't really understand what you mean by that. I'm already using the hibernate tools wizard...

Do i have to alter the column type in Oracle?

Thanks

_________________
Eduardo Mylonas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 07, 2005 5:08 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you can change type, but it isn't solution
See revenge engineering wizard and read documentation for reverse engineering on
tools.hibernate.org
It isn't user friendly, yet

you have to make revng.xml with contents like :

Code:
<sql-type jdbc-type="VARCHAR" length='20' hibernate-type="SomeUserType" /> <!-- jdbc-type is name fom java.sql.Types -->


see http://www.hibernate.org/hib_docs/tools ... html#gen10


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 1:34 am 
Newbie

Joined: Fri Oct 07, 2005 7:22 am
Posts: 5
Hi,
I appreciate your suggestion but it didnt work. its giving same exception. Also, i cannot change the data type in database. NUMBER, CHAR and DATE are the datatypes i m using in the table. Following are the contents of the reveng.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
<type-mapping>
<sql-type jdbc-type="CHAR" length='1' hibernate-type="yes_no" />
<sql-type jdbc-type="CHAR" length='20' hibernate-type="SomeUserType" />
<sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="boolean" />
<sql-type jdbc-type="NUMERIC" hibernate-type="long" />
</type-mapping>
<table-filter match-name="BIN$.*" exclude="true" /> <!-- BIN$ is recycle bin tables in Oracle -->
<table-filter match-schema="TESTING" match-name="TEST_CLIENT"/>
<table-filter match-schema="TESTING" match-name="TEST_CLIENT_LOCK"/>
</hibernate-reverse-engineering>


Do i need to change anything in above file. Wht do i do for DATE. Please let me know..

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 7:27 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
try add on the end file :
Code:
<table-filter match-schema=".*" match-name=".*" exclude="true"/>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 8:20 am 
Newbie

Joined: Fri Oct 07, 2005 7:22 am
Posts: 5
Hi,
Thanks again. Now Artifact generation is running smoothly but unfortunaly it is generating a blank GeneralHbmSettings.hbm.xml file in which <hibernate-mapping> tag does not contain any value. whereas my database schema contains two tables.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 8:49 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I don't use it - try check generate *cfg.xml in wizard


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 8:54 am 
Newbie

Joined: Fri Oct 07, 2005 7:22 am
Posts: 5
Hi,
I have created the cfg.xml using wizard. Cfg.xml is fine as and i can connect to the database using the same cfg.xml.


Top
 Profile  
 
 Post subject: Still not good
PostPosted: Mon Oct 10, 2005 12:58 pm 
Beginner
Beginner

Joined: Thu Aug 04, 2005 2:24 pm
Posts: 45
I added this to the reveg.xml:

<type-mapping>
<sql-type jdbc-type="FLOAT" precision='126' hibernate-type="double" />
<sql-type jdbc-type="NUMERIC" scale='0' hibernate-type="long" />
</type-mapping>

but it didn't work... Do i need to do for all types, or only the types i want to override?

I first thought my problem was on the FLOAT columns, but then i reverse engineered on table that had a FLOAT column, i figured FLOAT is not the problem. But i still keep getting this same error...

Weird thing is this morning it worked and no errors were generated, but i had to make a change to this table, which if i try to reverse engineer it alone it works. And now all the tables together don't work.

If only i had more information as to what the problem is...

Thanks a lot

_________________
Eduardo Mylonas


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 11, 2005 1:47 am 
Newbie

Joined: Fri Oct 07, 2005 7:22 am
Posts: 5
Hi,
Now my reveng.xml contains following entries:

<type-mapping>
<sql-type jdbc-type="CHAR" length='1' hibernate-type="yes_no" />
<sql-type jdbc-type="CHAR" hibernate-type="SomeUserType" />
<sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="boolean" />
<sql-type jdbc-type="NUMERIC" scale='0' hibernate-type="long" />
<sql-type jdbc-type="FLOAT" precision='126' hibernate-type="double" />
</type-mapping>
<table-filter match-name="BIN$.*" exclude="true" /> <!-- BIN$ is recycle bin tables in Oracle -->
<table-filter match-schema="TESTING" match-name="TEST_CLIENT"/>
<table-filter match-schema="TESTING" match-name="TEST_CLIENT_LOCK"/>

and i m still getting exactly same exception which i was getting at the start. As said earlier i m using NUMBER, CHAR and DATE datatypes in Table. I think this could be because of DATE datatype. What could be the <sql-type> entry for DATE. Unfortunatly i cannot change the datatype in table as my requirement specifically talks about the use of DATE.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 11, 2005 4:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use one of the latest nightly builds and work with the new reveng.xml editor or wait for the release

_________________
Max
Don't forget to rate


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