-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to index a field using H3 annotations?
PostPosted: Fri May 06, 2005 8:40 am 
Newbie

Joined: Fri Apr 22, 2005 3:39 pm
Posts: 18
Greetings!

This Q is probably lame... maybe not. I can't find the workaround nanywhere:

Does anybody know how to make a column (field) indexed using Hibernate3 annotations? Is there a way at all? Ex:

@Entity
class MyEntity
{
private long id;
private String name;

@Id
// id getter/setter ...

@Basic // <- I want this field to be indexed. ShemaExport generates no index for it by default.
// name getter/setter...
}

Do you set indexes on all field you use in your "where..." queries?
Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 5:01 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is not possible right now, vote for it in JIRA.
We do not add an index on proeprties involved in where clauses, it would be very dangerous to do so.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 7:29 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
it is table characteristic, not property - it need be on class level , if you add it
reason is simple - index can have more properties/columns

It is similar for PK, but it is in ejb3 (for me wrong place)

regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 4:13 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
emmanuel wrote:
We do not add an index on proeprties involved in where clauses, it would be very dangerous to do so.

I mean out of the box :-)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.