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: base offset not recognized when saving indexed collectio
PostPosted: Wed May 27, 2009 11:38 am 
Newbie

Joined: Wed May 27, 2009 11:18 am
Posts: 1
Hibernate 3.3.1.GA:

On fetch, the elements in schedSegMiscInfos are properly ordered, starting at the designated base index of "1"
But on parent.saveOrUpdate(), the value assigned to the SEG_MISC_INFO_ORDER field of a newly-appended child element is zero-based. Thus its index value is equal to (not one greater than) that of the formerly last list element.

This appears to be a bug. Any fix or work-around available?

Mapping in parent:
@Id
@Column(name = "SCHEDULE_SEGMENT_ID", unique = true, nullable = false)
private Long scheduleSegmentId;

@OneToMany(fetch = FetchType.LAZY)
@org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@JoinColumn(name = "SCHEDULE_SEGMENT_ID", nullable = false, updatable = false)
@org.hibernate.annotations.IndexColumn(name = "SEG_MISC_INFO_ORDER", base=1)
private List<SchedSegMiscInfo> schedSegMiscInfos =
new ArrayList<SchedSegMiscInfo>(0);

Mapping in child:
@Id
@Column(name = "SCHED_SEG_MISC_INFO_ID", unique = true, nullable = false, precision = 12, scale = 0)
private Long schedSegMiscInfoId;

@Column(name = "SCHEDULE_SEGMENT_ID", nullable = false, updatable = false, insertable = false)
private Long scheduleSegmentId;

@Column(name = "SEG_MISC_INFO_ORDER", nullable = false, updatable = false, insertable = false)
private Byte segMiscInfoOrder;


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.