I am using Hibernate's @OrderColumn annotation to order a list in my database. It correctly generates the column in the database table to store index and also stores the correct index initially.

But when I try to change the ordering in the list and then use Spring Roo's merge() method to update the database, the ordering doesn't change.

Here is the code for my entity:

Code:
@RooJavaBean
@RooToString
@RooEntity
public class Story {

    @ManyToMany(cascade = CascadeType.ALL)
    @OrderColumn
    private List<Slide> slides = new ArrayList<Slide>();

    @ManyToOne
    private Question question;

    private String title;

}
Here is the update method which calls merge function:

Code:
@RequestMapping(method = RequestMethod.PUT)
public String StoryController.update(@Valid Story story, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
        uiModel.addAttribute("story", story);
        return "storys/update";
    }
    uiModel.asMap().clear();
    story.merge();
    return "redirect:/storys/" + encodeUrlPathSegment(story.getId().toString(), httpServletRequest);
}
I have checked using debugging that the story object has the updated indices in the slides list.