-->
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: Add case sensitive in unique column
PostPosted: Wed Jun 06, 2012 3:13 am 
Newbie

Joined: Wed Jun 06, 2012 2:58 am
Posts: 1
I have a table in mysql which i s unique column ,but it want to allow the varchar column as case sensitive .

while insert
eg:Test123 and test123 report as duplicate value.

I need case sensitive but unique.

<property name="column1" column="COLUMN_STRING" unique="true" not-null="true" />

eg:
CREATE TABLE TEST(ID BIGINT AUTO_INCREMENT, COLUMN_STRING VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_cs NOT NULL UNIQUE, PRIMARY KEY(ID));

How i can set the character set as case sensitive for particular column .


Top
 Profile  
 
 Post subject: Re: Add case sensitive in unique column
PostPosted: Wed Jun 06, 2012 10:08 am 
Beginner
Beginner

Joined: Mon Jun 04, 2012 12:31 pm
Posts: 20
You can set a type on the property.

http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/mapping.html#mapping-declaration-property

I'm not sure of the exact type you need, but you probably need to research into that. Or on possibly creating your own.


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.