Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

FlexORM
Project Home Blog Forums Wiki Known Issues Contact Project

Author: Mark Moloney (All RIAForge projects by this author)
Last Updated: March 24, 2011 1:25 AM
Version: 0.8
Views: 85,725
Downloads: 3
License: BSD

Description:

24/3/2010 Working on adding one-to-one mapping support

8/3/2009 After a hiatus since last year, project development is continuing. On the immediate roadmap is adding support for:
* Database encryption
* Criteria API enhancements
* Please let me know your feature requests

1/7/2008 New Release 0.8 with support for asynchronous API, composite keys, and indexed collections.

15/4/2008 New Release with support for foreign key constraints, user-defined transactions, auto schema update, Lazy Loading of list associations, and an alternate Rails-like API.

3/2008 New Release with improved code organisation and support for inheritance mapping.

We are working toward a 1.0 release, which will include a Criteria API for advanced search.

FlexORM is an Object Relational Mapping framework for Adobe AIR. It enables JavaScript/ActionScript3 objects to become persistent objects using the embedded SQLite database; that is, you do not need to write database code or SQL.

The FlexORM framework can be used by either Flex or JavaScript code in AIR applications.

A key feature of FlexORM is its transparency. You do not need to modify your domain objects or inherit from a base class.

For example, given a domain object such as:

[Bindable]
public class Contact
{
public var id:int;
public var name:String;
public var organisation:Organisation;
}

The domain object can be saved and loaded from the local database as follows:

var em:EntityManager = EntityManager.instance;

var contact:Contact = new Contact();
contact.name = 'Steve';
var organisation:Organisation = new Organisation();
organisation.name = 'Apple';
contact.organisation = organisation;

em.save(contact);

var loadedContact:Contact = em.loadItem(Contact, contact.id) as Contact;
var allContacts:ArrayCollection = em.findAll(Contact);


The framework enables you to concentrate on developing rich domain objects, which can be saved across application sessions, without writing error-prone and complex database logic.

Object graphs (objects and their associations) can be saved and restored from the database.

Mapping information to configure columns and relationships can be added using annotations, which also makes the objects self documenting.

For example:

[Bindable]
[Table(name='contacts')]
public class Contact
{
   private var _orders:IList;
   
   [Id]
   [Column(name='contact_id')]
   public var id:int;
   
   public var name:String;
   
   [Transient]
   public var derivedValue:int;

   [ManyToOne(cascade='none')]
   public var organisation:Organisation;
   
   [OneToMany(type='model.Order', indexed='true', lazy='true')]
   public function set orders(value:IList):void
   {
      _orders = value;
   }
   
   public function get orders():IList
   {
      return _orders;
   }
   
   [ManyToMany(type='model.Role')]
   public var roles:IList;

}


FlexORM supports the following features:

* Non-intrusive
* Composite Keys
* Save, Update, Delete, Load, and Find All operations
* Automatically creates and updates database schema
* Many-to-one associations
* One-to-many associations
* Many-to-many associations (automatically creates the association table)
* Indexed one-to-many and many-to-many collections
* Bidirectional one-to-many associations
* Cascade saves/updates/deletes
* Transient (non-persistent) properties
* Inheritance mapping
* FK constraints (using triggers in SQLite)
* Automatically creates database indexes
* Transactions
* Automatic Schema Update
* Lazy loading of associations
* Asynchronous API

Project contributors include:
* Mark Moloney (http://www.moloney.net.nz)
* Will Rogers

I am indebted to the work of Christophe Coenraets (http://coenraets.org/) in getting started.

Recent Blog Entries:

Requirements:

AIR 1.5

Issue Tracker:

ID ISSUE STATUS UPDATED
8 Association metadata not loaded properly: ReferenceError: Error #1065: Variable XYZ is not defined. Open 08/03/11 12:53 AM
2 entityMap not destroyed when closing/opening async connection Open 03/21/10 2:25 PM
7 Error in multiple addSort() [order by clauses using AND instead of ,] Open 03/03/10 12:32 PM
6 Orphaned Documentation Open 02/24/10 1:43 PM
3 Inheritance problems Open 01/16/10 7:42 AM

View All Issues

To enter issues for this (or any other) project, you must be logged in.

Subversion Access:

You may access this project's Subversion repository with your client here: http://svn.riaforge.org/flexorm.

To view files and changelists associated with this repository, go here: http://flexorm.riaforge.org/index.cfm?event=page.svnbrowse.

Anonymous users have read access to the repository while the administrator has write access.

This project is sharing its code via Subversion. Subversion is an open source source control method. You may find more information about Subversion here: http://subversion.tigris.org/