im having trouble ordering items by 2 parameters. with either one of them it works just fine, but no matter which order i use when ordering after both, its the same in both cases, its allways sorted by lastname first.

EclipseLink parses Queries into DataBaseRecord's which extend AbstractRecord. AbstractRecord implements the Map interface, but uses two Vector<DatabaseField> for storing fields and values which preserves their insertion order. The MongoAdapter puts them into MongoRecord's. MongoRecord extends HashMap, but doesnt care for ordering - so the order by parameters get ordered by their hashCode's and the initial order gets lost.

If MongoRecord would extend LinkedHashMap rather than HashMap, this problem could be fixed.