package org.codiki.core.repositories;

import java.util.List;

import org.codiki.core.entities.persistence.VersionRevision;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface VersionRevisionRepository extends CrudRepository<VersionRevision, Long> {
	
	@Query("SELECT vr FROM VersionRevision vr JOIN FETCH vr.version WHERE vr.version.number = :versionNumber")
	List<VersionRevision> findByVersionNumber(@Param("versionNumber") final String pVersionNumber);
}
