-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Index names for base and inherited entities on Oracle
PostPosted: Thu Apr 03, 2014 7:19 am 
Newbie

Joined: Thu Apr 03, 2014 5:31 am
Posts: 1
Hi everyone,

i have the below setup:

@MappedSuperclass
public class BaseEntity {
@Index(name = "code")
private String code;

@Index(name = "active")
private Boolean active;

@Index(name = "valid")
private Boolean valid;
}

All other entities extend BaseEntity. This works fine on MySQL, as the index name must only be unique per table. On Oracle the index name must be unique per schema, as all indexes end up in the USER_INDEXES table.

Is there a possibility to tell hibernate to add an id to make the index name unique for Oracle? The only solution i found is using the @Tables annotation (see http://stackoverflow.com/questions/18272817/create-index-on-field-from-parent-class). This doesn't seem to work for me, it just ignores the annotation and doesn't create any index. Another problem is that i don't know all inherited entities at compile time as i'm in an OSGi environment.

At the moment i'm using JBoss EAP 6.0 and Hibernate 4.2.7. Upgrading JBoss EAP and Hibernate is not an option at the moment.

Thanks a lot for every hint!
Best regards,
Marcus


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.