Ein abgefahrendes Projekt ist eine JPA-Schnittstelle für die Amazon SimpleDB (Amazon S3 (Simple Storage Service)). Mit http://code.google.com/p/simplejpa/ lässt sich auf die Amazon-Datenbank über das standardisierte JPA zugreifen. Die Doku unter http://code.google.com/p/simplejpa/wiki/GettingStarted listet alles nötigen Jar-Dateien auf und zeigt anhand eines kleines Beispiels die Nutzung. Da die Amazon-DB keine "richtige" relationale DB ist, gibt es auch einige Einschränkungen, etwa "Can only query on a single object type, no joins." Auf der anderen Seite:
- Supports ManyToOne references with lazy loading
- Supports OneToMany collections with lazy loading
- Large object (LOB) support via Amazon S3
- Caches objects for quick response after first retrieval
- Retrieves result sets concurrently for fastest retrieval from SimpleDB
- JPA Queries (subset)
- @ManyToOne – object references. Stores id reference to another object in another Domain
- @OneToMany (java.util.List only, must be generified, must be bi-directional with mappedBy parameter) – Collection support. Please be careful with collections, usually better to just query for what you want rather than attaching via collections.
- @Inheritance – Only SINGLE_TABLE supported (only one that makes sense).
- @MappedSuperClass – Useful for a common ID and timestamping class.
- @Lob – stores lobs in S3 so make it as big as you want (up to 5GB).
- @Id – MUST be a string
- JPA Queries – see JPAQuery page
- Integer and Long – no problems, all good.
- Double – pads to 20 digits on each side of the decimal by default so fine for a lot of cases, but if you plan to use Double’s, let us know so we can work it out perfectly. SimpleDB makes it hard to work with these numbers because it treats everything as a String.
- BigDecimal – same problems as Double
- String
- no primitives yet! Please use wrappers only for now.
- @Enumerated (ordinal and string)
- @Column (name only)