appoxy / simplejpa Goto Github PK
View Code? Open in Web Editor NEWSimpleJPA - Java Persistence API (JPA) implementation for Amazon SimpleDB
Home Page: http://www.appoxy.com
License: Apache License 2.0
SimpleJPA - Java Persistence API (JPA) implementation for Amazon SimpleDB
Home Page: http://www.appoxy.com
License: Apache License 2.0
Does SimpleJPA support cascade annotations?
I tried @OneToMany(mappedBy = "...", cascade = CascadeType.ALL)
with no effect.
Which maven repository contains references to the mail.jar SNAPSHOT?
mvn install
[INFO] Scanning for projects...
[INFO] Building SimpleJPA
[INFO] task-segment: [install]
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resour
ces, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory c:\workspace\work\os\amazon\simp
lejpa\core\src\main\resources
[ERROR] BUILD ERROR
[INFO] Failed to resolve artifact.
Failed to resolve artifact, possibly due to a repository list that is not a
ppropriately equipped for this artifact's metadata.
javax.mail:mail:jar:1.4.5-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Path to dependency:
1) SimpleJPA:SimpleJPA:jar:1.6-SNAPSHOT
2) com.amazonaws:aws-java-sdk:jar:1.1.8
3) javax.mail:mail:jar:1.4.5-SNAPSHOT
[INFO] For more information, run Maven with the -e switch
[INFO] Total time: 1 second
[INFO] Finished at: Wed Aug 10 14:47:09 IST 2011
[INFO] Final Memory: 8M/20M
Hi,
I just tried to do a native 'select * from JPAUserMessage'.
I got an error. It looks like SimpleDBQuery.replaceClassName() isn't doing well.
I mimic line 67 with the above query:
String persistenceUnitName = "PU";
String className = ""; !!
String test = "select count() from PU-JPAUserMessage
".replaceFirst(className, ""+persistenceUnitName+"-JPAUserMessage
");
this results in "'PU-JPAUserMessage' select count() from 'PU-JPAUserMessage'"
so, when the className resolves to "" by matcher.find (which it does for the above query), the select expression isn't correct anymore.
Regards,
Duncan
This is similar to issue #16 except that it's for OneToMany Remove method instead of Persist (involving Delete.class)
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
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)
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)
....
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.
Support to run SimpleJPA behind proxy network, (refer to http://code.google.com/p/simplejpa/issues/detail?id=35 )
This would be useful feature because development work in corporate is usually behind a proxy.
Thank so much in advance!
Please implements @GeneratedValue annotation for simplejpa.
NB This is Issue 39 at google code: http://code.google.com/p/simplejpa/issues/detail?id=39
What steps will reproduce the problem?
1.Call the method EntityManagerFactoryImpl.newInstanceWithClassNames with a list of class names that are located in a jar file and run on MAC OS X
2.Run a query against the EntityManager referencing one of the classes loaded from the jar file - exception thrown with file not found.
What is the expected output?
Should run without exception
What do you see instead?
A FileNotFoundException
What version of the product are you using? On what operating system?
1.6-SNAPSHOT on OSX 10.6.7
Please provide any additional information below.
The problem is actually caused in the method getLibsToScan
the line :
libs.add(resource.getFile().split("!")[0].substring(6));
is stripping off the leading slash so that
file:/Users/..... becomes Users/.....
this maybe what is required on Windows, but breaks on Mac OS and possibly also on *nix
Changing the line to:
libs.add(resource.getFile().split("!")[0].substring(5));
solves the problem but I would like someone to test on Windows before I commit the change.
EntityManagerSimpleJPA.OFFSET_VALUE applied in public T convert(Collection values, PersistentProperty property, Class retType) method in EntityManagerSimpleJPA causes negative value in entity long fields.
I can't claim to be an expert on the JPA spec, but I've at least seen examples implying that @Enumerated(EnumType.STRING) should work on the field level in addition to the getter. SimpleJPA only works on the getter. Don't get me wrong, I'm glad there's a fix to my pain, but shouldn't this annotation also work at the field level?
Thanks - this is an excellent tool you've developed!
When I run mvn package or mvn install, some of the tests fail. The stack traces were looking for simplejpa.properties file in the classpath. I added the properties file to the classpath just to see what would happen, but more errors came up after that.
Failed tests:
testNoParameterReplacement(com.spaceprogram.simplejpa.query.SimpleDBQueryTests)
testSimpleParameterReplacement(com.spaceprogram.simplejpa.query.SimpleDBQueryTests)
testIntegerValueReplacement(com.spaceprogram.simplejpa.query.SimpleDBQueryTests)
testDateValueReplacement(com.spaceprogram.simplejpa.query.SimpleDBQueryTests)
testMultipleReplacements(com.spaceprogram.simplejpa.query.SimpleDBQueryTests)
Tests in error:
com.spaceprogram.simplejpa.CacheTests
com.spaceprogram.simplejpa.CacheTests
com.spaceprogram.simplejpa.DomainHelperTests
com.spaceprogram.simplejpa.DomainHelperTests
com.spaceprogram.simplejpa.PerformanceTests
com.spaceprogram.simplejpa.PerformanceTests
com.spaceprogram.simplejpa.PersistenceTests
com.spaceprogram.simplejpa.PersistenceTests
com.spaceprogram.simplejpa.SessionlessTests
com.spaceprogram.simplejpa.SessionlessTests
com.spaceprogram.simplejpa.StatsTests
com.spaceprogram.simplejpa.StatsTests
com.spaceprogram.simplejpa.UtilTests
com.spaceprogram.simplejpa.UtilTests
Tests run: 67, Failures: 5, Errors: 14, Skipped: 1
Hi there,
I'm getting very inconsistent and buggy behavior when calling Collections.sort() and Collections.reverse() on the LazyLists returned by query.getResultList(). Basically, the lists are sometimes properly sorted and reversed and sometimes they are half sorted, not sorted in the right order, etc.
I couldn't narrow down the issue precisely but I assume it happens if the LazyList isn't fully populated. Couple questions:
Thanks!
The decoding strategy used by the EntityManager to store integer or floats is not configurable and the default mechanism makes the content in the atrribute field pretty much non-interpretable.
Why not:
From google code issue (http://code.google.com/p/simplejpa/issues/detail?id=10)
It would be nice if you supported building with maven. I attached a
reasonable one to this issue.
Also for extra credit, set up a sync with the central maven repo.
http://maven.apache.org/guides/mini/guide-central-repository-upload.html
pom.xml
1.8 KB View Download
Comment 1 by [email protected], Aug 17, 2009
The lates svn checkout needs the attached pom --
pom.xml
2.0 KB View Download
Comment 2 by [email protected], Feb 8, 2010
There is a Google code project that helps you sync with Maven Central. See here for
help doing this in a Google code project:
http://code.google.com/p/google-maven-repository/wiki/ProjectSetup
Comment 3 by [email protected], Sep 23, 2010
And it would be nice if KittyCache also provided in Maven Central or included in the SimpleJPA jar.
Comment 4 by project member [email protected], Jan 28, 2011
I'd love to help with this issue - I've just got the latest from the trunk and would love to commit some updates to the pom - but how can I get commit rights?
I would heavily suggest we start using the release plugin to build and commit releases in the branches. Also the amazonaws reference is not to the latest version. and there are a few other ways the pom file can be cleaned up. I am happy to do any other work to get versions into the central repo also.
Comment 5 by project member [email protected], Feb 7, 2011
I've started reorganizing the builds. KittyCache and EHCache are now separated from the core source base. This allows things the build cleanly without any issues. I bumped a few of the dependencies and will sync the latest version of the AWS plugin if we rolled a new version out since last I checked. We have a sonatype account and will likely be leveraging that to get into the central maven repo.
In addition to sorting out the release plugin we also need to cleanup the unit tests. In the meantime send/attach and diffs for the maven build to this ticket.
Comment 6 by project member [email protected], Feb 7, 2011
Bumped the following dependencies to the latest stable versions.
commons-lang - 2.6
AWS - 1.1.5
Is simplejpa certified to run on AWS 1.2.6? The pom files still reference a older version of AWS.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.1.8</version>
</dependency>
The AppendIn method of the QueryImpl class does not append commas in between values.
The following code should fix that:
private void appendIn(StringBuilder sb, String field, List params) {
sb.append("").append(field).append("
");
sb.append(" ");
sb.append("IN");
sb.append(" (");
boolean quoteParam = true;
for(int i = 0; i < params.size(); i++){
if(i != 0){
sb.append(",");
}
sb.append("'").append(params.get(i)).append("'");
}
sb.append(")");
}
Add support for CriteriaBuilder to implementation. EntityManger should provide a getCriteriaBuilder() method.
Order by seems to be broken.
Running a query like this:
Query q = em.createQuery("select e from SomeTable e where e.somefield = :somefield order by e.score desc");
Will send a query like this to Amazon:
[INFO ] com.amazonaws.request: Sending Request: POST http://sdb.amazonaws.com / Parameters: (ConsistentRead: true, Action: Select, Version: 2009-04-15, SelectExpression: select count(*) from SomeDomain-SomeTable
where somefield
= 'somevalue' order by score desc, )
Which gives this error:
[INFO ] com.amazonaws.request: Received error response: Status Code: 400, AWS Request ID:XXX, AWS Error Code: InvalidSortExpression, AWS Error Message: Invalid sort expression. The sort attribute must be present in at least one of the predicates, and the predicate cannot contain the is null operator.
javax.persistence.PersistenceException: Status Code: 400, AWS Request ID: XXX, AWS Error Code: InvalidSortExpression, AWS Error Message: Invalid sort expression. The sort attribute must be present in at least one of the predicates, and the predicate cannot contain the is null operator.
at com.spaceprogram.simplejpa.query.AbstractQuery.getResultList(AbstractQuery.java:216)
at com.spaceprogram.simplejpa.query.QueryImpl.getCount(QueryImpl.java:369)
at com.spaceprogram.simplejpa.LazyList.size(LazyList.java:75)
Running the exact same query without the 'order by e.score desc' clause works without error. I guess the error might have to do with passing the order by clause to AWS when doing a count.
I'm getting this issue both in the 1.6 snapshot and in the AWS SDK .jar.
Please implements the outline EntityTranscactionImpl (implements EntityTransaction JPA interface) as feature on not-transactional SimpleDB.
Any plans to migrate this to (latest) AWS SDK (for JAVA) 1.3.11?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.