Example usage for org.hibernate Hibernate unproxy

List of usage examples for org.hibernate Hibernate unproxy

Introduction

In this page you can find the example usage for org.hibernate Hibernate unproxy.

Prototype

public static Object unproxy(Object proxy) 

Source Link

Document

Unproxies a HibernateProxy .

Usage

From source file:org.jbb.board.impl.forum.DefaultBoardService.java

License:Apache License

@Override
@Transactional(readOnly = true)/*from  w  ww  . j  a v a2  s. co  m*/
@CacheResult(cacheName = ForumCaches.BOARD_STRUCTURE)
public List<ForumCategory> getForumCategories() {
    List<ForumCategory> categories = categoryRepository.findAllByOrderByPositionAsc().stream()
            .map(entity -> (ForumCategory) Hibernate.unproxy(entity)).collect(Collectors.toList());

    categories.forEach(ForumCategory::getForums);

    return categories;
}