PublisherActionRepository.java 569 Bytes
package org.legrog.entities;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface PublisherActionRepository extends JpaRepository<PublisherAction, Integer> {
    @Query("select pa from PublisherAction pa where pa.actionType = (select ua from ActionType ua where ua.actionTypeName = 'Validate') and pa.publisherActionDatetime = ( select max(pa2.publisherActionDatetime) from PublisherAction pa2 where pa2.publisher =?1)")
    PublisherAction publisherLastValidate(Publisher publisher);
}