Skip to content

LazyList and Collections.sort() and Collections.reverse() behavior #34

@helloariel

Description

@helloariel

Hi there,

I'm getting very inconsistent and buggy behavior when calling Collections.sort() and Collections.reverse() on the LazyLists returned by query.getResultList(). Basically, the lists are sometimes properly sorted and reversed and sometimes they are half sorted, not sorted in the right order, etc.

I couldn't narrow down the issue precisely but I assume it happens if the LazyList isn't fully populated. Couple questions:

  • Is there anyway to force the lazylist to be populated, or disable lazy loading altogether?
  • Is there any precautions I need to take for these lazy list to behave as normal lists?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions