|
|
DataNucleus Forum » List all forums » » Forum: Queries : JDOQL » » » Thread: JDODataStoreException when querring a collection in many to many relation |
|
| Print at May 17, 2012 10:51:22 AM | |
| Posted by stephbibie at May 22, 2006 2:58:05 PM |
|
JDODataStoreException when querring a collection in many to many relation Hello, I have 2 classes Critere and SousRubrique. Each class have a reference to the other. And I want to get all the Critere objects which have a specified SousRubrique. Here is my pojos : and my metadata file : So when I try to get the Critere objects by this way : I have this error : javax.jdo.JDODataStoreException: Error executing JDOQL query "SELECT 'modele.pojos.Critere' AS JPOXMETADATA,THIS.ID_CRITERE,THIS.NOM,THIS.NON_AFFICHE FROM CRITERES THIS WHERE EXISTS (SELECT 1 FROM ASSO_SOUS_RUBRIQUES_CRITERES THIS_SOUSRUBRIQUES_SR,SOUS_RUBRIQUES UNBOUND_SR WHERE THIS_SOUSRUBRIQUES_SR.ID_CRITERE = THIS.ID_CRITERE AND THIS_SOUSRUBRIQUES_SR.ID_CRITERE = THIS.ID_CRITERE AND UNBOUND_SR.ID_SOUS_RUBRIQUE = THIS_SOUSRUBRIQUES_SR.ID_SOUS_RUBRIQUE)" : Erreur de syntaxe près de 'EXISTS (SELECT 1 FROM ASSO_SOUS_RUBRIQUES_CRITERES THIS_SOUSRUBR' à la ligne 1I also tried like this : But I get the same error |
| Posted by erik at May 22, 2006 5:10:27 PM |
|
Re: JDODataStoreException when querring a collection in many to many relation This query should work, but it seems your database does not support it. which db are you using? we can try to find a workaround ---------------------------------------- Erik Bengtson ![]() |
| Posted by stephbibie at May 23, 2006 7:11:57 AM |
|
Re: JDODataStoreException when querring a collection in many to many relation I'm using MySQL 4.0.15 database |
| Posted by andy at May 23, 2006 8:03:05 AM |
|
Re: JDODataStoreException when querring a collection in many to many relation I'm using MySQL 4.0.15 database Use of EXISTS is stated in the JPOX docs http://www.jpox.org/docs/1_1/rdbms.html as only being supported by MySQL from 4.1 ---------------------------------------- -Andy ![]() ![]() |
| Posted by stephbibie at May 23, 2006 9:02:56 AM |
|
Re: JDODataStoreException when querring a collection in many to many relation You're right, I updated my MySQL version and now it works. Thanks a lot ! |
|
|
Current timezone is GMT May 17, 2012 10:51:22 AM |