persistentPublicationTeacher.simpleLockWrite(publicationTeacher); publicationTeacher.setPublication(publication); publicationTeacher.setTeacher(teacher); publicationTeacher.setPublicationArea(PublicationArea.getEnum(publicationArea));
persistentPublicationTeacher.simpleLockWrite(publicationTeacher); publicationTeacher.setPublication(publication); publicationTeacher.setTeacher(teacher); publicationTeacher.setPublicationArea(PublicationArea.getEnum(publicationArea));  persistentTeacher.simpleLockWrite(teacher); teacher.getTeacherPublications().add(publicationTeacher); persistentPublication.simpleLockWrite(publication); publication.getPublicationTeachers().add(publicationTeacher); } else { throw new Exception("Business Logic bug"); }
    public SiteView run(Integer teacherId, Integer publicationId, String publicationArea)            throws ExcepcaoPersistencia {        InfoSitePublications infoSitePublications = new InfoSitePublications();        ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher();        ITeacher teacher = (ITeacher) persistentTeacher.readByOID(Teacher.class, teacherId);        InfoTeacher infoTeacher = Cloner.copyITeacher2InfoTeacher(teacher);        infoSitePublications.setInfoTeacher(infoTeacher);        IPersistentPublication persistentPublication = sp.getIPersistentPublication();        IPublication publication = (IPublication) persistentPublication.readByOID(Publication.class,                publicationId);        IPersistentPublicationTeacher persistentPublicationTeacher = sp                .getIPersistentPublicationTeacher();        IPublicationTeacher publicationTeacher = persistentPublicationTeacher                .readByTeacherAndPublication(teacher, publication);        if (publicationTeacher == null)            publicationTeacher = new PublicationTeacher();        persistentPublicationTeacher.simpleLockWrite(publicationTeacher);        publicationTeacher.setPublication(publication);        publicationTeacher.setTeacher(teacher);        publicationTeacher.setPublicationArea(PublicationArea.getEnum(publicationArea));        return null;    }