I am using the Sqlite-Net PCL, together with SQLite-Net for the development of an application using Examiner Extension.
I have one of several relationships between two classes a
and B
, as defined:
Public category A {[PrimaryKey, Auto Incorrect] Public Int ID (Received); Set; } Public string name {get; Set; } [Van Tommy (Cascade Operation = Cascade Operation. All)] Public List & lt; B & gt; Bates {receives; Set; } Public A (string name, list & lt; B & gt; sons) {name = name; Sans = son; }} Public Class B [[Primary, Auto Inquiry] Public Entity ID (Received); Set; } Public string name {get; Set; } [Foreign (Typef (A))] Public Int Foundation (Received; Set; } [ManyToOne] Public One Father (Mill); Set; } Public B (name of string) {name = name; }}
I set the A
and B
fields for both LastModified
A trigger is defined> The problem on the entry (and also on subsequent updates) is that if I use InsertWithChildren
, then the trigger is not activated, while inserting it
, although in this case we do not have to explicitly insert a recursive.
Example code to repeat the problem:
var sons1 = new list & lt; B & gt; {New B ("Ano"), New B ("Reason"), New B ("Tray"),}; A = new A ("Pedre", Bet 1); Var sons2 = new list & lt; B & gt; {New B ("Anu2"), New B ("Reason 2"), New B ("Tray 2"),}; Two = new A ("Pedre 2", Bet 2); (Con conn.DeleteAll & lt; p & gt; (); String Query = @ "Create Triggers {0 } _log later INSTER {0} "+" BEGIN "+ Update {0} SET LastModified = datetime ('now')" + "WHERE id = new id;" + "end;"; Conn.Execute (String. Format (query, "A"); Conn.Execute {String.Format (Query, "B"));} (var conn = DatabaseStore.GetConnection ()) using {conn.InstertWithChildren (one, true); Conn.Insert (2);}
In this example, two
, insert
is inserted in the form, LastModified Columns are updated correctly. While it is not for
a
, which is inserted with InsertWithChildren
. Am I doing something wrong?
No comments:
Post a Comment