text stringlengths 0 234 |
|---|
end if; |
end Load; |
procedure Save (Object : in out Access_Key_Impl; |
Session : in out ADO.Sessions.Master_Session'Class) is |
Stmt : ADO.Statements.Update_Statement |
:= Session.Create_Statement (ACCESS_KEY_DEF'Access); |
begin |
if Object.Is_Modified (1) then |
Stmt.Save_Field (Name => COL_0_3_NAME, -- access_key |
Value => Object.Access_Key); |
Object.Clear_Modified (1); |
end if; |
if Object.Is_Modified (2) then |
Stmt.Save_Field (Name => COL_1_3_NAME, -- expire_date |
Value => Object.Expire_Date); |
Object.Clear_Modified (2); |
end if; |
if Object.Is_Modified (3) then |
Stmt.Save_Field (Name => COL_2_3_NAME, -- id |
Value => Object.Get_Key); |
Object.Clear_Modified (3); |
end if; |
if Object.Is_Modified (5) then |
Stmt.Save_Field (Name => COL_4_3_NAME, -- kind |
Value => Integer (Key_Type'Pos (Object.Kind))); |
Object.Clear_Modified (5); |
end if; |
if Object.Is_Modified (6) then |
Stmt.Save_Field (Name => COL_5_3_NAME, -- user_id |
Value => Object.User); |
Object.Clear_Modified (6); |
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 Set_Field_Enum is |
Function Body: new ADO.Objects.Set_Field_Operation (Session_Type); |
Impl : Session_Access; |
begin |
Set_Field (Object, Impl); |
Set_Field_Enum (Impl.all, 4, Impl.Stype, Value); |
end Set_Stype; |
function Get_Stype (Object : in Session_Ref) |
return AWA.Users.Models.Session_Type is |
Impl : constant Session_Access |
:= Session_Impl (Object.Get_Load_Object.all)'Access; |
begin |
return Impl.Stype; |
end Get_Stype; |
function Get_Version (Object : in Session_Ref) |
return Integer is |
Impl : constant Session_Access |
:= Session_Impl (Object.Get_Load_Object.all)'Access; |
begin |
return Impl.Version; |
end Get_Version; |
procedure Set_Server_Id (Object : in out Session_Ref; |
Value : in Integer) is |
Impl : Session_Access; |
begin |
Set_Field (Object, Impl); |
ADO.Objects.Set_Field_Integer (Impl.all, 6, Impl.Server_Id, Value); |
end Set_Server_Id; |
function Get_Server_Id (Object : in Session_Ref) |
return Integer is |
Impl : constant Session_Access |
:= Session_Impl (Object.Get_Load_Object.all)'Access; |
begin |
return Impl.Server_Id; |
end Get_Server_Id; |
procedure Set_Id (Object : in out Session_Ref; |
Value : in ADO.Identifier) is |
Impl : Session_Access; |
begin |
Set_Field (Object, Impl); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.