package edu.northwestern.bioinformatics.studycalendar.dao;

import edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Rhett Sutphin
 */
@Transactional (readOnly=true)
public class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao<PlannedActivity> {
    @Override
    public Class<PlannedActivity> domainClass() {
        return PlannedActivity.class;
    }

    @Transactional(readOnly=false)
    public void delete(PlannedActivity event) {
        getHibernateTemplate().delete(event);
    }

    public List<PlannedActivity> getPlannedActivitiesForAcivity(Integer activityId) {

        return (List<PlannedActivity>) getHibernateTemplate().find("select pa from PlannedActivity as pa where pa.activity.id=?",activityId);
    }

   
}

package edu.northwestern.bioinformatics.studycalendar.dao;

import edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Rhett Sutphin
 */
@Transactional (readOnly=true)
public class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao<PlannedActivity> {
    @Override
    public Class<PlannedActivity> domainClass() {
        return PlannedActivity.class;
    }

    /**
    * Deletes a planned activity
    *
    * @param  event the planned activity to delete
    */
    @Transactional(readOnly=false)
    public void delete(PlannedActivity event) {
        getHibernateTemplate().delete(event);
    }

    /**
    * Finds all planned activities for a activity id
    *
    * @param  activityId the activity id to search with
    * @return      a list of planned activities with the activity id passed in
    */
    public List<PlannedActivity> getPlannedActivitiesForAcivity(Integer activityId) {
        return (List<PlannedActivity>) getHibernateTemplate().find("select pa from PlannedActivity as pa where pa.activity.id=?",activityId);
    }
}

Add javadoc to planned activity dao.
Add javadoc to planned activity dao.

git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@2431 0d517254-b314-0410-acde-c619094fa49f
