Questions tagged [siena]

Siena is a persistence API for Java inspired by the Google App Engine Python Datastore trying to draw a bridge between SQL and NoSQL worlds. It provides a Java Object-DB mapping designed following the ActiveRecord pattern which brings a simple and intuitive approach to manage your Java objects with respect to the database entities.

Welcome to Siena project!

Latest tagged version is Siena v1.0.0-b4

Siena is a persistence API for Java inspired by the Google App Engine Python Datastore trying to draw a bridge between SQL and NoSQL worlds. It provides a Java Object-DB mapping designed following the ActiveRecord pattern which brings a simple and intuitive approach to manage your Java objects with respect to the database entities.


Where can you find us also?

  • The main website is http://www.sienaproject.com but the doc is not up-to-date there as it refers to the old version 0.x of Siena.

  • The code trunk is https://github.com/mandubian/siena/

  • We have a IRC channel on freenode:
    • irc server: irc.freenode.net:6667
    • channel: #siena
  • You can contact the main committer of Siena using "mandubian" profile in Github or this email: pascal.voitot.dev@gmail.com


Siena is a single API with many implementations

  • SQL RDBMS (MySQL, Postgres, H2)
  • NoSQL (GAE sync/async for the time being and other implementations are planned such as: MongoDB, SimpleDB, HBase...)


Siena simplifies the transition between NoSQL and SQL

Siena is not meant to mimic a kind of Hibernate for NoSQL+SQL as it would be nonsense. In most cases, a model designed for SQL can be re-used in a NoSQL DB and vice-versa but it might not be optimized for the database. Siena is not meant to modify your model behind your back to optimize it for all the databases because it would be a crazy work. Siena just aims at drawing a bridge between NoSQL/SQL worlds and reducing the effort required when going from one database to the other. It ensures: * You can use the same API for all DB. * The model you design for a RDBMS will work with the same code in a NoSQL database and vice-versa. * Naturally, after migrating, you will optimize your model for the new database based on its specificity. * When you want to use very specific feature of a database, you will naturally use the low-level APIs provided by this DB.


Siena has a development lifecycle driven by practical use-cases and user experience

Siena doesn't try to fit in force and hide all the specific database technical aspects into your Java code. It has certainly been a false and unfulfilled promise of ORM frameworks in general: an object is not really a relational entity and SQL can't be completely hidden behind Java code. Thus, ORM often just moves the problems you had with SQL to problems you have with your ORM framework and unfortunately, you don't control your ORM framework at all as your SQL.

