mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-06-30 20:43:42 +02:00
25 lines
780 B
Java
25 lines
780 B
Java
|
package catering.order;
|
||
|
|
||
|
import catering.catalog.Rentable;
|
||
|
import org.salespointframework.inventory.UniqueInventory;
|
||
|
import org.salespointframework.inventory.UniqueInventoryItem;
|
||
|
import org.salespointframework.order.Order;
|
||
|
import org.salespointframework.quantity.Quantity;
|
||
|
import org.springframework.data.jpa.repository.Query;
|
||
|
import org.springframework.data.util.Streamable;
|
||
|
import org.springframework.data.repository.Repository;
|
||
|
|
||
|
import java.time.LocalDateTime;
|
||
|
|
||
|
public interface CustomOrderRepository extends Repository<CustomOrder, Order.OrderIdentifier>{
|
||
|
|
||
|
@Query("""
|
||
|
select order from #{#entityName} order
|
||
|
where
|
||
|
not order.start > ?2 and
|
||
|
not order.finish < ?1
|
||
|
""")
|
||
|
Streamable<CustomOrder> findOrdersByInterval(LocalDateTime start, LocalDateTime finish);
|
||
|
|
||
|
}
|