-->
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: MySQL longtext field
PostPosted: Thu Jun 30, 2011 11:41 am 
Newbie

Joined: Mon Jun 20, 2011 4:12 am
Posts: 4
Hi guys,
I have a longtext field which contains some html text that in the worst case is greater than 1MB.
It's very odd, I thought that changing the Hibernate configuration from text to byte[] would have improved the performances (consider that I have to do some further string manipulation, html replace, etc.), but I was wrong.
So, I'm wondering what is the best way to configure such kind of fields?

Here is my current configuration:
Code:
   <property name="htmlText" column="`htmlText`" type="text" not-null="false"/>


FWIW I'm using Hibernate with Spring Framework.


Top
 Profile  
 
 Post subject: Re: MySQL longtext field
PostPosted: Fri Jul 01, 2011 5:09 am 
Newbie

Joined: Mon Jun 13, 2011 4:45 am
Posts: 1
MySQL text fields have a limit of 65,000 bytes. If you insert anything larger than that in to a normal text field mySQL will silently truncate your data without telling you. MEDIUMTEXT will store 16 million characters and LONGTEXT can handle over 4 trillion, but this information does not appear to be readily available in the online mySQL manual.

_________________
Search Engine Optimization
Internet Marketing
Web Hosting


Top
 Profile  
 
 Post subject: Re: MySQL longtext field
PostPosted: Fri Jul 01, 2011 5:22 am 
Newbie

Joined: Mon Jun 20, 2011 4:12 am
Posts: 4
Many thanks for your quick reply.
Unfortunately my original question was not about the MySQL stuff, but it was rather about the right kind of java object, or even primitive type, (f.e.: byte[], String, ...) to choose in order to map with a longtext field.


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.