Skip to content

Commit

Permalink
Multi-datasources with where and criteria queries (#57)
Browse files Browse the repository at this point in the history
* Multi-datasources with where and criteria queries

* Display in multiple line
  • Loading branch information
sdelamo committed Sep 14, 2022
1 parent 82b05bd commit fc38e1e
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -23,3 +23,22 @@ zipCode.auditing.save()
----

As you can see, you add the `DataSource` to the method call in both the static case and the instance case.

You can use `Where` queries:

[source,groovy]
----
def results = ZipCode.where {
code ==~ '995%'
}.withConnection('auditing').list()
----

or `Criteria` queries:

[source,groovy]
----
def c = ZipCode.auditing.createCriteria()
def results = c.list {
like('code','995%')
}
----

0 comments on commit fc38e1e

Please sign in to comment.