Class HibernateMultiLoad

    • Method Detail

      • fixOrder

        public static <K extends Serializable,​T> List<T> fixOrder​(Function<T,​K> idFunction,
                                                                        List<T> objects,
                                                                        List<K> ids)
        Orders the given list according to the ids.
        Type Parameters:
        T - object type
        Parameters:
        idFunction - object to id
        objects - object list
        ids - ordered ids
        Returns:
        ordered list of objects
      • fixOrder

        public static <K extends Serializable,​T> List<T> fixOrder​(Function<T,​K> idFunction,
                                                                        List<T> objects,
                                                                        K... ids)
        Orders the given list according to the ids.
        Type Parameters:
        T - object type
        Parameters:
        idFunction - object to id
        objects - object list
        ids - ordered ids
        Returns:
        ordered list of objects