Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:48:56+00:00 2026-06-13T02:48:56+00:00

I am trying to pull all the PostOrder’s out where a child instance is

  • 0

I am trying to pull all the PostOrder’s out where a child instance is present

My domain is as follows:

class PostOrder {

String pOrder
Date dateCreated
Picture picture
Post posts
Video video

static hasMany = [children : Child]
}

and the method i am trying to use to get the objects is:

 def getAllInOrder(Child child){
 def json =   PostOrder.findAllByChildren(child, sort: 'dateCreated', order: 'desc')    as JSON
    return json
}

I am just getting sql exceptions from this.
Any Ideas?

also these are my exceptions:

util.JDBCExceptionReporter No value specified for parameter 1
errors.GrailsExceptionResolver SQLException occurred when processing request: [GET]    /FYP/profile/appPosts - parameters:
child: 1
No value specified for parameter 1. Stacktrace follows: 
java.sql.SQLException: No value specified for parameter 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.PreparedStatement.checkAllParametersSet(PreparedStatement.java:2595)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2571)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2497)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2251)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:105)
at com.fyp.timeline.ProfileController$$ENmIB8q0.getAllInOrder(ProfileController.groovy:636)
at com.fyp.timeline.ProfileController$$ENmIB8q0.appPosts(ProfileController.groovy:624)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:48:57+00:00Added an answer on June 13, 2026 at 2:48 am

    Try

    PostOrder.findAllByChildren(child, [sort: 'dateCreated', order: 'desc'])
    

    Although I don’t think this will fix your problem entirely because in this instance, child is expected to be a list. Try this:

    PostOrder.all.findAll{it.children.contains(child)}
    

    It seems like there should be a better way to do that, maybe someone else can ring in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying pull a field out of a string and return it. My
I have a query that is trying to pull out all the questions in
I'm trying to figure out how to iterate through a document and pull all
I'm trying to pull all of the occurrences of a certain table out of
I'm trying to figure out how to pull all the records in my set
I'm trying to figure out a way to pull all tweets of a specific
The urls I'm trying to pull are all in the format of www.domain.com. I
So, I'm trying to pull all photos of a specific user's account via the
Hey guys, I am just trying to pull all the records from my database
I need a little help here please.What am trying to do is pull all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.