[Building Sakai] Hibernate indexes not created on trunk MySQL.
Matthew Buckett
matthew.buckett at it.ox.ac.uk
Tue Feb 19 03:52:49 PST 2013
This is all looking against hibernate 3.2.7 in trunk which will change once
KNL-515 is in trunk.
Ok, so I'm not sure this ever worked as looking at the code we have the
method:
org.springframework.orm.hibernate3.LocalSessionFactoryBean.createDatabaseSchema()
which as far as I can see is never called. And we also have:
org.springframework.orm.hibernate3.LocalSessionFactoryBean.updateDatabaseSchema()
which is called from:
org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterSessionFactoryCreation()
as long as we're allowing hibernate todo schema changes.
Now the problem is that the updateDatabaseSchema method calls through to:
org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Dialect,
DatabaseMetadata)
which doesn't support creating the indexes the normal way (the code is
commented out). But also doesn't support creating any database objects. So
I don't think additional indexes will ever get created through hibernate if
you use:
<property name="value" index="myindex">
or
<database-object>
<create>CREATE INDEX myindex ON mytable(value)</create>
<drop/>
</database-object>
--
Matthew Buckett, VLE Developer, IT Services, University of Oxford
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130219/b78b8084/attachment.html
More information about the sakai-dev
mailing list