Code example for Session

Methods: get

0
        PersistenceController<?> controller = (PersistenceController<?>)Component.getInstance(controllerName);
        Session session = (Session)controller.getPersistenceContext();
        Serializable id = (Serializable)Entity.forClass(entity.getClass()).getIdentifier(entity);
        if (id == null)
            return null; 
        return session.get(entity.getClass(), id);
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java