• Post Reply Bookmark Topic Watch Topic
  • New Topic

hibernate auto generate database indexes

 
Alexander Curvers
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i use

dunno why because does it do anything?

i would like it if it would generate the index in the database are there any tweaks or easy ways to have hibernate generate indexes i specify?


regards Alexander
 
Kadle Rajesh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we can use "index" attribute in column mapping like below, to create index:



This will be created when we run hbm2ddl tool.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you're using the proper package for the @Index annotation. The same annotation is defined in several libraries, which can cause issues.

-Cameron McKenzie
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!