@Query("select t from Transaction t join fetch t.order to left join fetch to.orderAttributes toa left join fetch to.orderProducts too left join fetch to.orderTotal toot left join fetch to.orderHistory tood where to is not null and t.transactionDate BETWEEN :from AND :to") List<Transaction> findByDates( @Param("from") @Temporal(javax.persistence.TemporalType.TIMESTAMP) Date startDate, @Param("to") @Temporal(javax.persistence.TemporalType.TIMESTAMP) Date endDate); }
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myResourceId = :id AND t.myUpdated >= :cutoff") int countForResourceInstance( @Param("id") Long theId, @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myResourceType = :type AND t.myUpdated >= :cutoff") int countForResourceType( @Param("type") String theType, @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myUpdated >= :cutoff") int countForAllResourceTypes( @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myResourceType = :type AND t.myUpdated >= :cutoff") int countForResourceType( @Param("type") String theType, @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myUpdated >= :cutoff") int countForAllResourceTypes( @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myResourceId = :id AND t.myUpdated >= :cutoff") int countForResourceInstance( @Param("id") Long theId, @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );