package ub.scp2.boImpl;


import java.util.List;
import ub.scp2.bo.FileSubmissionBo;
import ub.scp2.dao.FileSubmissionDao;
import ub.scp2.entities.FileSubmission;
import ub.scp2.entities.Submission;


/**
 * LanguajeBoImpl.java -this class implements the LanguajeBo. This is the Business Object of the Languaje entity 
 * 
 *
 */
public class FileSubmissionBoImpl implements FileSubmissionBo, java.io.Serializable {
	
	private FileSubmissionDao fileSubmissionDao;

        @Override
        public void saveFileSubmission(FileSubmission fileSubmission) {
                fileSubmissionDao.saveFileSubmission(fileSubmission);
        }

        @Override
        public void deleteFileSubmission(FileSubmission fileSubmission) {
                fileSubmissionDao.deleteFileSubmission(fileSubmission);
        }

        @Override
        public void updateFileSubmission(FileSubmission fileSubmission) {
                fileSubmissionDao.updateFileSubmission(fileSubmission);
        }
        
        public void setFileSubmissionDao(FileSubmissionDao fileSubmissionDao) {
                this.fileSubmissionDao = fileSubmissionDao;
        }
        
            @Override
            public List<FileSubmission> getFileSubmissions() {
                    return this.fileSubmissionDao.getFileSubmissions();
            }
            
            @Override
            public void deleteSubmissionsByUser(Submission subm){
                if (subm.getId() == null) return;
                this.fileSubmissionDao.deleteSubmissionsByUser(subm.getId());
            }
}
