-->
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: SchemaUpdate ignores @Index
PostPosted: Sun Jan 15, 2006 4:12 pm 
Beginner
Beginner

Joined: Tue Dec 09, 2003 5:59 pm
Posts: 25
Location: Los Angeles
Hibernate version:
3.1 rc 1, Hibernate annotations 3.1b6

Name and version of the database you are using:
Oracle 10g

System.setProperty(Environment.HBM2DDL_AUTO, "update");

When I get a session factory, and Hibernate runs schema update (creating tables and constraints,) it is ignoring any @Index annotations that I've provided in my classes. No indexes get created. Am I doing something wrong, or is this a bug?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 1:14 pm 
Beginner
Beginner

Joined: Tue Dec 09, 2003 5:59 pm
Posts: 25
Location: Los Angeles
I looked at Configuration.java, and found a block of code that looks like it should be generating the indexes commented out.

/*//broken, 'cos we don't generate these with names in SchemaExport^M
subIter = table.getIndexIterator();^M
while ( subIter.hasNext() ) {^M
Index index = (Index) subIter.next();^M
...

Should I file a bug about this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 1:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, but a fix that makes the comment obsolete will be interesting.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 2:25 pm 
Beginner
Beginner

Joined: Tue Dec 09, 2003 5:59 pm
Posts: 25
Location: Los Angeles
I copied the chunk of code that looks like it should be creating indexes when running SchemaExport into the SchemaUpdate section, but table.getIndexIterator() returns an empty iterator. Any suggestions on where to head next? I never use SchemaExport. Does index creation work properly there? Has anyone tested it with @Index annotations?


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.