Example usage for javax.persistence PersistenceUnitUtil isLoaded

List of usage examples for javax.persistence PersistenceUnitUtil isLoaded

Introduction

In this page you can find the example usage for javax.persistence PersistenceUnitUtil isLoaded.

Prototype

public boolean isLoaded(Object entity);

Source Link

Document

Determine the load state of an entity belonging to the persistence unit.

Usage

From source file:br.ufba.dcc.mestrado.computacao.repository.impl.ProjectRepositoryImpl.java

@Override
public OpenHubProjectEntity findById(Long id) {

    OpenHubProjectEntity result = getEntityManager().find(getEntityClass(), id);

    PersistenceUnitUtil unitUtil = getEntityManager().getEntityManagerFactory().getPersistenceUnitUtil();
    if (unitUtil.isLoaded(result)) {
        initializeProject(result);//  w w  w .j  av a  2s .c  o  m
    }

    return result;

    /*
            
    return result;*/
}