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: collation conflict
PostPosted: Thu Nov 19, 2009 10:47 am 
Newbie

Joined: Thu Nov 19, 2009 7:48 am
Posts: 4
hi, really struggling to resolve this issue. using nhibernate Im trying to join two different tables from two different databases but im getting a collation conflict error.

To resolve this issue i know i need to append
Quote:
"collate Latin1_General_CI_AS"

to the end of the sql string but have no idea how to do it using nhibernate.

Error:
Code:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.

have looked for solutions for some time without any real joy. I get the feeling that it will be a simple configuration change. I thought that maybe i could override some string function within IQuery to append "collate Latin1_General_CI_AS" to the end of the sql but couldnt find anything obvious.

the sql that nhibernate fails on fails in ms sql 2005 management studio but runs and returns a result if i append the collate.

any help would be greatly recieved.

much love c


Top
 Profile  
 
 Post subject: Re: collation conflict
PostPosted: Thu Mar 11, 2010 5:36 am 
Newbie

Joined: Thu Nov 19, 2009 7:48 am
Posts: 4
RESOLVED AT LAST!

public class InstallationMappingOverride : IAutoMappingOverride<Installation> {
public void Override(FluentNHibernate.Automapping.AutoMapping<Installation> mapping) {
mapping.References<Customer>(a => a.Customer)
.Fetch.Select()
.Column("CustomerCode");
}
}

by simply adding the line highlighted above - ".Fetch.Select" within the automapping override it resolves my problem. I have no idea why if someone could tell me then great but at least i can crack on now.

I would hope this helps someone because it really bugged me.


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.