Search in sources :

Example 1 with StudyProgrammeCreatedEvent

use of fi.otavanopisto.pyramus.events.StudyProgrammeCreatedEvent in project pyramus by otavanopisto.

the class StudyProgrammeDAO method create.

public StudyProgramme create(Organization organization, String name, StudyProgrammeCategory category, String code, boolean hasEvaluationFees) {
    EntityManager entityManager = getEntityManager();
    StudyProgramme studyProgramme = new StudyProgramme();
    studyProgramme.setOrganization(organization);
    studyProgramme.setName(name);
    studyProgramme.setCategory(category);
    studyProgramme.setCode(code);
    studyProgramme.setHasEvaluationFees(hasEvaluationFees);
    entityManager.persist(studyProgramme);
    studyProgrammeCreatedEvent.fire(new StudyProgrammeCreatedEvent(studyProgramme.getId()));
    return studyProgramme;
}
Also used : EntityManager(javax.persistence.EntityManager) StudyProgramme(fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme) StudyProgrammeCreatedEvent(fi.otavanopisto.pyramus.events.StudyProgrammeCreatedEvent)

Aggregations

StudyProgramme (fi.otavanopisto.pyramus.domainmodel.base.StudyProgramme)1 StudyProgrammeCreatedEvent (fi.otavanopisto.pyramus.events.StudyProgrammeCreatedEvent)1 EntityManager (javax.persistence.EntityManager)1