<commit_before>package gov.nih.nci.cabig.caaers.dao;

import gov.nih.nci.cabig.caaers.domain.LabViewerLab;
import gov.nih.nci.cabig.caaers.domain.StudyParticipantAssignment;
import gov.nih.nci.cabig.caaers.domain.report.Report;
import gov.nih.nci.cabig.ctms.dao.MutableDomainObjectDao;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;


/**
 * This class implements the Data access related operations for the LabViewerLab domain
 * object.
 * 
 * @author <NAME>
 */

@Transactional(readOnly = true)
public class LabViewerLabDao extends GridIdentifiableDao<LabViewerLab>
                implements MutableDomainObjectDao<LabViewerLab>{
	
    /**
     * Get the Class representation of the domain object that this DAO is representing.
     * 
     * @return Class representation of the domain object that this DAO is representing.
     */
    @Override
    public Class<LabViewerLab> domainClass() {
        return LabViewerLab.class;
    }
    
    /**
     * Save or update the adverse event lab viewer labs in the db.
     * 
     * @param 
     */
    @Transactional(readOnly = false)
    public void save(final LabViewerLab labViewerLab) {
        getHibernateTemplate().saveOrUpdate(labViewerLab);
    }
    
    /**
     * Get the list of LabViewerLabs based on the Assignment.
     * This is needed to rightly update the side nav bar on addition of a new lab viewer lab data .
     */
    @SuppressWarnings("unchecked")
	public List<LabViewerLab> getByAssignment(StudyParticipantAssignment assignment) {
        List<LabViewerLab> results = getHibernateTemplate().find("from LabViewerLab where assignment_id= ?", assignment.getId());
        return results;
    }
    
    /**
     * Delete report from db.
     * <commit_msg>order by lab_date<commit_after>package gov.nih.nci.cabig.caaers.dao;

import gov.nih.nci.cabig.caaers.domain.LabViewerLab;
import gov.nih.nci.cabig.caaers.domain.StudyParticipantAssignment;
import gov.nih.nci.cabig.caaers.domain.report.Report;
import gov.nih.nci.cabig.ctms.dao.MutableDomainObjectDao;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;


/**
 * This class implements the Data access related operations for the LabViewerLab domain
 * object.
 * 
 * @author <NAME>
 */

@Transactional(readOnly = true)
public class LabViewerLabDao extends GridIdentifiableDao<LabViewerLab>
                implements MutableDomainObjectDao<LabViewerLab>{
	
    /**
     * Get the Class representation of the domain object that this DAO is representing.
     * 
     * @return Class representation of the domain object that this DAO is representing.
     */
    @Override
    public Class<LabViewerLab> domainClass() {
        return LabViewerLab.class;
    }
    
    /**
     * Save or update the adverse event lab viewer labs in the db.
     * 
     * @param 
     */
    @Transactional(readOnly = false)
    public void save(final LabViewerLab labViewerLab) {
        getHibernateTemplate().saveOrUpdate(labViewerLab);
    }
    
    /**
     * Get the list of LabViewerLabs based on the Assignment.
     * This is needed to rightly update the side nav bar on addition of a new lab viewer lab data .
     */
    @SuppressWarnings("unchecked")
	public List<LabViewerLab> getByAssignment(StudyParticipantAssignment assignment) {
        List<LabViewerLab> results = getHibernateTemplate().find("from LabViewerLab where assignment_id= ? order by lab_date", assignment.getId());
        return results;
    }
    
    /**
     * Delete report from db.
     * 
{'fraction_non_alphanumeric': 0.08744394618834081, 'fraction_numerical': 0.0, 'mean_word_length': 3.2186761229314422, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1795880', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1076, 'n_words': 277}