I'm using Hibernate 3.3.2 connected to SQL Server Express 2008 and have Hibernate create my schema for me based on the mapping. I use the 'org.hibernate.tool.hbm2ddl.SchemaValidator' facility to do that.
When I connect to an empty DB, Hibernate nicely creates my schema, but I can't seem to get it to create indexes on my foreign keys in my 'many-to-one' collections. I creates the foreign key, but no index.
Can I get Hibernate to create this index for me?
Hibernate version:3.3.2
Mapping documents:Abbreviated class mapping file follow:
Code:
<hibernate-mapping package="xxxxxx">
<class name="AssessmentResult" table="ASSESSRESULT">
<id name="key" column="resultKey">
<generator class="native"/>
</id>
<property name="Name" type="string" column="name" length="128"/>
<many-to-one name="Client"
column="clientKey"
class="Client"
not-null="true"
index="fk_clientKey"
/>
</class>
</hibernate-mapping>