There are open issues in published spec related to Index function:
1. When @OrderColumn specifies contiguous=false, should Index function return the position of the element in the collection as it fully materialized in-memory or the order column value stored in the table (database) ?
2. When @OrderColumn specifies columnDefinition of non-integral type, to what extent should Index function support non-integral types ?
3. When order column contains null value, what value should we return for index function on null value ?
The current implementation simply returns the OrderColumn value from the table in which the column is defined and assumes no null value in order columns.
As open issues get resolved in JPA2 Spec, the changes required to confirm to the spec will follow.