-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/java/com/ticket/TicketSystem/repositories/GameTicketRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | ||
*/ | ||
package com.ticket.TicketSystem.repositories; | ||
|
||
import com.ticket.TicketSystem.entities.Game; | ||
import com.ticket.TicketSystem.entities.Ticket; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* | ||
* @author Carron Muleya | ||
*/ | ||
@Repository | ||
public interface TicketRepository extends CrudRepository<Ticket, Long> { | ||
|
||
public Ticket findByType(String type); | ||
@Query("SELECT t FROM Ticket t WHERE LOWER(t.type)=LOWER(:type) AND game=:game") | ||
public Ticket findByTypeAndGameIdIgnoreCase(@Param("type") String type,@Param("game") Game game); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/ticket/TicketSystem/repositories/TeamRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | ||
*/ | ||
package com.ticket.TicketSystem.repositories; | ||
|
||
import com.ticket.TicketSystem.entities.Game; | ||
import com.ticket.TicketSystem.entities.Ticket; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* | ||
* @author Carron Muleya | ||
*/ | ||
@Repository | ||
public interface TicketRepository extends CrudRepository<Ticket, Long> { | ||
|
||
public Ticket findByType(String type); | ||
@Query("SELECT t FROM Ticket t WHERE LOWER(t.type)=LOWER(:type) AND game=:game") | ||
public Ticket findByTypeAndGameIdIgnoreCase(@Param("type") String type,@Param("game") Game game); | ||
} |