Skip to content

Commit

Permalink
added admin features
Browse files Browse the repository at this point in the history
  • Loading branch information
carron10 committed Jun 13, 2024
1 parent 94dd624 commit 9d02128
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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);
}
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);
}

0 comments on commit 9d02128

Please sign in to comment.