Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [teneo] Issues adding additional indexes to my entity using @Index
[teneo] Issues adding additional indexes to my entity using @Index [message #621893] Fri, 04 December 2009 19:58 Go to next message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
I am having some difficulties adding additional indexes to my tables using Teneo+Hibernate. I followed the documentation and added an annotation to the structural feature I want indexed:
@Index(name="myindex")

I see that the generated hibernate file contains the index attribute but my table doesnt contain the additional index (myindex). Here is the Hibernate property mapping generated by Teneo:

<property name="mycol" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String" index="mytable_mycol_index">
<column not-null="false" unique="false" name="`mycol`" index="mytable_mycol_index"/>
</property>

I also dropped the whole db to have Hibernate recreated the tables from scratch in MySQL but I cant seem to get the index automatically created.

Any ideas?

thanks in advance,
Re: [teneo] Issues adding additional indexes to my entity using @Index [message #621895 is a reply to message #621893] Fri, 04 December 2009 20:38 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi lemao,
Hibernate does not add indexes when updating an existing schema (at least not afaik).
It is strange though that the index is not added when recreating the complete schema. I would try to enable hbm2ddl
logging to see more details.
See here:
http://www.elver.org/hibernate/troubleshooting.html#runtime

My experience is that if the rdb schema create statements fail that hibernate will still continue/startup. So it is easy
to miss them.

Btw, support for Teneo is given on the main EMF newsgroup which I added as cc.

gr. Martin

Lemao wrote:
> I am having some difficulties adding additional indexes to my tables
> using Teneo+Hibernate. I followed the documentation and added an
> annotation to the structural feature I want indexed:
> @Index(name="myindex")
>
> I see that the generated hibernate file contains the index attribute but
> my table doesnt contain the additional index (myindex). Here is the
> Hibernate property mapping generated by Teneo:
>
> <property name="mycol" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String"
> index="mytable_mycol_index">
> <column not-null="false" unique="false" name="`mycol`"
> index="mytable_mycol_index"/>
> </property>
>
> I also dropped the whole db to have Hibernate recreated the tables from
> scratch in MySQL but I cant seem to get the index automatically created.
>
> Any ideas?
>
> thanks in advance,


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[teneo] Issues adding additional indexes to my entity using @Index
Next Topic:[EWM] Proposed API changes
Goto Forum:
  


Current Time: Wed Jun 23 19:25:27 GMT 2021

Powered by FUDForum. Page generated in 0.01967 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top