Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.Attachment


     * @param unitAttachment
     * @throws EnMeExpcetion
     */
    public final void addAttachment(final UnitAttachment unitAttachment) throws EnMeExpcetion{
        try {
            Attachment attachment = new Attachment();
            attachment.setAttachmentId(unitAttachment.getAttachmentId());
            attachment.setFilename(unitAttachment.getFilename());
            attachment.setUploadDate(unitAttachment.getUploadDate());
            this.getProjectDaoImp().saveOrUpdate(attachment);
        } catch (Exception e) {
            throw new EnMeExpcetion(e);
        }
    }
View Full Code Here


    public Attachment createAttachment(
            final String filename,
            final Date uploadDate,
            final Project project
            ){
        final Attachment attachmentInfo = new Attachment();
        attachmentInfo.setFilename(filename);
        attachmentInfo.setUploadDate(uploadDate);
        attachmentInfo.setProjectAttachment(project);
        getProjectDaoImp().saveOrUpdate(attachmentInfo);
        return attachmentInfo;
    }
View Full Code Here

     * Test Get Attachment Info by Attachment Id.
     */
    @Test
    public void tesGetAttachmentbyId(){
        assertNotNull(attachment);
        Attachment attach = getProjectDaoImp().getAttachmentbyId(this.attachment.getAttachmentId());
        log.debug("Attachment id created before--> "+ attachment.getAttachmentId());
        log.debug("Attachment id retrieved -> "+ attach.getAttachmentId());
        assertEquals("Should be equals", this.attachment.getAttachmentId(), attach.getAttachmentId());
    }
View Full Code Here

        assertEquals("Should be equals", this.attachment.getAttachmentId(), attach.getAttachmentId());
    }

    @Test
    public void testGetAttachmentsListbyProject(){
        Attachment attachment2 = createAttachment("DojoReference.pdf", uploadDate, this.project);
        assertNotNull(attachment);
        assertNotNull(attachment2);
        final List<Attachment> attachList = getProjectDaoImp().getAttachmentsListbyProject(this.project.getProyectId());
        log.debug("Attach List -->" + attachList.size());
        assertEquals("Should be equals", 2, attachList.size());
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.Attachment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.