text
stringlengths
0
234
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_3_NAME, -- page_id
Value => Object.Page);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_3_NAME, -- author_id
Value => Object.Author);
Object.Clear_Modified (9);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
Function Definition: procedure Free is
Function Body: new Ada.Unchecked_Deallocation (Object => AWS.SMTP.Recipients,
Name => Recipients_Access);
-- Get a printable representation of the email recipients.
function Image (Recipients : in AWS.SMTP.Recipients) return String;
-- ------------------------------
-- Set the <tt>From</tt> part of the message.
-- ------------------------------
overriding
procedure Set_From (Message : in out AWS_Mail_Message;
Name : in String;
Address : in String) is
begin
Message.From := AWS.SMTP.E_Mail (Name => Name,
Address => Address);
end Set_From;
-- ------------------------------
-- Add a recipient for the message.
-- ------------------------------
overriding
procedure Add_Recipient (Message : in out AWS_Mail_Message;
Kind : in Recipient_Type;
Name : in String;
Address : in String) is
pragma Unreferenced (Kind);
begin
if Message.To = null then
Message.To := new AWS.SMTP.Recipients (1 .. 1);
else
declare
To : constant Recipients_Access := new AWS.SMTP.Recipients (1 .. Message.To'Last + 1);
begin
To (Message.To'Range) := Message.To.all;
Free (Message.To);
Message.To := To;
Function Definition: procedure Import_Country is
Function Body: use Ada.Text_IO;
use Util.Serialize.IO.CSV;
use AWA.Countries.Models;
use Ada.Containers;
use Util.Log;
Log : constant Loggers.Logger := Loggers.Create ("Import_Country");
Country : AWA.Countries.Models.Country_Ref;
DB : ADO.Sessions.Master_Session;
package Country_Map is
new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => AWA.Countries.Models.Country_Ref,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=");
package Neighbors_Map is
new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => String,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=");
Countries : Country_Map.Map;
Neighbors : Neighbors_Map.Map;
type CSV_Parser is new Util.Serialize.IO.CSV.Parser with null record;
overriding