# File lib/tapkit/access/database_context.rb, line 43
                def initialize_object( object, gid, editing_context )
                        # do I use snapshots in DatabaseContext?
                        object.application = @application
                        entity = @database.entity gid.entity_name
                        snapshot = @database.snapshot gid

                        # use a snapshot to set default value for object
                        entity.class_property_attributes.each do |attribute|
                                value = snapshot[attribute.name]
                                object._init_stored_value(attribute.name, value) # without will_read
                        end

                        entity.class_property_relationships.each do |relation|
                                dest_object = nil
                                if relation.to_many? then
                                        dest_object = array_fault(gid, relation.name, editing_context)
                                else
                                        destinations = {}

                                        relation.joins.each do |join|
                                                # joining PKs to PKs
                                                names = relation.entity.primary_key_attribute_names
                                                if names.include? join.source.name then
                                                end

                                                if snapshot[join.source.name] then
                                                        destinations[join.destination.name] = snapshot[join.source.name]
                                                end
                                        end

                                        unless destinations.empty? then
                                                # If the application already has an object for the relation,
                                                # use it instead of creating fault.
                                                fault_gid = KeyGlobalID.new(relation.destination_entity.name,
                                                        destinations)
                                                dest_object = editing_context.object fault_gid

                                                unless dest_object then
                                                        dest_object = fault(fault_gid, editing_context)
                                                end
                                        end
                                end

                                object._init_stored_value(relation.name, dest_object)
                        end
                end