Advertisement
emaringolo

Untitled

Jun 13th, 2016
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     | query |
  2.     query := SimpleQuery
  3.                 read: GptRepositor
  4.                 where: [ :each |
  5.                     ((each firstName like: '%one%') OR: [
  6.                         (each firstName like: '%two%' )
  7.                          OR: [each firstName like: '%three%']])
  8.                     AND: [
  9.                         ((each firstName like: '%four%') OR: [
  10.                         (each firstName like: '%five%' )
  11.                          OR: [each firstName like: '%six%']])
  12.                     ]
  13.                 ].
  14.     query executeIn: session.
  15.     ].
  16.  
  17. "
  18. Produces:
  19. SELECT t1.id, t1.user_id, t1.firstName, t1.lastName, t1.supervisor_id, t1.weeklyHours, t1.category, t1.contract, t1.alias1, t1.alias2, t1.alias3
  20.  FROM REPOSITOR t1
  21.  WHERE (((t1.firstName LIKE '%one%') OR ((t1.firstName LIKE '%two%') OR (t1.firstName LIKE '%three%'))) AND ((t1.firstName LIKE '%four%') OR ((t1.firstName LIKE '%five%') OR (t1.firstName LIKE '%six%'))))"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement