Problem with sql - java.sql.SQLException: Operand should contain 1 column(s) (oncePassing empty list as parameter to JPA query throws errorHow can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?SQL select only rows with max value on a columnstatement . executeUpdate gives date truncated for column X at row 1 errorHibernate + spring-data: WrongClassException - object with id was not of the specified subclassfindByUuid() doesn't work in MySQL-DB when using HibernateHibernate NPE when using function() to call native sql method within jpaContinuous server request causing issue of hibernate exception unsafe use of sessionHibernate DefaultEntityAliases raises NullPointerExceptionCannot connect to MySQL on localhost using JDBC DriverUnable to create a table automatically and insert records using spring and hibernate integration
Crowbar circuit causes unexpected behavior for op amp circuit
Referring to different instances of the same character in time travel
What did indigenous North Americans trade amongst themselves before Europeans arrived?
(async () => )(); what is this?
Grammy Winners Grading
What is the Precise Definition of a “Complex Vector Space”?
Credit union holding car note, refuses to provide details of how payments have been applied
QGIS Welcome page: What is 'pin to list' for?
Trying to find a flaw in my proof that there are more rearrangements of an infinite series than real numbers
A DVR algebra with weird automorphisms
The monorail explodes before I can get on it
Why does Hellboy file down his horns?
How might the United Kingdom become a republic?
During copyediting, journal disagrees about spelling of paper's main topic
How to check the quality of an audio sample?
How can an advanced civilization forget how to manufacture its technology?
Optimising Table wrapping over a Select
Can I intentionally omit previous work experience or pretend it doesn't exist when applying for jobs?
Would letting a multiclass character rebuild their character to be single-classed be game-breaking?
Am I testing diodes properly?
I quit, and boss offered me 3 month "grace period" where I could still come back
How can one write good dialogue in a story without sounding wooden?
How did the Game Boy Advance stretch Game Boy games to widescreen?
Why isn't there research to build a standard lunar, or Martian mobility platform?
Problem with sql - java.sql.SQLException: Operand should contain 1 column(s) (once
Passing empty list as parameter to JPA query throws errorHow can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?SQL select only rows with max value on a columnstatement . executeUpdate gives date truncated for column X at row 1 errorHibernate + spring-data: WrongClassException - object with id was not of the specified subclassfindByUuid() doesn't work in MySQL-DB when using HibernateHibernate NPE when using function() to call native sql method within jpaContinuous server request causing issue of hibernate exception unsafe use of sessionHibernate DefaultEntityAliases raises NullPointerExceptionCannot connect to MySQL on localhost using JDBC DriverUnable to create a table automatically and insert records using spring and hibernate integration
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm using Spring Data for select operation on MySql DataBase.
I'm trying to get all Institutions by listOfWhomHelp
.
I expected all records(institutions
) which contain listOfWhomHelp
, but if I choose more than one element in listOfWhomHelp
it throws me:
java.sql.SQLException: Operand should contain 1 column(s)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
Repository method
List<Institution> findAllByWhomHelp(List<InstitutionListOfWhomHelp> institutionListOfWhomHelp);
Service method
public List<Institution> findInstitutions(Institution institution) throws NullPointerException
if(institution.getInstitutionLocations().isEmpty())
return institutionRepository.findAllByWhomHelp(institution.getWhomHelp());
There is also list of InstitutionLocation
, but I always choose on of them
Institution
@NotEmpty
@ManyToMany
private List<InstitutionListOfWhomHelp> whomHelp;
InstitutionListOfWhomHelp
@NotBlank
private String whomHelp;
@ManyToMany(mappedBy = "whomHelp")
private List<Institution> institution;
java mysql hibernate jpa spring-data
add a comment |
I'm using Spring Data for select operation on MySql DataBase.
I'm trying to get all Institutions by listOfWhomHelp
.
I expected all records(institutions
) which contain listOfWhomHelp
, but if I choose more than one element in listOfWhomHelp
it throws me:
java.sql.SQLException: Operand should contain 1 column(s)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
Repository method
List<Institution> findAllByWhomHelp(List<InstitutionListOfWhomHelp> institutionListOfWhomHelp);
Service method
public List<Institution> findInstitutions(Institution institution) throws NullPointerException
if(institution.getInstitutionLocations().isEmpty())
return institutionRepository.findAllByWhomHelp(institution.getWhomHelp());
There is also list of InstitutionLocation
, but I always choose on of them
Institution
@NotEmpty
@ManyToMany
private List<InstitutionListOfWhomHelp> whomHelp;
InstitutionListOfWhomHelp
@NotBlank
private String whomHelp;
@ManyToMany(mappedBy = "whomHelp")
private List<Institution> institution;
java mysql hibernate jpa spring-data
don't you think it should use!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `
– RAHUL ROY
Mar 26 at 5:03
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
But the problem is thatinstitution.getWhomHelp()
isn't empty - i checked this before.This is the way when listinstitution.getInstitutionLocations()
is empty andwhomHelp
isn't. I've also take care of NullPointerException
– Michał Tomala
Mar 26 at 6:03
add a comment |
I'm using Spring Data for select operation on MySql DataBase.
I'm trying to get all Institutions by listOfWhomHelp
.
I expected all records(institutions
) which contain listOfWhomHelp
, but if I choose more than one element in listOfWhomHelp
it throws me:
java.sql.SQLException: Operand should contain 1 column(s)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
Repository method
List<Institution> findAllByWhomHelp(List<InstitutionListOfWhomHelp> institutionListOfWhomHelp);
Service method
public List<Institution> findInstitutions(Institution institution) throws NullPointerException
if(institution.getInstitutionLocations().isEmpty())
return institutionRepository.findAllByWhomHelp(institution.getWhomHelp());
There is also list of InstitutionLocation
, but I always choose on of them
Institution
@NotEmpty
@ManyToMany
private List<InstitutionListOfWhomHelp> whomHelp;
InstitutionListOfWhomHelp
@NotBlank
private String whomHelp;
@ManyToMany(mappedBy = "whomHelp")
private List<Institution> institution;
java mysql hibernate jpa spring-data
I'm using Spring Data for select operation on MySql DataBase.
I'm trying to get all Institutions by listOfWhomHelp
.
I expected all records(institutions
) which contain listOfWhomHelp
, but if I choose more than one element in listOfWhomHelp
it throws me:
java.sql.SQLException: Operand should contain 1 column(s)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
Repository method
List<Institution> findAllByWhomHelp(List<InstitutionListOfWhomHelp> institutionListOfWhomHelp);
Service method
public List<Institution> findInstitutions(Institution institution) throws NullPointerException
if(institution.getInstitutionLocations().isEmpty())
return institutionRepository.findAllByWhomHelp(institution.getWhomHelp());
There is also list of InstitutionLocation
, but I always choose on of them
Institution
@NotEmpty
@ManyToMany
private List<InstitutionListOfWhomHelp> whomHelp;
InstitutionListOfWhomHelp
@NotBlank
private String whomHelp;
@ManyToMany(mappedBy = "whomHelp")
private List<Institution> institution;
java mysql hibernate jpa spring-data
java mysql hibernate jpa spring-data
edited Mar 26 at 5:42
Ali Azim
11813 bronze badges
11813 bronze badges
asked Mar 26 at 4:56
Michał TomalaMichał Tomala
132 bronze badges
132 bronze badges
don't you think it should use!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `
– RAHUL ROY
Mar 26 at 5:03
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
But the problem is thatinstitution.getWhomHelp()
isn't empty - i checked this before.This is the way when listinstitution.getInstitutionLocations()
is empty andwhomHelp
isn't. I've also take care of NullPointerException
– Michał Tomala
Mar 26 at 6:03
add a comment |
don't you think it should use!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `
– RAHUL ROY
Mar 26 at 5:03
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
But the problem is thatinstitution.getWhomHelp()
isn't empty - i checked this before.This is the way when listinstitution.getInstitutionLocations()
is empty andwhomHelp
isn't. I've also take care of NullPointerException
– Michał Tomala
Mar 26 at 6:03
don't you think it should use
!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `– RAHUL ROY
Mar 26 at 5:03
don't you think it should use
!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `– RAHUL ROY
Mar 26 at 5:03
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
But the problem is that
institution.getWhomHelp()
isn't empty - i checked this before.This is the way when list institution.getInstitutionLocations()
is empty and whomHelp
isn't. I've also take care of NullPointerException– Michał Tomala
Mar 26 at 6:03
But the problem is that
institution.getWhomHelp()
isn't empty - i checked this before.This is the way when list institution.getInstitutionLocations()
is empty and whomHelp
isn't. I've also take care of NullPointerException– Michał Tomala
Mar 26 at 6:03
add a comment |
1 Answer
1
active
oldest
votes
Can you try like bottom
instituonRepository.findAllByWhomHelpIn
Thanks
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350088%2fproblem-with-sql-java-sql-sqlexception-operand-should-contain-1-columns-on%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Can you try like bottom
instituonRepository.findAllByWhomHelpIn
Thanks
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
add a comment |
Can you try like bottom
instituonRepository.findAllByWhomHelpIn
Thanks
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
add a comment |
Can you try like bottom
instituonRepository.findAllByWhomHelpIn
Thanks
Can you try like bottom
instituonRepository.findAllByWhomHelpIn
Thanks
answered Mar 26 at 7:15
Musa AyMusa Ay
1314 bronze badges
1314 bronze badges
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
add a comment |
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
It's working ,really thank you !!
– Michał Tomala
Mar 26 at 8:26
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350088%2fproblem-with-sql-java-sql-sqlexception-operand-should-contain-1-columns-on%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
don't you think it should use
!
like ` if(! institution.getWhomHelp().isEmpty()) return institutionRepository.findAllByWhomHelp(institution.getWhomHelp()); `– RAHUL ROY
Mar 26 at 5:03
you can check here or here.
– RAHUL ROY
Mar 26 at 5:07
But the problem is that
institution.getWhomHelp()
isn't empty - i checked this before.This is the way when listinstitution.getInstitutionLocations()
is empty andwhomHelp
isn't. I've also take care of NullPointerException– Michał Tomala
Mar 26 at 6:03