-->
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.  [ 2 posts ] 
Author Message
 Post subject: Overwriting annotation attributes in subclasses
PostPosted: Wed Jan 17, 2007 7:09 am 
Newbie

Joined: Tue Feb 14, 2006 5:13 am
Posts: 18
i have various problems with schemageneration when using a @MappedSuperclass

    1. my superclass contains an @Index(name="col_idx"). having two entity subclasses leads to an schema-error, because the database doesn't allow tow indexes to have the same name. is there a way to enable automatic-index-name generation (like for foreign-key-constraint-names?)

    2. i want to define the @Id property in the superclass, but allow the subclasses to define/overwrite the @GeneratedValue attribute

    3. i would like to define a combined index in the superclass as well. beside the name-problem explained above, i don't know how: if i specify a @Index on a property any specified columnnames attribute is ignored. and using @org.hibernate.annotations.Table doen't work, because my superclass can't know the table name of the subclass @Entities


do i have to live with this and define all indexes again for each @entity-class instead of the superclass, or are there better ways?

thanks in advance
andi


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 8:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
using o.h.a.Table on subclasses should solve the issue I believe

As for id, you can define a generatedvalue name and define it in each sub classes, some people have used this strategy

_________________
Emmanuel


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

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.