Frameworks for javascript client side ORM?

I'm kind of sick of using JSON/Rest services lately and manually typing up methods on the server that do basic CRUD operations on a database.

What I'd like to do, is in javascript (ajax based apps) do something of the form

var allStudents = students.getAllStudents(); // returns all items of the students table

var student = new student();
student.name = "Joe";
student.address = "123 Sesame st";
students.add(student); // commits it to the students table

var student = students.getStudentById(57);

Now as any ORM all these methods would be automated/written for me.

Also note that I'm not saying Javascript should talk directly to a database. It would still do Restful calls (behind the scenes to a server). But I just want these crud operations to be automated and transparent to me so that I don't need to manually write out these on the server.

You guys know any frameworks that would help achieve this?

My primary backend is Java/Spring3MVC. But I'd also like to hear ideas that use Node.js possibly.

I'm undecided on whether or not this is a time-saver compared to simply writing the RESTful ajax requests out, but Dojo's JsonRest store is one solution I've seen which works similarly to what you're describing. Personally I find it more readable to write the ajax request explicitly, but if you don't mind adhering to Dojo's philosophy on how your requests should be structured you might like this. Anyhow, here's some code from that documentation page:

require(["dojo/store/JsonRest"], function(JsonRestStore){

  var store = new JsonRestStore({target: "/Table/" });

  store.get(3).then(function(object){
    // use the object with the identity of 3
  });

  store.query("foo=bar").then(function(results){
    // use the query results returned from the server
  });

  store.put({ foo: "bar" }, { id: 3 }); // store the object with the given identity

  store.remove(3); // delete the object

});

If you can use something like Backbone.js or Can.js (recommended) to do your interfaces and seamlessly communicate with your database through RESTfull services in a way you will be impressed if you haven't seen it before.

http://backbonejs.org/ http://canjs.us/

Both use a MVC structure that is incredibly easy to setup. Take a look at the demos and examples.

Looking for the same thing, I have stumbled upon sproutcore records. Look like a javascript orm solution.