diff --git a/projects/soc-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/ProbationAreaEntity.kt b/projects/soc-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/ProbationAreaEntity.kt index e2cc75ae4..4dbc4614a 100644 --- a/projects/soc-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/ProbationAreaEntity.kt +++ b/projects/soc-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/ProbationAreaEntity.kt @@ -93,8 +93,8 @@ interface ProbationAreaRepository : JpaRepository { from District d join d.borough b join b.probationArea pa - where pa.description not like 'ZZ%' - and (d.selectable = true or d.code like '%UAT' or d.code like '%UNA' or d.code like '%IAV') + where pa.description not like 'ZZ%' ESCAPE ' ' + and (d.selectable = true or d.code like '%UAT' ESCAPE ' ' or d.code like '%UNA' ESCAPE ' ' or d.code like '%IAV' ESCAPE ' ') and pa.selectable = true and (pa.establishment is null or pa.establishment <> 'Y') """ @@ -107,8 +107,8 @@ interface ProbationAreaRepository : JpaRepository { from District d join d.borough b join b.probationArea pa - where pa.description not like 'ZZ%' - and (d.selectable = true or d.code like '%UAT' or d.code like '%UNA' or d.code like '%IAV') + where pa.description not like 'ZZ%' ESCAPE ' ' + and (d.selectable = true or d.code like '%UAT' ESCAPE ' ' or d.code like '%UNA' ESCAPE ' ' or d.code like '%IAV' ESCAPE ' ') and (pa.establishment is null or pa.establishment <> 'Y') """ )