 
 package org.openwms.common.domain {
 
-    import flash.events.EventDispatcher;
     import flash.utils.IDataInput;
     import flash.utils.IDataOutput;
     import flash.utils.IExternalizable;
-    import flash.utils.getQualifiedClassName;
     import mx.collections.ListCollectionView;
-    import mx.core.IUID;
-    import mx.utils.UIDUtil;
-    import org.granite.collections.IPersistentCollection;
-    import org.granite.meta;
-    import org.granite.tide.IEntity;
-    import org.granite.tide.IEntityManager;
-    import org.granite.tide.IPropertyHolder;
 
-    use namespace meta;
-
-    [Managed]
-    public class LocationBase implements IExternalizable, IUID {
-
-        protected var _em:IEntityManager = null;
-
-        private var __initialized:Boolean = true;
-        private var __detachedState:String = null;
+    [Bindable]
+    public class LocationBase implements IExternalizable {
 
         private var _checkState:String;
         private var _consideredInAllocation:Boolean;

        private var _outgoingActive:Boolean;
        private var _plcState:int;
        private var _version:Number;

        meta function isInitialized(name:String = null):Boolean {
            if (!name)
                return __initialized;

            var property:* = this[name];
            return (
                (!(property is Location) || (property as Location).meta::isInitialized()) &&
                (!(property is IPersistentCollection) || (property as IPersistentCollection).isInitialized())
            );
        }

        [Transient]
        public function meta_getEntityManager():IEntityManager {
            return _em;
        }
        public function meta_setEntityManager(em:IEntityManager):void {
            _em = em;
        }

        public function set checkState(value:String):void {
            _checkState = value;

            return _plcState;
        }

        public function get version():Number {
            return _version;
        }

        public function readExternal(input:IDataInput):void {
            _checkState = input.readObject() as String;
            _consideredInAllocation = input.readObject() as Boolean;
            _countingActive = input.readObject() as Boolean;
            _description = input.readObject() as String;
            _id = function(o:*):Number { return (o is Number ? o as Number : Number.NaN) } (input.readObject());
            _incomingActive = input.readObject() as Boolean;
            _lastAccess = input.readObject() as Date;
            _locationGroup = input.readObject() as LocationGroup;
            _locationGroupCountingActive = input.readObject() as Boolean;
            _locationId = input.readObject() as LocationPK;
            _locationType = input.readObject() as LocationType;
            _maximumWeight = function(o:*):Number { return (o is Number ? o as Number : Number.NaN) } (input.readObject());
            _messages = input.readObject() as ListCollectionView;
            _noMaxTransportUnits = input.readObject() as int;
            _outgoingActive = input.readObject() as Boolean;
            _plcState = input.readObject() as int;
            _version = function(o:*):Number { return (o is Number ? o as Number : Number.NaN) } (input.readObject());
        }

        public function writeExternal(output:IDataOutput):void {
            output.writeObject(_checkState);
            output.writeObject(_consideredInAllocation);
            output.writeObject(_countingActive);
            output.writeObject(_description);
            output.writeObject(_id);
            output.writeObject(_incomingActive);
            output.writeObject(_lastAccess);
            output.writeObject(_locationGroup);
            output.writeObject(_locationGroupCountingActive);
            output.writeObject(_locationId);
            output.writeObject(_locationType);
            output.writeObject(_maximumWeight);
            output.writeObject(_messages);
            output.writeObject(_noMaxTransportUnits);
            output.writeObject(_outgoingActive);
            output.writeObject(_plcState);
            output.writeObject(_version);
        }
    }
}