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.userAction = (select ua from UserAction ua where ua.userActionName = 'Validate') and pa.publisherActionDatetime = ( select max(pa2.publisherActionDatetime) from PublisherAction pa2 where pa2.publisher =?1)")
    PublisherAction publisherLastValidate(Publisher publisher);
}