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: Any way to force db collation type?
PostPosted: Wed Oct 05, 2005 3:56 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
Dear NHibernate doyens,

I am using NHibernate 0.99 RC2 to cross two databases. One stores user accounts, another stores the programs data.

Code:
<class name="Data.Entities.ProjectRegister.Project" table="ProjectRegister.dbo.Project" lazy="true">

<class name="Data.Entities.Security.Employee" table="Security.dbo.Employee" lazy="true">



I just ran a query to fetch data from both tables and received the SQL error:

Code:
Cannot resolve collation conflict for equal to operation


The security database does not share the same collation type as the Data database. Is there any way I can tell the db via HQL (or another mean) that I want to enforce a certain collation type for one of the tables?

I guess I shouldn't be traversing multiple databases just yet....
:cry:

Thanks,
Jason


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 12:17 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
I've attempted to fix my issue by modifying the mapping file like so:

Code:
<class name="Data.Entities.Security.Employee,Class" table="Security.dbo.Employee" lazy="true">

      <id name="UserName" type="string">
         <column name="Username" sql-type="varchar(30) collate database_default" unique="true" />
         <generator class="native"/>
      </id>
.....


Unfortunately when the join between the two tables occur using the Username as the Key the collate database_default isn't being shown in the resultant SQL...

This is the log section of the SQL Join that Hibernate spits out:

Code:
left outer join Security.dbo.Employee employee3_ on project0_.ProjectManagerUsername=employee3_.Username


This is what I need it to say to work:
'
Code:
left outer join Security.dbo.Employee employee3_ on project0_.ProjectManagerUsername=employee3_.Username COLLATE database_default



I'll keep playing....


Top
 Profile  
 
 Post subject: Re: Any way to force db collation type?
PostPosted: Thu Nov 19, 2009 7:50 am 
Newbie

Joined: Thu Nov 19, 2009 7:48 am
Posts: 4
did you manage to resolve this as ive got the same issue.

thanks,


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.