-->
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: UPdating A List With Set As IndexColumn
PostPosted: Tue May 13, 2008 10:54 am 
Beginner
Beginner

Joined: Tue Jul 04, 2006 11:29 am
Posts: 20
Location: Cambs, UK
Hi all,

I was just wonder if someone could tell me if I am doing this right. I've got a object defined like below:
Code:
@Entity
@Table(name = "STORE")
public class Store {
  @OneToMany(fetch = FetchType.LAZY)
  @JoinColumn(name = "STORE_ID", nullable = false, updatable = false)
  @org.hibernate.annotations.ForeignKey(name = "FK_FIELD_STORE_ID")
  @org.hibernate.annotations.IndexColumn(name = "FIELD_POSITION", nullable = false)
  private List<Field> fields = new ArrayList<Field>();

  // More Fields, Methods Etc. Here
}


I've rearranged the order of the list "fields" and have tried to persist this change but nothing is happening. I get no update SQL command showing (showsql is set to true). I believe my update code is fine as when I change another property on this item (e.g. name), the update goes through fine.

Is just changing the order of the fields list enough for it to show as updated and therefore indicate to Hibernate it needs persisting?

Cheers for any input,
Lee

(Using Hibernate 3.2.6 and MySql 5.x. Will post more info like mappings if people think it's needed)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.