So we try to design Siena (at least as a wishful thinking because it's not an easy and exact process :)) through a process going from the user needs to the technical aspects of SQL/NoSQL databases and not the other way. As an example, when building a web application, you often need to paginate among hundreds of entities by pages of 50 for ex. You really don't care how the DB manages its record offsets for SQL or cursors for GAE, you just want a page of 50 entities and then go to the next page and then go back to the previous page etc... So Siena provides a pagination mechanism which allows exactly this without scratching your head and this mechanism has the same behavior in SQL and NoSQL.

As a consequence, Siena is a bit more than just a Object-Mapping API, it's like a toolbox to help you build your application based on a persistence system.



Siena technical design


A thin layer on top of low-level DB API

Siena is meant to keep the layer between your code and the low-level database APIs as thin as possible in order to make it efficient and not to implement to much technical mechanisms on top of already complex and complete database mechanisms: * For SQL, it directly uses JDBC * For GAE, it directly uses GAE low-level Datastore

The biggest part of Siena DB implementations is : * Mapping from Java types to low level DB types * Business code to manage high level mechanism such as pagination or stateless/stateful modes

Siena core is ONE jar and some tools/modules around this core library

Siena tries to be as simple as possible in its dependencies. For the time being, in order to use Siena with all DB implementations, you just need the siena.jar and the DB Jar(s) (JDBC or GAE) but nothing else. There is no hidden or transitive dependencies on other frameworks or Jars. So you can use Siena in a simple Java application or in a simple web app or in a JEE app.

Our purpose is also to provide tools or integrated modules based on this core library to use Siena in given environments.

The first module developed for Siena is play-siena: the web framework Play! is really great, really fits Siena design and provides a very good test platform.

Siena is stateless by default (but can become stateful if required)

Siena is stateless by default because it really fits the majority of cases and one can use it directly without scratching his head about potential problems of releasing DB resources or committing anything. Moreover, stateless is much easier to use in scalable and distributed infrastructure such as GAE.

Yet, Siena now proposes a new stateful mode to be able to reuse DB resources several times. Thus you can: * create a query with filters and orders and use the same query several keeping last context alive. * iterate through the results while keeping in memory the last position. * etc...

This stateful mode provides some interesting advanced features and we don't know yet all the practices it will bring. Siena is Open Source and is released under the Apache License 2.0.

Siena provides an asynchronous mode (only for GAE for the time being)

This is a really powerful way of retrieving entities from a database. You create a query, you launch it, you do something else and when the result is ready, you get it. Asynchrony is really useful when you run long duration queries and don't want to stop all the current thread while the queries is treated.

Siena provides an easy way to go to asynchronous mode and back to synchronous.

36 questions
1
vote
1 answer

InvalidObjectException when getting from SignedObject

I am sending an object encased in a Message object encase in a SignedObject over a TCP connection using an ObjectInputStream. Here's the basic code: Send Object data = someObject; ObjectOutputStream = new…
David K
  • 1,296
  • 18
  • 39
0
votes
2 answers

From Siena on GAE using Play framework 1.X to which database/api/module on Heroku using Play 2.0?

I've really enjoyed using Play framework 1.X on Google App Engine with Siena for data storing. Now I'm looking into using Play framework 2.0 for a new project. As Play isn't ready for GAE I'm going to try out Heroku. What are my options if I want…
Roy Solberg
  • 18,133
  • 12
  • 49
  • 76
0
votes
1 answer

Denormalized data modeling with Siena

I am trying to create a simple app on GAE/J. The data model consists of a list of notes, each with a few tags. In the relational world, this would be a many-to-many - since each note can have several tags, and every tag can "belong" to several…
curioustechizen
  • 10,572
  • 10
  • 61
  • 110
0
votes
1 answer

How to write unittests when using Siena on GAE

I'm writing a webapp which uses Wicket and Siena/gae as datastore. Now I want to write some decent unittests for my services. Is there already a toolset or classes that make the mocking of siena models a bit more easy? Note that I don't use…
Pieter Degraeuwe
  • 532
  • 6
  • 17
0
votes
1 answer

Playframework Siena Filtering and Ordering

This is my first question on any of these websites so pardon my unprofessionalism. I use playframework with SIENA module (with GAE) and I came accross the following problem: Given 3 entities: public class Meeting extends Model{ @Id public…
Gabor Peto
  • 642
  • 11
  • 24
0
votes
2 answers

how to parse/see the data in siena datastore?

While playing around with playframework yabe-siena-gae, I noticed a datastore file created for the sample data. Does any tool exist or is there some way to view the data inside the datastore file created by siena?
Selvakumar Esra
  • 1,154
  • 2
  • 15
  • 30
0
votes
1 answer

GAE & Siena - abstract classes and instantiation exceptions

I am building my first GAE app using the Play! Framework and I am having issues with Siena and abstract classes. A feature within the app is to allow a user to upload a post on which other users can comment. However, I am running into problems when…
My Head Hurts
  • 37,315
  • 16
  • 75
  • 117
0
votes
1 answer

Build siena query using date comparation in playframework+gae

I'm using siena in a playframework app, also with google app engine. I would like to build a query to get entities filtering with a field "date" of type java.util.Date, if it's possible. I've tried with something like List matchdays =…
javierhe
  • 553
  • 1
  • 7
  • 21
0
votes
1 answer

java.lang.AbstractMethodError when trying to use Siena with the Play Framework

Okay, so I've been banging my head against this problem for a couple of days now, and I just don't know what I'm missing to get it to work. I've also tried numerous searches here and on Google, but turned up nothing that has gotten me any visibly…
Kanmuri
  • 1,105
  • 8
  • 11
0
votes
1 answer

Is possible in siena to order by a calculated field?

I'm trying to get a query returned ordered on a filed which is calculated in Play. This is the query I'm using. return all().order("points").fetch(); where points is defined as public Integer points; and is retrieve thanks to this getter public…
Maurizio Pozzobon
  • 3,044
  • 7
  • 34
  • 44
0
votes
1 answer

Multiple relationship on play with siena

I'm creating a an entity with 2 one-to-many relationships. An Event has a User field and a Place field. I'm trying to use the automatic-query, but this code always returns an empty list. User user = new User("mauriziopz@gmail.com","Maurizio…
Maurizio Pozzobon
  • 3,044
  • 7
  • 34
  • 44
0
votes
1 answer

Google App Engine SDK deprecation effecting my Framework application

I have application which is developed in Play framework 1.x and running on Google app engine Standard Environment. And below is the way I am deploying the application GAE. Command- play gae:deploy But this command internally calling "appcfg" from…
Amit Rai
  • 89
  • 5
0
votes
1 answer

error when I tried to install locally the modules Gae and Siena on play framework 1.4.3

I'm working with Play framework v1.4.3 and when trying to install locally the modules gae and siena using the install command: play install gae play install siena this throws an error HTTP 403: Log error: ~ _ _ ~ _ __ | | __ _ _…
0
votes
0 answers

Write back data to the source in Project Siena app

I have a requirement to save data added by the user to a server. Is there any way to write back data to the source? or to somehow send the data to an azure server in project siena
Ramya
  • 561
  • 1
  • 4
  • 25
0
votes
1 answer

persisting with json in Siena

Anyone persisted use the JSON format in Sinea? http://www.sienaproject.com/documentation-json.html I need to persist collection fields where the collection is relatively small and contains only simple types like int, short, long, etc... Should I…
jcalfee314
  • 4,642
  • 8
  • 43
  • 75