Search code examples
actionscript-3ormairadobe

Bestpractice: Annotation-based ORM frameworks like Hibernate for Adobe AIR?


Question

Is there a commonly used framework for AIR that handles mapping objects to and from the built-in SQLite database? An Annotation-based ORM framework that is to AIR what Hibernate is to Java?

Background

We have an AIR application that runs offline. I need to save/restore complex objects to/from the SQLite database. Some of these ValueObjects contain references to other ValueObjects. For example, an Order object contains a Customer object which contains an Address object.

Ultimately, I'd like to add metadata to my objects, like an [Entity] tag and have persistence "just work," with minimal configuration. I could roll my own ORM solution, effectively writing "Hibernate for AIR" myself, but SURELY someone has already done this.

I've read related posts like Best practices for developing AIR Application with SQLite that advocate creating DAO's, Builders and Services. That's a fine solution but, of course, no one wants to reinvent the wheel if it's not 100% necessary.

Candidates

So far, the best I could find is partial solutions. I'll keep a running list here:

Has a framework emerged for this? Specifically, I'm seeking one like Hibernate that uses Annotations/Metatags to map objects to tables. Are one of the candidates above actually acceptable?

What are you using succesfully?

All input is welcome. Thanks!


Solution

  • take a look at FxORM. I worked on a couple of AIR projects with it - it worked fine for quite complex data structure.