Comments (2)
I believe "not equal" in SimpleDB is: !=
Can you try that?
On Wed, Feb 22, 2012 at 7:52 AM, mautdunia <
[email protected]
wrote:
Hi there,
I am wondering if anyone experience issue with <> (not equal) query.
I am not sure if there is something wrong with my code, or if this
actually a bug on SimpleJPA or SimpleDB..I receive below error when using '<>' operand in my query:
Status Code: 400, AWS Request ID: f1f24508-e5c9-b307-7eed-4737e3fb4c2d,
AWS Error Code: InvalidQueryExpression, AWS Error Message: The specified
query expression syntax is not valid.
at
com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:500)
at
com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:262)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:166)
at
com.amazonaws.services.simpledb.AmazonSimpleDBClient.invoke(AmazonSimpleDBClient.java:739)
at
com.amazonaws.services.simpledb.AmazonSimpleDBClient.select(AmazonSimpleDBClient.java:197)
at
com.spaceprogram.simplejpa.DomainHelper.selectItems(DomainHelper.java:57)I have also tried to use '!=' but it does not seem to work:
javax.persistence.PersistenceException: No getter for field: status !
at
com.spaceprogram.simplejpa.query.QueryImpl.appendCondition(QueryImpl.java:365)
at
com.spaceprogram.simplejpa.query.QueryImpl.toAmazonQuery(QueryImpl.java:270)
at
com.spaceprogram.simplejpa.query.QueryImpl.createAmazonQuery(QueryImpl.java:173)
at
com.spaceprogram.simplejpa.query.QueryImpl.getResultList(QueryImpl.java:104)at
If I remove the <> operand then the query runs with no problem. Here is my
code snippet:
....
em = factory.createEntityManager();
Query query = em.createQuery("select s from Stuff s where owner=:owner AND
status <> :status AND created is not null order by created desc");
query.setParameter("owner", owner);
query.setParameter("status", status);
return (List)query.getResultList();....
Thanks.
Reply to this email directly or view it on GitHub:
#26
from simplejpa.
yes, I have tried that, but it returns an exception on QueryImpl class as seen above....
I think somehow SimpleJPA use "<>" for "not equal" operand (based on http://code.google.com/p/simplejpa/wiki/JPAQuery) while SimpleDB expect it to be "!=" (based on http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/UsingSelectOperators.html)
from simplejpa.
Related Issues (20)
- junit tests fail HOT 5
- Proxy support HOT 2
- Cascade support?
- @Enumerated doesn't work on fields
- Builds with Maven HOT 5
- Using 'order by' gives InvalidSortExpression HOT 1
- replaceClassName behaviour
- Wrong value in numeric fields HOT 1
- Respect Remove Cascade setting on OneToMany Relationship
- EntityTransactionImpl implementation
- Queries with keyword 'IN'
- @GeneratedValue
- Any plans to migrate this to (latest) AWS SDK (for JAVA) 1.3.11
- Attribute en/decoding strategy of the EntityManager is not configuable HOT 3
- LazyList and Collections.sort() and Collections.reverse() behavior HOT 2
- Please, add a LICENSE HOT 1
- Add CriteriaBuilder support. HOT 1
- Unable to find javax.mail:mail:jar:1.4.5-SNAPSHOT HOT 2
- Is simplejpa certified to run on AWS 1.2.6? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplejpa.