From: Jochen R. <joc...@si...> - 2002-11-25 14:04:11
|
I have the following hibernate-mapping definition for "Friend" : <class name="buddy.database.Friend" table="friends"> <id column="friends_key" name="key" type="long"> <generator class="native"/> </id> <set role="meetings" lazy="true" table="participants"> <key type="long" column="friends_key"/> <many-to-many class="buddy.database.Meetings" column="meetings_key"/> </set> <property name="name" column="name" type="string" length="50"/> <property name="number" column="number" type="string" length="50" not-null="true"/> <!-- I want to index this element: ownernumber to speed up some queries : --> <property name="ownernumber" column="ownernumber" type="string" length="50" not-null="true"/> <property name="active" column="active" type="boolean" length="50" /> </class> In Mysql I have to add this line manually (after running the Schema generator) : create index ownerindex on friends (ownernumber); As I see in the DTD there is no way to specify an index for a normal property, am I wrong ? <!ELEMENT property (column*)> <!ATTLIST property name CDATA #REQUIRED> <!ATTLIST property type CDATA #IMPLIED> <!ATTLIST property column CDATA #IMPLIED> <!ATTLIST property length CDATA #IMPLIED> <!ATTLIST property not-null (true|false) "false"> <!ATTLIST property unique (true|false) "false"> Thanks for any help, Hibernate is great ! Jochen Rebhan joc...@si... |