Re: Hibernate / MS SQL / Unicode
- From: JScoobyCed <pim@xxxxxxxx>
- Date: Tue, 22 Nov 2005 18:22:23 +0700
JScoobyCed wrote:
Hi,
I have a web-apps that sends unicode data to my servlet. I can save it ot he MS SQL server and when I read it using JDBC client (Squirrel), I can see the unicode correctly in the DB.
I use Hibernate to read/write to the DB.
I Hibernate reference docs, I didn't find anything about unicode values. The funny thing is I can save correctly.... but when I try to query it doesn't work.
A simple query like
session.createQuery("from User where username='xxxxxx'");
( where 'xxxxx' is a unicode String) it returns nothing.
Ok, found the solution...
Have to use "Criteria"
Criteria criter = session.createCriteria(User.class);
criter = criter.add(Restrictions.eq("username", usern));
List list = criter.list();-- JSC .
- Follow-Ups:
- Re: Hibernate / MS SQL / Unicode
- From: Tim Van Wassenhove
- Re: Hibernate / MS SQL / Unicode
- References:
- Hibernate / MS SQL / Unicode
- From: JScoobyCed
- Hibernate / MS SQL / Unicode
- Prev by Date: Hibernate / MS SQL / Unicode
- Next by Date: Re: Hibernate / MS SQL / Unicode
- Previous by thread: Hibernate / MS SQL / Unicode
- Next by thread: Re: Hibernate / MS SQL / Unicode
- Index(es):
Relevant Pages
|