google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

unable to query using com.​google.​code.​morphia.​query.​FieldEnd.in(Iterable itrbl) #381

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version are you using? (Morphia/Driver/MongoDB)
I am using morphia-0.99.jar/mongo-java-driver-2.3.jar/mongodb-2.0.

Please include a stack trace below:
Before describing my problem, I would like to tell you that it worked fine with 
morphia-0.98.jar/mongo-java-driver-2.3.jar/mongodb-2.0.

===================================================================
|PROBLEM                                                          |
===================================================================
I am trying to create a Query with multiple filter conditions like:
SELECT * from COMPONENT
WHERE COMPONENT.TYPE = TYPE_INDIFFERENT OR COMPONENT.TYPE = TYPE_CORE

For this, i used the following code sequence:

Query q = datastore.createQuery(Component.class);
if (null != componentSearchCriteria.getComponentType()) {
 List<ComponentType> componentTypes = new ArrayList<ComponentType>();
 componentTypes.add(componentSearchCriteria.getComponentType());
 componentTypes.add(ComponentType.TYPE_INDIFFERENT);
 q.field("componentInformation.componentType").in(componentTypes);
}
===================================================================

Original issue reported on code.google.com by manolach...@gmail.com on 22 Feb 2012 at 6:59

GoogleCodeExporter commented 9 years ago
no exception thrown 

Original comment by manolach...@gmail.com on 22 Feb 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Can you try with the latest snapshot please?

Original comment by scotthernandez on 23 Feb 2012 at 5:25

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for your quick response.

Just tested with morphia 0.99.1-SNAPSHOT.jar, and it generates the following 
error during unit testing:

================================================================================
==
Testing delete component...
2012-02-24 13:32:52,078 INFO  [main] 
com.company.lps.oodbcore.services.OODBComponentService - Deleting components...
------------- ---------------- ---------------
------------- Standard Error -----------------
Feb 24, 2012 1:32:00 PM com.google.code.morphia.logging.MorphiaLoggerFactory 
chooseLoggerFactory
INFO: LoggerImplFactory set to 
com.google.code.morphia.logging.jdk.JDKLoggerFactory
------------- ---------------- ---------------
Testcase: 
test_deleteComponent(com.company.lps.oodbcore.tests.ComponentJUnitTest):    Caused 
an ERROR
com.google.code.morphia.Datastore.delete(Lcom/google/code/morphia/query/Query;)V
java.lang.NoSuchMethodError: 
com.google.code.morphia.Datastore.delete(Lcom/google/code/morphia/query/Query;)V
    at com.company.lps.oodbcore.services.OODBComponentService.deleteComponents(OODBComponentService.java:224)
    at com.company.lps.oodbcore.tests.ComponentJUnitTest.test_deleteComponent(ComponentJUnitTest.java:200)

Test com.company.lps.oodbcore.tests.ComponentJUnitTest FAILED
debug-test:
Deleting: 
C:\Users\ionutm\AppData\Local\Temp\TEST-com.company.lps.oodbcore.tests.Component
JUnitTest.xml
BUILD SUCCESSFUL (total time: 1 minute 29 seconds)

Original comment by manolach...@gmail.com on 24 Feb 2012 at 11:38