package org.pdxfinder.repositories;

import org.pdxfinder.dao.Marker;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.Collection;
import java.util.List;

/**
 * Interface for Markers
 */
public interface MarkerRepository extends PagingAndSortingRepository<Marker, Long> {

    @Query("MATCH (t:Marker) WHERE t.symbol = {symbol} RETURN t")
    Marker findBySymbol(@Param("symbol") String symbol);

    @Query("MATCH (t:Marker) WHERE t.name = {name} RETURN t")
    Marker findByName(@Param("name") String name);

    @Query("MATCH (m:Marker) RETURN m")
    Collection<Marker> findAllMarkers();

    @Query("MATCH (s:Sample)--(:MolecularCharacterization)--(:MarkerAssociation)--(m:Marker) WHERE s.sourceSampleId = {sampleId}  return m")
    Collection<Marker> findAllBySampleId(@Param("sampleId") String sampleId);

}

@@ -735,24 +735,175 @@
 Markers();%0A%0A
+    @Query(%22MATCH (s:Sample)--(:MolecularCharacterization)--(:MarkerAssociation)--(m:Marker) RETURN m%22)%0A    Collection%3CMarker%3E findAllHumanMarkers();%0A%0A
     @Query(%22

Add method for human markers