Ignore:
Timestamp:
Jan 23, 2015, 12:00:37 AM (10 years ago)
Author:
chronos
Message:
  • Modified: All data types have own table which is used to specify supported data types by database engines.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DbEngines/UEngineXML.pas

    r7 r8  
    6464  I := 0;
    6565  while Assigned(Node2) and (Node2.NodeName = 'Value') and (I < Row.Values.Count) do begin
    66     case TField(Row.Parent.Fields[I]).FieldType of
     66    case TField(Row.Parent.Fields[I]).DataType.FieldType of
    6767      ftString: TValueString(Row.Values[I]).Value := Node2.TextContent;
    6868      ftInteger: TValueInteger(Row.Values[I]).Value := StrToInt(Node2.TextContent);
     
    8484    NewNode := Node.OwnerDocument.CreateElement('Value');
    8585    Node.AppendChild(NewNode);
    86     case TField(Row.Parent.Fields[I]).FieldType of
     86    case TField(Row.Parent.Fields[I]).DataType.FieldType of
    8787      ftString: NewNode.TextContent := TValueString(Row.Values[I]).Value;
    8888      ftInteger: NewNode.TextContent := IntToStr(TValueInteger(Row.Values[I]).Value);
     
    125125begin
    126126  Field.Name := ReadString(Node, 'Name', '');
    127   Field.FieldType := TFieldType(ReadInteger(Node, 'Type', 0));
     127  Field.DataType := Field.Table.Database.Engine.DataTypes.FindByType(TFieldType(ReadInteger(Node, 'Type', 0)));
    128128  Field.TextBefore := ReadString(Node, 'TextBefore', '');
    129129  Field.TextAfter := ReadString(Node, 'TextAfter', '');
     
    133133begin
    134134  WriteString(Node, 'Name', Field.Name);
    135   WriteInteger(Node, 'Type', Integer(Field.FieldType));
     135  WriteInteger(Node, 'Type', Integer(Field.DataType.FieldType));
    136136  WriteString(Node, 'TextBefore', Field.TextBefore);
    137137  WriteString(Node, 'TextAfter', Field.TextAfter);
     
    147147  while Assigned(Node2) and (Node2.NodeName = 'Field') do begin
    148148    NewField := TField.Create;
     149    NewField.Table := Fields.Table;
    149150    LoadNodeField(NewField, Node2);
    150151    Fields.Add(NewField);
     
    206207  while Assigned(Node2) and (Node2.NodeName = 'Table') do begin
    207208    NewTable := TTable.Create;
     209    NewTable.Database := Tables.Database;
    208210    LoadNodeTable(NewTable, Node2);
    209211    Tables.Add(NewTable);
Note: See TracChangeset for help on using the changeset viewer.