@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); }
/** * @return the {@link TemporalType} on the {@link Temporal} annotation of the given {@link Parameter}. */ @Nullable TemporalType getTemporalType() { if (temporalType == null) { this.temporalType = annotation == null ? null : annotation.value(); } return this.temporalType; }
@Query("SELECT COUNT(*) FROM ResourceHistoryTable t WHERE t.myUpdated >= :cutoff") int countForAllResourceTypes( @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );
/** * @return the {@link TemporalType} on the {@link Temporal} annotation of the given {@link Parameter}. */ TemporalType getTemporalType() { if (temporalType == null) { this.temporalType = annotation == null ? null : annotation.value(); } return this.temporalType; }
@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 );
/** * @return the {@link TemporalType} on the {@link Temporal} annotation of the given {@link Parameter}. */ TemporalType getTemporalType() { if (temporalType == null) { this.temporalType = annotation == null ? null : annotation.value(); } return this.temporalType; }
@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 );
/** * @return the {@link TemporalType} on the {@link Temporal} annotation of the given {@link Parameter}. */ @Nullable TemporalType getTemporalType() { if (temporalType == null) { this.temporalType = annotation == null ? null : annotation.value(); } return this.temporalType; }
@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.myResourceId = :id AND t.myUpdated >= :cutoff") int countForResourceInstance( @Param("id") Long theId, @Temporal(value = TemporalType.TIMESTAMP) @Param("cutoff") Date theCutoff );