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>
|