Retrieve first 10000 records from the database - grails

Illep

I have a class called News. The properties of this domain class are shown below.

String name
String age
Chat chat

I have saved several records in the database for the above class. Now i want to retrieve the first 10000 records of it and display below.

    def news = News.createCriteria().list (max: 10000, offset: 5) {
        like("chat", Chat.get(chatId)+"%")
    }

All what i get is an error :

//groovy.lang.MissingMethodException: No signature of method: com.project.mine.Chat.plus() is applicable for argument types: (java.lang.String) values: [%]

Joshua Moore

Based on further information in the comments, it would appear you are looking for a criteria something like this:

def news = News.createCriteria().list(max: 10000, offset: 5) {
  chat {
    eq("chatId", chatId) // assumes that chatId isn't the id of the Chat domain.
  }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PHP retrieve records from database

From Dev

Retrieve all parent/child records from database on Laravel (hierarchical data)

From Dev

Retrieve only today records from MySQL database using PHP

From Dev

Retrieve Data from Database Showing Records per User - Laravel

From Dev

Grails : Retrieve all latest children records

From Dev

How to retrieve data from the first row from database in php code

From Dev

How to retrieve data from the first row from database in php code

From Dev

Selectively retrieve data from tables when one record in first table is linked to multiple records in second table

From Dev

Paste 10000 records from excel sheet into a temp table

From Dev

Excel choosing x lowest values from 10000 records

From Dev

Retrieve records from database where a field equals multiple values in Symfony2

From Dev

What is the fastest way to retrieve a million records from an SQLite database file and display it in the WPF Datagrid?

From Dev

In MVC, how can I retrieve records from database matching a range of string serial numbers that include numbers?

From Dev

Grails: How do I retrieve records by a specific property?

From Dev

Get info from database in grails

From Dev

Get info from database in grails

From Dev

Quartz cronExpression from database in Grails

From Dev

Upload,Save and Retrieve Image from database by using their Id in Code First Method

From Dev

Upload,Save and Retrieve Image from database by using their Id in Code First Method

From Dev

Retrieve all data from the database got the second row same with the first row

From Dev

Retrieve the first value from a map

From Dev

how to Read 10000+ bytes[] of binary data from DataBase?

From Dev

SQL only retrieve first item in the database

From Dev

How to retrieve data using EF Database First

From Dev

Retrieve first two fields from the first column

From Dev

How to retrieve records from XML element with namespace?

From Dev

Retrieve records from Multiple tables using Join

From Dev

Retrieve data from changed rows records

From Dev

Not able to retrieve call records from Twilio in Laravel

Related Related

  1. 1

    PHP retrieve records from database

  2. 2

    Retrieve all parent/child records from database on Laravel (hierarchical data)

  3. 3

    Retrieve only today records from MySQL database using PHP

  4. 4

    Retrieve Data from Database Showing Records per User - Laravel

  5. 5

    Grails : Retrieve all latest children records

  6. 6

    How to retrieve data from the first row from database in php code

  7. 7

    How to retrieve data from the first row from database in php code

  8. 8

    Selectively retrieve data from tables when one record in first table is linked to multiple records in second table

  9. 9

    Paste 10000 records from excel sheet into a temp table

  10. 10

    Excel choosing x lowest values from 10000 records

  11. 11

    Retrieve records from database where a field equals multiple values in Symfony2

  12. 12

    What is the fastest way to retrieve a million records from an SQLite database file and display it in the WPF Datagrid?

  13. 13

    In MVC, how can I retrieve records from database matching a range of string serial numbers that include numbers?

  14. 14

    Grails: How do I retrieve records by a specific property?

  15. 15

    Get info from database in grails

  16. 16

    Get info from database in grails

  17. 17

    Quartz cronExpression from database in Grails

  18. 18

    Upload,Save and Retrieve Image from database by using their Id in Code First Method

  19. 19

    Upload,Save and Retrieve Image from database by using their Id in Code First Method

  20. 20

    Retrieve all data from the database got the second row same with the first row

  21. 21

    Retrieve the first value from a map

  22. 22

    how to Read 10000+ bytes[] of binary data from DataBase?

  23. 23

    SQL only retrieve first item in the database

  24. 24

    How to retrieve data using EF Database First

  25. 25

    Retrieve first two fields from the first column

  26. 26

    How to retrieve records from XML element with namespace?

  27. 27

    Retrieve records from Multiple tables using Join

  28. 28

    Retrieve data from changed rows records

  29. 29

    Not able to retrieve call records from Twilio in Laravel

HotTag

Archive