def initialize_object( object, gid, editing_context )
object.application = @application
entity = @database.entity gid.entity_name
snapshot = @database.snapshot gid
entity.class_property_attributes.each do |attribute|
value = snapshot[attribute.name]
object._init_stored_value(attribute.name, value)
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|
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
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