-->
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.  [ 2 posts ] 
Author Message
 Post subject: JPA for text column with string size 65535 on HSQLDB
PostPosted: Mon Jun 10, 2013 11:27 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Hi,

I have a table in a MySQL 5.0.45 database schema with a text type as in: profile text

I could successfully build an Hibernate based Dao with the mapping:
<property name="profile" type="text">
<column name="profile" length="65535" />
</property>
with the Maven integration test working fine both against the MySQL and HSQLDB databases.

Now I'm trying to move on to a JPA repository to replace the legacy Hibernate Dao.

So I created another domain class in which I annotated the property as in:
@Lob
@Column(columnDefinition = "TEXT", length = 65535)
private String profile;

The Maven integration test works fine against the MySQL database too but fails against the HSQLDB one.

I'm using hibernate-jpa-2.0-api 1.0.1.Final and hibernate-annotations 3.5.6-Final and hsqldb 2.2.9 and spring-data-jpa 1.3.0.RELEASE and mysql-connector-java 5.1.12

I would like the Maven integration test work fine against the HSQLDB database on the JPA repository environment, just like it does on the legacy Hibernate Dao environment.

Any clue ?


Top
 Profile  
 
 Post subject: Re: JPA for text column with string size 65535 on HSQLDB
PostPosted: Sat Jun 29, 2013 3:33 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Using the following url in the data source properties

using the dataSource.url=jdbc:log4jdbc:hsqldb:mem:db_integra tion;sql.syntax_mys=true

solved the isue.

But I still have one question: how come using HSQLDB withOUT any MySQL property works fine when accessed through an Hibernate DAO and not when accessed through a JPA repository ?

The point of testing either against a MySQL database or an HSQLDB database is that these two being a bit different, I can make sure my code is portable. Now if I tell one, the HSQLDB database to behave as the other then there is less point in using it.

It's like HSQLDB behaves in a MySQL-like way when accessed through an Hibernate DAO but behaves in a non-MySQL-like way when accessed through a JPA repository.

By DAO I referred to my own layer of data access code. Using Hibernate works just fine against HSQLDB without the additional url property. But using JPA requires the url property apparently. It's too bad.

See the thread at https://sourceforge.net/projects/hsq.../topic/8377017


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