-->
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: Wrong column type: XXXX, expected: blob
PostPosted: Tue Jan 10, 2006 7:07 am 
Beginner
Beginner

Joined: Mon Jan 09, 2006 11:17 am
Posts: 25
I have a problem with tinyblob, blob and longblob.

@Column(name="XXXX", unique=false, nullable=false, insertable=true, updatable=true)
@Lob(type = LobType.BLOB)
public byte[] getXXXX() {
return this.XXXX;
}

The validator says it has to be a blob, but a longblob it is still the same in mysql, is any workaround for this?

I am using <property name="hibernate.hbm2ddl.auto" value="validate"/> in the persistence.xml, maybe the workaroung could be there...

It is not the only problem I have with the mapping, tinyint vs bit for booleans are a lower issue too.

Thanks!

Hibernate version:EJB3 included in JBoss [Zion] 4.0.3 (build: CVSTag=JBoss_4_0_3 date=200510042341)

Full stack trace of any exception that occurs:
10:46:27,062 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=PAR.par
org.hibernate.HibernateException: Wrong column type:XXXXX, expected: blob
at org.hibernate.mapping.Table.validateColumns(Table.java:205)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:938)


Name and version of the database you are using:MySql 5.0.18


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 3:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
open a JIRA issue with a test case please

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 7:16 am 
Beginner
Beginner

Joined: Mon Jan 09, 2006 11:17 am
Posts: 25
Running this with LongBlob returns:
System.out.println(metadata.getColumnClassName(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnDisplaySize(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnLabel(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnName(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnType(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnTypeName(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnCharacterEncoding(result.findColumn("ACCEPT_COOKIE")));
System.out.println(metadata.getColumnCharacterSet(result.findColumn("ACCEPT_COOKIE")));
-------
[B
2147483647
ACCEPT_COOKIE
ACCEPT_COOKIE
-4
LONGBLOB
null
US-ASCII
------
With Blob returns:
-----
[B
65535
ACCEPT_COOKIE
ACCEPT_COOKIE
-4
BLOB
null
US-ASCII


Is that ok?


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.