-->
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: Problems with NTEXT columns on SQL-Server 2000
PostPosted: Fri Jan 11, 2008 8:34 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
Hi all,

in my application i have the requirement to store word documents in .rtf format in my database. For this purpose i've defined a column of type 'ntext' in my database and mapped the column to a string. In the query analyzer it works fine when i try to store a larger rtf (around 10KB) in the database. Doing the same with NHibernate the rtf is truncated to 4000 bytes (loading works fine). I'm afraid that this is a result from the use of sp_executesql inside NHibernate. Did anyone ran in similar problems and, maybe, have a solution for this?

Regards
Klaus

P.S.: Im using NHibernate 1.0.4 on .NET Framework 1.1

Here is my mapping:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Created by a MyGeneration Template - Created: 12.09.2007 11:51:57 -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="CallWord" namespace="CallWord">
   <class name="GdmRuleDefinition" table="GDM_RULE_DEFINITION">

      <id name="mId" column="RULE_DEFINITION_ID" access="field" type="Guid">
         <generator class="guid"/>
      </id>
      <property name="Code"                  column="CODE"                   type="String"   not-null="true" length="50" />
      <property name="Description"           column="DESCRIPTION"            type="String"   length="255" />
      <property name="UserDefined"           column="USER_DEFINED"           type="Boolean" />
      <property name="LogicalFieldName"      column="LOGICAL_FIELD_NAME"     type="String"   length="255" />
      <property name="Operator"              column="OPERATOR"               type="String"   length="35" />
      <property name="FieldValueType"        column="FIELD_VALUE_TYPE"       type="String"   length="35" />
      <property name="BusinessCaseTemplate"  column="BUSINESS_CASE_TEMPLATE" type="BinaryBlob"   length="1073741823" />
      <property name="CreatedBy"             column="CREATED_BY"             type="String"   length="20" not-null="true" />
      <property name="CreatedTime"           column="CREATED_TIME"           type="DateTime" not-null="true" />
      <property name="ModifiedBy"            column="MODIFIED_BY"            type="String"   length="20" not-null="true" />
      <property name="ModifiedTime"          column="MODIFIED_TIME"          type="DateTime" not-null="true" />

   </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 2:26 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
1.0.4 is quite out-of-date, but I assume you have good reasons for not being able to upgrade.

For string <-> ntext, I'd expect to see a type="StringClob" somewhere in your mapping. Which property is the problem?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 12, 2008 12:37 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
Hi Marcal,

thanks for the fast reply. The problematic column is BUINESS_CASE_TEMPLATE. After changing the mapping to StringClob it works fine.

Regards
Klaus


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.