simpleds

SimpleDS provides a simple persistence framework for Google AppEngine that gets as little in the way as possible.

License

License

GroupId

GroupId

org.extrema-sistemas
ArtifactId

ArtifactId

simpleds
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

simpleds
SimpleDS provides a simple persistence framework for Google AppEngine that gets as little in the way as possible.
Project URL

Project URL

https://github.com/icoloma/simpleds/
Source Code Management

Source Code Management

https://github.com/icoloma/simpleds/

Download simpleds

How to add to project

<!-- https://jarcasting.com/artifacts/org.extrema-sistemas/simpleds/ -->
<dependency>
    <groupId>org.extrema-sistemas</groupId>
    <artifactId>simpleds</artifactId>
    <version>1.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.extrema-sistemas/simpleds/
implementation 'org.extrema-sistemas:simpleds:1.3.0'
// https://jarcasting.com/artifacts/org.extrema-sistemas/simpleds/
implementation ("org.extrema-sistemas:simpleds:1.3.0")
'org.extrema-sistemas:simpleds:jar:1.3.0'
<dependency org="org.extrema-sistemas" name="simpleds" rev="1.3.0">
  <artifact name="simpleds" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.extrema-sistemas', module='simpleds', version='1.3.0')
)
libraryDependencies += "org.extrema-sistemas" % "simpleds" % "1.3.0"
[org.extrema-sistemas/simpleds "1.3.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.6.1
javax.inject : javax.inject jar 1
com.google.guava : guava jar 10.0.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.5

Project Modules

There are no modules declared in this project.

SimpleDS provides a simple persistence framework for Google AppEngine that gets as little in the way as possible. It is barely a wrapper around Datastore APIs, providing mapping between Entity and Java classes.

You can explore the details about SimpleDS at our presentation for Codemotion 2012.

There is also a demo application on GitHub.

Analytics

Features

  • Supports Guice, Spring or plain Java configuration.
  • Support for embedded classes serialized as properties or in JSON format.
  • ==, <, <=, >, <=, IN, != and left like are supported.
  • Easy transformations between Java Objects and Datastore Entities.
  • Easy support for Cursors.
  • Validations of expected ancestors
  • Transaction support
  • Level 1 and 2 Cache
  • Cacheable queries

Examples

This is a brief comparison between SimpleDS and JPA:

// JPA retrieve by key
Model m1 = entityManager.find(Model.class, key);
Model m2 = entityManager.find(Model.class, key2);

// SimpleDS retrieve by key
Model m1 = entityManager.get(key);
Map<Key, Model> l = entityManager.get(key1, key2);

// JPA persist changes
entityManager.merge(m1);
entityManager.persist(m2);

// SimpleDS persist changes
entityManager.put(m1);
entityManager.put(ImmutableList.of(m1, m2));
Model m3 = new Model();
entityManager.put(parentKey, m3);

// JPA remove
Model m1 = entityManager.find(Model.class, key);
entityManager.remove(m1);

// SimpleDS remove
entityManager.remove(ImmutableList.of(key1, key2, key3));

Queries

// JPA
Query query = entityManager.createQuery(
   "select m from Model m where m.createdAt<=?1 and m.createdBy=?"
);
query.setParameter(1, new Date());
query.setParameter(2, userKey);
return query.getResultList();

// SimpleDS
return entityManager.createQuery(Model.class)
  .lessThan("createdAt", new Date())
  .equal("createdBy", userKey)
  .asList();

// retrieve just keys
return entityManager.createQuery(Model.class)
  .keysOnly()
  .asList();

// with limits
return entityManager.createQuery(Model.class)
  .withOffset(10)
  .withLimit(100)
  .asList();

Versions

Version
1.3.0
1.2
1.1
1.0
1.0_RC1
0.9