text
stringlengths
0
234
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 12, Impl.Owner, Value);
end Set_Owner;
function Get_Owner (Object : in Storage_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Storage_Access
:= Storage_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Owner;
end Get_Owner;
procedure Set_Workspace (Object : in out Storage_Ref;
Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is
Impl : Storage_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 13, Impl.Workspace, Value);
end Set_Workspace;
function Get_Workspace (Object : in Storage_Ref)
return AWA.Workspaces.Models.Workspace_Ref'Class is
Impl : constant Storage_Access
:= Storage_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Workspace;
end Get_Workspace;
procedure Set_Folder (Object : in out Storage_Ref;
Value : in AWA.Storages.Models.Storage_Folder_Ref'Class) is
Impl : Storage_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 14, Impl.Folder, Value);
end Set_Folder;
function Get_Folder (Object : in Storage_Ref)
return AWA.Storages.Models.Storage_Folder_Ref'Class is
Impl : constant Storage_Access
:= Storage_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Folder;
end Get_Folder;
-- Copy of the object.
procedure Copy (Object : in Storage_Ref;
Into : in out Storage_Ref) is
Result : Storage_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Storage_Access
:= Storage_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Storage_Access
:= new Storage_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Storage := Impl.Storage;
Copy.Create_Date := Impl.Create_Date;
Copy.Name := Impl.Name;
Copy.File_Size := Impl.File_Size;
Copy.Mime_Type := Impl.Mime_Type;
Copy.Uri := Impl.Uri;
Copy.Version := Impl.Version;
Copy.Is_Public := Impl.Is_Public;
Copy.Original := Impl.Original;
Copy.Store_Data := Impl.Store_Data;
Copy.Owner := Impl.Owner;
Copy.Workspace := Impl.Workspace;
Copy.Folder := Impl.Folder;
Function Definition: procedure Unchecked_Free is new Ada.Unchecked_Deallocation
Function Body: (Storage_Impl, Storage_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Storage_Impl_Ptr := Storage_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Storage_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, STORAGE_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;