text
stringlengths
0
234
ADO.Objects.Set_Field_Key_Value (Impl.all, 7, Value);
end Set_Id;
function Get_Id (Object : in Session_Ref)
return ADO.Identifier is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Auth (Object : in out Session_Ref;
Value : in AWA.Users.Models.Session_Ref'Class) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 8, Impl.Auth, Value);
end Set_Auth;
function Get_Auth (Object : in Session_Ref)
return AWA.Users.Models.Session_Ref'Class is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Auth;
end Get_Auth;
procedure Set_User (Object : in out Session_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.User, Value);
end Set_User;
function Get_User (Object : in Session_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.User;
end Get_User;
-- Copy of the object.
procedure Copy (Object : in Session_Ref;
Into : in out Session_Ref) is
Result : Session_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Session_Access
:= new Session_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Start_Date := Impl.Start_Date;
Copy.End_Date := Impl.End_Date;
Copy.Ip_Address := Impl.Ip_Address;
Copy.Stype := Impl.Stype;
Copy.Version := Impl.Version;
Copy.Server_Id := Impl.Server_Id;
Copy.Auth := Impl.Auth;
Copy.User := Impl.User;
Function Definition: procedure Unchecked_Free is new Ada.Unchecked_Deallocation
Function Body: (Session_Impl, Session_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Session_Impl_Ptr := Session_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Session_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, SESSION_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Session_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;