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;








2















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;









share|improve this question
























  • 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 list institution.getInstitutionLocations() is empty and whomHelp isn't. I've also take care of NullPointerException

    – Michał Tomala
    Mar 26 at 6:03

















2















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;









share|improve this question
























  • 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 list institution.getInstitutionLocations() is empty and whomHelp isn't. I've also take care of NullPointerException

    – Michał Tomala
    Mar 26 at 6:03













2












2








2








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;









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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 list institution.getInstitutionLocations() is empty and whomHelp 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












1 Answer
1






active

oldest

votes


















1














Can you try like bottom



instituonRepository.findAllByWhomHelpIn


Thanks






share|improve this answer























  • It's working ,really thank you !!

    – Michał Tomala
    Mar 26 at 8:26










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
);



);













draft saved

draft discarded


















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









1














Can you try like bottom



instituonRepository.findAllByWhomHelpIn


Thanks






share|improve this answer























  • It's working ,really thank you !!

    – Michał Tomala
    Mar 26 at 8:26















1














Can you try like bottom



instituonRepository.findAllByWhomHelpIn


Thanks






share|improve this answer























  • It's working ,really thank you !!

    – Michał Tomala
    Mar 26 at 8:26













1












1








1







Can you try like bottom



instituonRepository.findAllByWhomHelpIn


Thanks






share|improve this answer













Can you try like bottom



instituonRepository.findAllByWhomHelpIn


Thanks







share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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








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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현