-->
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 create a db index in a many-to-one association?
PostPosted: Fri Jun 08, 2007 11:41 am 
Newbie

Joined: Tue Aug 22, 2006 10:52 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.4 sp1

Mapping documents:Using Hibernate Annotation.

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:PostgreSQL 8.1.8

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

I used @Index to define a DB index in a many-to-one association, like this:

Code:
   @ManyToOne(fetch=FetchType.EAGER)
   @JoinColumn(name="latest_exercise")
   @Index(name="exercise_index")
   public ExerciseRecord getLatestExercise() {
      return latestExercise;
   }


But it is not created. How to create this index?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 5:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Which Hibernate Annotations are you using, AFAIR it has been fixed.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 09, 2007 5:35 am 
Newbie

Joined: Tue Aug 22, 2006 10:52 pm
Posts: 3
The version of the Hibernate-annotations that I used is 3.3.0.
Is it a bug?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 11, 2007 7:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are you sure it's not applied?
My unit test (o.h.test.annotations.various.IndexTest and Trunk) show the index generation working (for HSQLDB at least).

It's like the example you've posted.

_________________
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.