Package fr.openwide.maven.artifact.notifier.core.business.artifact.dao

Source Code of fr.openwide.maven.artifact.notifier.core.business.artifact.dao.ArtifactNotificationRuleDaoImpl

package fr.openwide.maven.artifact.notifier.core.business.artifact.dao;

import org.springframework.stereotype.Repository;

import com.mysema.query.jpa.impl.JPAQuery;

import fr.openwide.core.jpa.business.generic.dao.GenericEntityDaoImpl;
import fr.openwide.maven.artifact.notifier.core.business.artifact.model.ArtifactNotificationRule;
import fr.openwide.maven.artifact.notifier.core.business.artifact.model.FollowedArtifact;
import fr.openwide.maven.artifact.notifier.core.business.artifact.model.QArtifactNotificationRule;

@Repository("artifactNotificationRuleDao")
public class ArtifactNotificationRuleDaoImpl extends GenericEntityDaoImpl<Long, ArtifactNotificationRule> implements IArtifactNotificationRuleDao {
 
  private static final QArtifactNotificationRule qArtifactNotificationRule = QArtifactNotificationRule.artifactNotificationRule;
 
  @Override
  public ArtifactNotificationRule getByFollowedArtifactAndRegex(FollowedArtifact followedArtifact, String regex) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifactNotificationRule)
      .where(qArtifactNotificationRule.followedArtifact.eq(followedArtifact))
      .where(qArtifactNotificationRule.regex.eq(regex));
   
    return query.uniqueResult(qArtifactNotificationRule);
  }
}
TOP

Related Classes of fr.openwide.maven.artifact.notifier.core.business.artifact.dao.ArtifactNotificationRuleDaoImpl

TOP
Copyright © 2018 www.massapi.com. 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.