-->
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: length attribute missing on @Index annotation
PostPosted: Wed Oct 08, 2008 9:55 am 
Newbie

Joined: Wed Oct 08, 2008 9:35 am
Posts: 2
Using MySQL, one can do something like :

Code:
CREATE TABLE test(name TEXT, INDEX(name(255))


which creates a test table with an Index of length 255 on name.


Using Oracle one can use function based index to achieve similar result (create an index based on part of a column)

I am not 100% sure of the syntax, but it should look like

Code:
CREATE INDEX name_index ON test(SUBSTR(name,255))


However using Hibernate annotations, if one can specify that a column is to be used as an index, it seems like there is no way to specify the length of the index.

Therefore, (at least with MySQL) the column length is used for the index length.

But with some RDBMS, the index length can only go so far (for example 256 on MySQL), forcing you not to use the given column as an index since you cannot use Hibernate to tell it not to use the full length of the column for indexing.

Seems like this feature is missing and AFAIK it has not been reported in JIRA.

Shall I open an issue ?


Top
 Profile  
 
 Post subject: length attribute missing on @Index annotation
PostPosted: Tue Oct 14, 2008 4:10 am 
Newbie

Joined: Wed Oct 08, 2008 9:35 am
Posts: 2
created issue in JIRA. See http://opensource.atlassian.com/project ... se/ANN-780


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.