Can I create a custom criteria query like

user1452701

I have a legacy PostgreSql table that contains columns with multiple values. I want to select rows that contain any of the values in my search.

-- Example query
select * from stuff where ARRAY['Value A', 'Value X'] && regexp_split_to_array(thing, '\|');

Can I generate this type of where condition from Grails 2.5.1 GORM 4.x criteria query?

FYI: I have seen the "Grails Postgresql Extensions Plugin" but I can't change my column(s) definition at this time.

doelleri

You can use a sqlRestriction in a criteria to add arbitrary SQL conditions. It's mentioned at the bottom of the node reference for createCriteria().

Stuff.withCriteria {
    sqlRestriction "ARRAY['Value A', 'Value X'] && regexp_split_to_array(thing, '\|')"
}

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

In Android Room how can I create and call a custom query

分類Dev

How Can I Create A Custom Property Type

分類Dev

Create criteria query with counting summ of different columns

分類Dev

Can I Create a SQL Table Like this With to tables connectin to one?

分類Dev

I would like to use VBA to be able to create a new table from data in a different table that only includes rows of certain criteria

分類Dev

Can I create an extensible (through additional custom plugins) application on Haskell?

分類Dev

can I create custom ember-data methods?

分類Dev

How can i create a custom ListView with my xml layout file?

分類Dev

How can I create a custom view that only displays a grid of lines?

分類Dev

How do I create a service for a shell script so I can start and stop it like a daemon?

分類Dev

How to Create a Criteria Query with SUM and GROUP BY JPA Java

分類Dev

Create a subquery based on main query JPA Criteria API

分類Dev

How to create a MS Access query to show a data in columns by criteria?

分類Dev

How can I create a stack-allocated vector-like container?

分類Dev

How can I make a query that ignores the first two rows when I create a connection between workbooks

分類Dev

How can I optimize a BigQuery query that is insanely large due to a custom dimension?

分類Dev

how can i write this sql according to the following criteria

分類Dev

Is there any way I can filter with multiple criteria using jQuery?

分類Dev

How can i efficiently turn columns into 0 based on filter criteria?

分類Dev

How can I create UI-less custom function Excel add-ins?

分類Dev

Can I create a generic @Query that detects which parameters from URL are not null and make a search only by them with Spring?

分類Dev

In Azure DevOps, can I create a query that calculates project health based on PBI data?

分類Dev

Can I create a view that will query a table from another sql server on another server but same domain

分類Dev

MongoTemplate Criteria Query

分類Dev

Query Criteria Inquiry

分類Dev

How can I create a typesafe handle that behaves almost exactly like int64_t, but disallow implicit conversions between handle types?

分類Dev

Create custom type that will seem like the another when checking types Golang

分類Dev

Create custom rspec variable like response for controller specs

分類Dev

How can i create custom image view so that the pic which i have taken should be fit into that image view

Related 関連記事

  1. 1

    In Android Room how can I create and call a custom query

  2. 2

    How Can I Create A Custom Property Type

  3. 3

    Create criteria query with counting summ of different columns

  4. 4

    Can I Create a SQL Table Like this With to tables connectin to one?

  5. 5

    I would like to use VBA to be able to create a new table from data in a different table that only includes rows of certain criteria

  6. 6

    Can I create an extensible (through additional custom plugins) application on Haskell?

  7. 7

    can I create custom ember-data methods?

  8. 8

    How can i create a custom ListView with my xml layout file?

  9. 9

    How can I create a custom view that only displays a grid of lines?

  10. 10

    How do I create a service for a shell script so I can start and stop it like a daemon?

  11. 11

    How to Create a Criteria Query with SUM and GROUP BY JPA Java

  12. 12

    Create a subquery based on main query JPA Criteria API

  13. 13

    How to create a MS Access query to show a data in columns by criteria?

  14. 14

    How can I create a stack-allocated vector-like container?

  15. 15

    How can I make a query that ignores the first two rows when I create a connection between workbooks

  16. 16

    How can I optimize a BigQuery query that is insanely large due to a custom dimension?

  17. 17

    how can i write this sql according to the following criteria

  18. 18

    Is there any way I can filter with multiple criteria using jQuery?

  19. 19

    How can i efficiently turn columns into 0 based on filter criteria?

  20. 20

    How can I create UI-less custom function Excel add-ins?

  21. 21

    Can I create a generic @Query that detects which parameters from URL are not null and make a search only by them with Spring?

  22. 22

    In Azure DevOps, can I create a query that calculates project health based on PBI data?

  23. 23

    Can I create a view that will query a table from another sql server on another server but same domain

  24. 24

    MongoTemplate Criteria Query

  25. 25

    Query Criteria Inquiry

  26. 26

    How can I create a typesafe handle that behaves almost exactly like int64_t, but disallow implicit conversions between handle types?

  27. 27

    Create custom type that will seem like the another when checking types Golang

  28. 28

    Create custom rspec variable like response for controller specs

  29. 29

    How can i create custom image view so that the pic which i have taken should be fit into that image view

ホットタグ

アーカイブ