How Hibernate sorts collection with @OrderColumn annotation?
<p>As I can see from generated SQL while querying entities with collection mapped like this:</p>

<pre><code>@ElementCollection(targetClass = Long.class, fetch = FetchType.EAGER)
@CollectionTable(name = "LIST_GAMES", 
                 joinColumns = @JoinColumn(name = "LIST_ID", referencedColumnName = "ID"))
@Column(name = "GAME_ID")
@OrderColumn(name = "GAME_ORDER")
private List&lt;Long&gt; gameIds;
</code></pre>

<p>Hibernate doesn't add any 'order by' statements to it. So does it mean, that collection is sorted in-memory after loading? Or does it means that I need a complex index on db level like (LIST_ID, GAME_ORDER) to handle order by in the db?</p>

<p><strong>UP:</strong> My question is actually <strong>HOW</strong> hibernate sorts this collection? Is It handled by hibernate in-memory or its retrieved already sorted from db? And am I need to create database index for GAME_ORDER column?</p>