-->
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.  [ 4 posts ] 
Author Message
 Post subject: @IndexColumn name default
PostPosted: Wed Dec 20, 2006 6:27 pm 
Newbie

Joined: Fri Oct 07, 2005 9:18 am
Posts: 2
I'm just starting with Hibernate annotations and JPA - everthing works great!

I really like that I don't need any database specific settings (e.g. table and column names). I don't want to keep them in my Java sources and I'm hesitant to use additional XML configurations.

But using indexed lists (not bags) spoils this impression:

Code:
@OneToMany(cascade = CascadeType.ALL)
@IndexColumn(name = "INDEX")
private List<Foo> children;


Why doesn't the Hibernate offer a default value for the 'name' element?
Won't it be called 'index' in most cases anyway - at least if your database doesn't grump on a homonymous keyword.

Couldn't Hibernate be smarter than I am (it probably is already ;) and default to a suitable index column name?

Sven


Top
 Profile  
 
 Post subject: Re: @IndexColumn name default
PostPosted: Wed Dec 20, 2006 7:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
svenmeier wrote:
Won't it be called 'index' in most cases anyway - at least if your database doesn't grump on a homonymous keyword.

you got it

Quote:
Couldn't Hibernate be smarter than I am (it probably is already ;) and default to a suitable index column name?

changing the default would mean non portability

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: @IndexColumn name default
PostPosted: Thu Dec 21, 2006 3:49 am 
Newbie

Joined: Fri Oct 07, 2005 9:18 am
Posts: 2
emmanuel wrote:
changing the default


Well, there's no default. That's what I'm complaining about:

http://www.hibernate.org/hib_docs/annotations/api/org/hibernate/annotations/IndexColumn.html

Sven


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 4:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If there is none, that's because I didn't find one when I developed the feature
IBut I'am not against, Open a JIRA issue if you come up with a decent name (index is not :-) )

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.