CommentRepositoryImpl.java

package com.tradecloud.repository.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.tradecloud.domain.comment.Comment;
import com.tradecloud.domain.comment.CommentType;
import com.tradecloud.repository.CommentRepository;

/**
 * Default implementation of the {@code CommentRepository} interface.
 */
@Repository(value = "commentRepository")
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
public class CommentRepositoryImpl extends RepositoryBaseImplNoSearch<Comment> implements CommentRepository {

    private static final long serialVersionUID = 1L;

    @Override
    public List<Comment> findByType(CommentType commentType) {
        List<Comment> list = (List<Comment>) findByNamedQueryAndNamedParam("comment.byType", "commentType", commentType);
        return list;
    }
}