From: Bonny R. (JIRA) <no...@at...> - 2006-03-22 15:23:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-710?page=comments#action_22558 ] Bonny Rais commented on HHH-710: -------------------------------- This is one of the problems - the fact that currently there's no way to create multiple indexes. Moreover, the fact that the columns cannot be organized may mean that typical queries would execute more slowly because of the arbitrary ordering of index columns. > Multi Column Index / Column in Multiple Indexes feature > ------------------------------------------------------- > > Key: HHH-710 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-710 > Project: Hibernate3 > Type: New Feature > Components: core > Versions: 3.0.5 > Environment: N/A > Reporter: Bonny Rais > > > There are many requests in the forum regarding Multi Column Index, > declared separately from property declarations in mapping files. > Hibernate already supports this capability, but only by way of > marking a property as participant in an index using the index > attribute in mapping files. Recent enhancement means that the > same column can be declared to be in multiple indexes. > However, there is no control over the order of columns in the index > or whether the index is unique. > I've had a go at implementing this feature and to the best of my > ability to check, there are minor modifications required: > 1. The DTD needs to change in two places: > a. The class entity requires having a new entity reference to the > index clause ( add a '(index)*,' after the property references) > b. add two attributes to the index entity itself: 'name' and > 'unique' and make them implied to ensure backwards compatibility. > 2. HbmBinder.java needs to have a small fragment added to detect the > index element within the class node and use the currently existing > methods to add or create indexes. > I can produce a patch file to show these differences, so people in the > Hibernate team can have a look and comment. > I have tested this in my environment, which admittedly is not very > large or representative of all scenarios, but it works and works well. > Cheers, > Bonny -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |