Skip to content

Commit

Permalink
fix #108, add specific workaround for mysql
Browse files Browse the repository at this point in the history
(cherry picked from commit 1844efd)
  • Loading branch information
syjer authored and cbellone committed Mar 24, 2016
1 parent 1d11e76 commit 5382f86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/alfio/repository/TicketRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

import alfio.model.FullTicketInfo;
import alfio.model.Ticket;
import ch.digitalfondue.npjt.Bind;
import ch.digitalfondue.npjt.Query;
import ch.digitalfondue.npjt.QueryRepository;
import ch.digitalfondue.npjt.QueryType;
import ch.digitalfondue.npjt.*;

import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -90,6 +87,9 @@ public interface TicketRepository {
int freeFromReservation(@Bind("reservationIds") List<String> reservationIds);

@Query("update ticket set category_id = null where tickets_reservation_id in (:reservationIds) and status in ('PENDING', 'OFFLINE_PAYMENT') and category_id in (select tc.id from ticket_category tc, ticket t where t.tickets_reservation_id in (:reservationIds) and t.category_id = tc.id and tc.bounded = false)")
@QueriesOverride({
@QueryOverride(db = "MYSQL", value = "update ticket set category_id = null where tickets_reservation_id in (:reservationIds) and status in ('PENDING', 'OFFLINE_PAYMENT') and category_id in (select * from (select tc.id from ticket_category tc, ticket t where t.tickets_reservation_id in (:reservationIds) and t.category_id = tc.id and tc.bounded = false) as sq)")
})
int resetCategoryIdForUnboundedCategories(@Bind("reservationIds") List<String> reservationIds);

@Query("update ticket set category_id = null where event_id = :eventId and category_id = :categoryId and id in (:ticketIds)")
Expand Down

0 comments on commit 5382f86

Please sign in to comment.