-->
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: @IndexColumn outputs incorrect mapping
PostPosted: Tue Aug 07, 2007 4:05 pm 
Newbie

Joined: Thu Jan 22, 2004 5:07 am
Posts: 9
Hi everyone,

Having trouble with the @IndexColumn annotation.

Hibernate version:
Hibernate Core 3.2.5.ga
Hibernate Annotations 3.3.0 GA
Hibernate Tools 3.2.0 Beta9



Annotations:

PARENT:
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "blog", updatable = false)
@IndexColumn(name="blogBlogEntriesIndex")
public List<BlogEntry> getBlogEntries() {
if (blogEntries == null)
blogEntries = new ArrayList<BlogEntry>();
return blogEntries;
}

CHILD:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "blog", insertable=false, updatable=false)
public Blog getBlog() {
return blog;
}


Mapping documents:

<list name="blogEntries" inverse="false">
<key>
<column name="blog" />
</key>
<index column="idx" />
<element type="string" column="dummy" />
</list>


Notice that the list should map to a "BlogEntry" entity, not a string element. Also note that the index column name is wrong.

However, if I remove the @IndexColumn annotation, the mapping comes out as you would expect:
Mapping documents:

<bag name="blogEntries" inverse="false">
<key>
<column name="blog" />
</key>
<one-to-many class="com.jkassis.bumpq.pojo.BlogEntry" />
</bag>


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.