-->
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.  [ 14 posts ] 
Author Message
 Post subject: Need some help to debug...
PostPosted: Fri Sep 30, 2005 5:57 pm 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
I am using the hibernate-3.0.5 tools for eclipse and get the following error:

org.hibernate.cfg.JDBCBinderException:The type java.lang.Object spans multiple columns. Only single column types allowed for single columns.

when I try to generate artifacts...

It doesn't say what table or column it has trouble with...

Is there any way to get some more info? It really should be possible to get the name of the problematic table..

Thanks in advance ;)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:04 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
run ant w/ -debug ... start simplifying the data model .


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 2:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the cvs version is more explicit about the bad column

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 7:19 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
is this going to be implemented in a version that you don't have to pull from the cvs?

Oh,... one more thing...

The would it be possible to store the data from the dialog "generate artifacts", so you don't have to enter the data every time you want to genereate the java/xml files?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 7:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh yes, normally cvs is what we release from ;)

yes - we have a jira issue for it. patches welcome ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 8:57 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
Found one of the culprit tables...

CREATE TABLE tintarrayfield
(
intarrayfieldid serial NOT NULL,
id_document int4,
name text,
data int4[],
CONSTRAINT tintarrayfield_pkey PRIMARY KEY (intarrayfieldid),
CONSTRAINT tintarrayfield_id_document_fkey FOREIGN KEY (id_document) REFERENCES tdocument (documentid) ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH OIDS;
ALTER TABLE tintarrayfield OWNER TO postgres;

Generates this error
"org.hibernate.cfg.JDBCBinderException:The type java.lang.Object spans multiple columns. Only single column types allowed for single columns."

I have got a strong feeling the column data int4[] is generating the error...

I figured I needed something like this:
<hibernate-reverse-engineering>
<type-mapping>
<sql-type jdbc-type="int4[]" hibernate-type="Integer[]" />
</type-mapping>
... table stuff...
</hibernate-reverse-engineering>

But that didn't work... so what hibernate-type is this supposed to map to? :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to find out which sql type int4[] is mapped to. if you enable debug log the tools should tell you what integer value it finds for the sql types (as in java.sql.Types)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:11 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
I am still using the eclipse plugin tools, dumb as I am, I assume there is no debug settings there? ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
not really, but there is a log4j.properties in the org.hibernate.eclipse plugin you can use to "bump" up the debug info and direct it to a file.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:22 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
I have absolutely no idea how to find that :/

I am starting to get assosiations to the movie "Clueless"


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you try to do the reveng with ant its easier to debug...(but otherwise wait for the upcoming release where this and other exceptions are more informative (hopefully ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 10:16 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
<type-mapping>
<sql-type jdbc-type="ARRAY" hibernate-type="java.sql.Array" />
</type-mapping>

Seems to work...

if I use jdbc and run getObject() on the column with the int[] it returns a java.sql.Array objekt...

jdbc-type="ARRAY" this was just a guess really...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 10:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well guessing is a good tool for progress ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 1:09 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
I am still using the eclipse plugin tools, dumb as I am, I assume there is no debug settings there? ;)


I debug on eclipse with :

1) build cvs hibernate tools in eclipse
2) start runtime workbench in debug mode
3) set breakpoint in eclipse (base, not runtime)
4) do work in runtime workbench

JVM stop on breka point and I can do with debug operation


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