dnet-applications/libs/dnet-is-common/src/main/java/eu/dnetlib/is/resource/repository/SimpleResourceRepository.java

18 lines
642 B
Java

package eu.dnetlib.is.resource.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import eu.dnetlib.is.resource.model.SimpleResource;
public interface SimpleResourceRepository extends JpaRepository<SimpleResource, String> {
@Query(value = "select content from resources where id = :id", nativeQuery = true)
String getContentById(String id);
@Modifying
@Query(value = "update resources set content = :content where id = :id", nativeQuery = true)
String setContentById(String id, String content);
}