public static Institution getInstitution(IntactContext intactContext, User user) { Preference preference = user.getPreference(Preference.KEY_INSTITUTION_AC); if (preference != null) { String institutionAc = preference.getValue(); return intactContext.getDaoFactory().getInstitutionDao().getByAc(institutionAc); } return null; }
public static Institution getInstitution(IntactContext intactContext, User user) { Preference preference = user.getPreference(Preference.KEY_INSTITUTION_AC); if (preference != null) { String institutionAc = preference.getValue(); return intactContext.getDaoFactory().getInstitutionDao().getByAc(institutionAc); } return null; }
/** * Gets the institution from the RuntimeConfig object. In addition, tries to refresh * the instance from the database if it is detached. * * @return * @throws IntactException */ public Institution getInstitution() throws IntactException { Institution institution = config.getDefaultInstitution(); if (institution.getAc() != null && getDataContext().getDaoFactory().getInstitutionDao().isTransient(institution)) { institution = getDataContext().getDaoFactory().getInstitutionDao().getByAc(institution.getAc()); } return institution; }
/** * Gets the institution from the RuntimeConfig object. In addition, tries to refresh * the instance from the database if it is detached. * * @return * @throws IntactException */ public Institution getInstitution() throws IntactException { Institution institution = config.getDefaultInstitution(); if (institution.getAc() != null && getDataContext().getDaoFactory().getInstitutionDao().isTransient(institution)) { institution = getDataContext().getDaoFactory().getInstitutionDao().getByAc(institution.getAc()); } return institution; }
Institution owner = daoFactory.getInstitutionDao().getByAc( IntactContext.getCurrentInstance().getInstitution().getAc() );
Institution owner = daoFactory.getInstitutionDao().getByAc( IntactContext.getCurrentInstance().getInstitution().getAc() );