question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve error message when required field is missing in query [DATAJDBC-613]

See original GitHub issue

benzen opened DATAJDBC-613 and commented

In a repository I have the following method

@Query("""   select start, "end", timesheet.state from timesheet   join time_entry on time_entry.timesheet = timesheet.id   where   time_entry.project_id in (:projectIds); “”")}} public List<Timesheet> findByTimeEntryProjectIdIn(final List<Long> projectIds);

Here is the top part of the exception

An empty SqlIdentifier can't be used in to create column names java.lang.UnsupportedOperationException: An empty SqlIdentifier can't be used in to create column names at org.springframework.data.relational.core.sql.SqlIdentifier$1.getReference(SqlIdentifier.java:68) at org.springframework.data.jdbc.core.convert.SqlGenerator.renderReference(SqlGenerator.java:705) at org.springframework.data.jdbc.core.convert.SqlGenerator.getBindMarker(SqlGenerator.java:152) at org.springframework.data.jdbc.core.convert.SqlGenerator.buildConditionForBackReference(SqlGenerator.java:234) at org.springframework.data.jdbc.core.convert.SqlGenerator.getFindAllByProperty(SqlGenerator.java:219) at org.springframework.data.jdbc.core.convert.DefaultDataAccessStrategy.findAllByPath(DefaultDataAccessStrategy.java:348)   It's unclear to me what is happening`` here. I assume that it's related to the fact that one of my column use a reserved keyword. Could not find anything related to this issue


Attachments:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
viktorardeleancommented, Oct 28, 2022

@spring-projects-issues I would like to improve the error messaging here. From the last comment, I understand the issue was that a new “id” column was added to the “timesheet” DB table, and the code was using “GROUP BY” aggregation queries where the new column was missing.

My suggestion would be to change the error message from the SqlIdentifier from "An empty SqlIdentifier can't be used in to create column names" to "An empty SqlIdentifier can't be used in to create column names. Ensure that all selected fields are present in the aggregation clause"

Can I raise a PR with this?

0reactions
schaudercommented, Nov 2, 2022

Can I raise a PR with this?

Sure, go ahead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve error message when required field is missing in query ...
benzen opened DATAJDBC-613 and commented In a repository I have the following method @Query(""" select start, "end", timesheet.state from timesheet join ...
Read more >
Error 'required field is missing' when you deploy a change set
The error 'Required field is missing: sourceValues' is caused when report included in the Change Set contains a bucket field, ...
Read more >
Missing required field - Common causes and quick fixes - Opster
A detailed guide on how to resolve errors related to "Missing required field"
Read more >
Solved: Error messages if required fields not filled.
Solved: Hi I have a powerapps form connected to a SharePoint list. I have set OnFailure = ResetForm(SharePointForm1);Navigate(FailMessage,
Read more >
Salesforce Error: Required Fields are Missing
This error means that either a mapping was missing in a step of your connector, the field was missing in the response, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found