Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* PI-1714

* PI-1714 refactor

* PI-1714 fix non unique
  • Loading branch information
anthony-britton-moj authored Dec 5, 2023
1 parent ba352be commit 4ea8ecd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ interface CustodyRepository : JpaRepository<Custody, Long> {

@Query(
"""
select c.id from Custody c
select distinct c.id from Custody c
join c.disposal d
join d.event e
where e.person.id = :personId
and c.softDeleted = false and c.status.code <> 'P' and c.bookingRef = :bookingRef
and d.active = true and d.softDeleted = false
and e.active = true and e.softDeleted = false
and e.active = true and e.softDeleted = false
"""
)
fun findCustodyId(personId: Long, bookingRef: String): List<Long>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Event(
val disposal: Disposal? = null,

@OneToOne(mappedBy = "event")
@SQLRestriction("active_flag = 1 and soft_deleted = 0")
val manager: OrderManager? = null,

@Column(updatable = false, columnDefinition = "NUMBER")
Expand Down

0 comments on commit 4ea8ecd

Please sign in to comment.