-->
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: Why Index not Created in Hibernate Spring?
PostPosted: Tue Sep 21, 2010 3:43 am 
Newbie

Joined: Mon Sep 13, 2010 2:51 am
Posts: 2
Hi
I want to create index for my table in SQL SERVER.
When I used
<prop key="hibernate.hbm2ddl.auto">create</prop>
or
<prop key="hibernate.hbm2ddl.auto">create-drop</prop>
Hibernate created my index, but I used
<prop key="hibernate.hbm2ddl.auto">update</prop>
my index not create in my column.
For example:
<property name="name" type="java.lang.String">
<column name="Name" sql-type="nvarchar(255)" unique="true" not-null="true" index="NAME_INDEX"/>
</property>
My database is exist and I went to update columns for create index.
Why my index doesn’t update?


Top
 Profile  
 
 Post subject: Re: Why Index not Created in Hibernate Spring?
PostPosted: Tue Sep 21, 2010 6:01 am 
Senior
Senior

Joined: Fri May 08, 2009 12:27 pm
Posts: 168
If you're trying to make Hibernate Tools update the structure of an existing database: this does not work, that's beyond the capabilities of Hibernate Tools.

hbm2ddl is intended to set up a new database. Either to generate the SQL that will set up a database for a clean install, or to create and initialize a database with test data.

(This is what I have gleaned from various statements by Hibernate Tools developers in this forum, so I may be missing relevant detail.)


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.