IPublication publication = InfoPublication.newDomainFromInfo(infoPublication);
IPublication publication = new Publication(); infoPublication.copyToDomain(infoPublication,publication);
    public void run(InfoPublication infoPublication) throws ExcepcaoPersistencia {        ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        IPersistentPublication persistentPublication = sp.getIPersistentPublication();        IPersistentPublicationAuthor persistentPublicationAuthor = sp.getIPersistentPublicationAuthor();        IPersistentPublicationType persistentPublicationType = sp.getIPersistentPublicationType();        //Write the authors to the AUTHOR table        List infoAuthorsList = infoPublication.getInfoPublicationAuthors();        //Call the InsertAuthors Service to insert in the DB the        // PublicationAuthors        final InsertPublicationAuthors ipa = new InsertPublicationAuthors();        final List authors = ipa.insertAuthors(infoAuthorsList);        //Write the Publication        IPublication publication = InfoPublication.newDomainFromInfo(infoPublication);        persistentPublication.simpleLockWrite(publication);        IPublicationType publicationType = (IPublicationType) persistentPublicationType.readByOID(                PublicationType.class, infoPublication.getInfoPublicationType().getIdInternal());        publication.setType(publicationType);        int i = 1;        for (final Iterator iterator = authors.iterator(); iterator.hasNext(); i++) {            final IAuthor author = (IAuthor) iterator.next();            final IPublicationAuthor publicationAuthor = new PublicationAuthor();            persistentPublicationAuthor.simpleLockWrite(publicationAuthor);            publicationAuthor.setAuthor(author);            author.getAuthorPublications().add(publicationAuthor);            publicationAuthor.setPublication(publication);            publication.getPublicationAuthors().add(publicationAuthor);            publicationAuthor.setOrder(new Integer(i));        }    }