tags:

views:

111

answers:

3

I am using hibernate, and my classes property is a string, and my mapping doesn't have any type information, ie:

  <property name="html"  />

I am storing a web page in the html database column, and for some reason the entire page isn't saving, it gets cut off part way.

I outputed the value of the property to console and it does output all the way to the ending </html> tag.

Does hiberate truncate a string value?

the database column is a nvarchar(max) (sql server)

Turns out it was writing the entire string to the database, just copy and pasting from the database editor was truncating the actual text stored in the db column.

A: 

Try

<property name="Value" type="StringClob" />

Otherwise, Hibernate needs to know the length when dealing with large strings.

Sapph
+1  A: 
<property name="html" length="20000" />

I.e. specify the length attribute and set it to a value big enough.

Bozho
+2  A: 

try

<property name="Value" type="LongVarChar" />
always check whether your answer displays properly. You didn't format your code and your answer contained only "try".
Bozho