Skip to content

Commit

Permalink
Fix bug about TransactionKey property.
Browse files Browse the repository at this point in the history
  • Loading branch information
higty committed Oct 14, 2019
1 parent b78c546 commit 22cfd82
Show file tree
Hide file tree
Showing 58 changed files with 21 additions and 551 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ public Method CreateDeleteByValueMethod1()
md.Parameters.Add(new MethodParameter("Database", "database"));

md.Body.Add(SourceCodeLanguage.CSharp, "var sp = new {0}Delete();", t.Name);
md.Body.Add(SourceCodeLanguage.CSharp, "((IDatabaseContext)sp).TransactionKey = this.TransactionKey;");
foreach (var column in t.GetPrimaryKeyOrTimestampColumns())
{
var pName = this.ToCamelCase(column.Name);
Expand Down Expand Up @@ -398,7 +397,6 @@ public IEnumerable<CodeBlock> CreateSelectByPrimaryKeyStoredProcedureMethodBody(
var t = this.Table;

yield return new CodeBlock(SourceCodeLanguage.CSharp, "var sp = new {0}SelectByPrimaryKey();", t.Name);
yield return new CodeBlock(SourceCodeLanguage.CSharp, "((IDatabaseContext)sp).TransactionKey = this.TransactionKey;");
yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record == null) return sp;");

yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record.OldRecord == null) throw new OldRecordIsNullException();");
Expand All @@ -424,7 +422,6 @@ public IEnumerable<CodeBlock> CreateInsertStoredProcedureMethodBody()
{
var t = this.Table;
yield return new CodeBlock(SourceCodeLanguage.CSharp, "var sp = new {0}Insert();", t.Name);
yield return new CodeBlock(SourceCodeLanguage.CSharp, "((IDatabaseContext)sp).TransactionKey = this.TransactionKey;");
yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record == null) return sp;");

foreach (var column in t.Columns)
Expand All @@ -449,7 +446,6 @@ public IEnumerable<CodeBlock> CreateUpdateStoredProcedureMethodBody()
var t = this.Table;

yield return new CodeBlock(SourceCodeLanguage.CSharp, "var sp = new {0}Update();", t.Name);
yield return new CodeBlock(SourceCodeLanguage.CSharp, "((IDatabaseContext)sp).TransactionKey = this.TransactionKey;");
yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record == null) return sp;");

yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record.OldRecord == null) throw new OldRecordIsNullException();");
Expand Down Expand Up @@ -480,7 +476,6 @@ public IEnumerable<CodeBlock> CreateDeleteStoredProcedureMethodBody()
var t = this.Table;

yield return new CodeBlock(SourceCodeLanguage.CSharp, "var sp = new {0}Delete();", t.Name);
yield return new CodeBlock(SourceCodeLanguage.CSharp, "((IDatabaseContext)sp).TransactionKey = this.TransactionKey;");
yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record == null) return sp;");

yield return new CodeBlock(SourceCodeLanguage.CSharp, "if (record.OldRecord == null) throw new OldRecordIsNullException();");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public String CharColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public Int32 Delete(Int64 primaryKeyColumn, DateTime? timestampColumn)
public Int32 Delete(Database database, Int64 primaryKeyColumn, DateTime? timestampColumn)
{
var sp = new alldatatypetableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
sp.PK_PrimaryKeyColumn = primaryKeyColumn;
sp.PK_TimestampColumn = timestampColumn;
return sp.ExecuteNonQuery(database);
Expand Down Expand Up @@ -110,7 +109,6 @@ public alldatatypetableSelectAll CreateSelectAllStoredProcedure()
public alldatatypetableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedure(Record record)
{
var sp = new alldatatypetableSelectByPrimaryKey();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_PrimaryKeyColumn = record.OldRecord.PrimaryKeyColumn;
Expand All @@ -119,7 +117,6 @@ public alldatatypetableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedur
public alldatatypetableInsert CreateInsertStoredProcedure(Record record)
{
var sp = new alldatatypetableInsert();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
sp.PrimaryKeyColumn = record.PrimaryKeyColumn;
sp.TimestampColumn = record.TimestampColumn;
Expand Down Expand Up @@ -196,7 +193,6 @@ public alldatatypetableInsert CreateInsertStoredProcedure(Record record)
public alldatatypetableUpdate CreateUpdateStoredProcedure(Record record)
{
var sp = new alldatatypetableUpdate();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PrimaryKeyColumn = record.PrimaryKeyColumn;
Expand Down Expand Up @@ -276,7 +272,6 @@ public alldatatypetableUpdate CreateUpdateStoredProcedure(Record record)
public alldatatypetableDelete CreateDeleteStoredProcedure(Record record)
{
var sp = new alldatatypetableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_PrimaryKeyColumn = record.OldRecord.PrimaryKeyColumn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public Int32 Delete(Int32 intColumn, DateTime? timestampColumn)
public Int32 Delete(Database database, Int32 intColumn, DateTime? timestampColumn)
{
var sp = new identitytableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
sp.PK_IntColumn = intColumn;
sp.PK_TimestampColumn = timestampColumn;
return sp.ExecuteNonQuery(database);
Expand Down Expand Up @@ -112,7 +111,6 @@ public identitytableSelectAll CreateSelectAllStoredProcedure()
public identitytableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedure(Record record)
{
var sp = new identitytableSelectByPrimaryKey();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_IntColumn = record.OldRecord.IntColumn;
Expand All @@ -121,7 +119,6 @@ public identitytableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedure(R
public identitytableInsert CreateInsertStoredProcedure(Record record)
{
var sp = new identitytableInsert();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
sp.IntColumn = record.IntColumn;
sp.TimestampColumn = record.TimestampColumn;
Expand All @@ -131,7 +128,6 @@ public identitytableInsert CreateInsertStoredProcedure(Record record)
public identitytableUpdate CreateUpdateStoredProcedure(Record record)
{
var sp = new identitytableUpdate();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.IntColumn = record.IntColumn;
Expand All @@ -144,7 +140,6 @@ public identitytableUpdate CreateUpdateStoredProcedure(Record record)
public identitytableDelete CreateDeleteStoredProcedure(Record record)
{
var sp = new identitytableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_IntColumn = record.OldRecord.IntColumn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public Int32 Delete(Int64 bigIntColumn, Int32 intColumn, Single floatColumn, Dat
public Int32 Delete(Database database, Int64 bigIntColumn, Int32 intColumn, Single floatColumn, DateTime? timestampColumn)
{
var sp = new multipktableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
sp.PK_BigIntColumn = bigIntColumn;
sp.PK_IntColumn = intColumn;
sp.PK_FloatColumn = floatColumn;
Expand Down Expand Up @@ -114,7 +113,6 @@ public multipktableSelectAll CreateSelectAllStoredProcedure()
public multipktableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedure(Record record)
{
var sp = new multipktableSelectByPrimaryKey();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_BigIntColumn = record.OldRecord.BigIntColumn;
Expand All @@ -125,7 +123,6 @@ public multipktableSelectByPrimaryKey CreateSelectByPrimaryKeyStoredProcedure(Re
public multipktableInsert CreateInsertStoredProcedure(Record record)
{
var sp = new multipktableInsert();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
sp.BigIntColumn = record.BigIntColumn;
sp.IntColumn = record.IntColumn;
Expand All @@ -141,7 +138,6 @@ public multipktableInsert CreateInsertStoredProcedure(Record record)
public multipktableUpdate CreateUpdateStoredProcedure(Record record)
{
var sp = new multipktableUpdate();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.BigIntColumn = record.BigIntColumn;
Expand All @@ -162,7 +158,6 @@ public multipktableUpdate CreateUpdateStoredProcedure(Record record)
public multipktableDelete CreateDeleteStoredProcedure(Record record)
{
var sp = new multipktableDelete();
((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
if (record == null) return sp;
if (record.OldRecord == null) throw new OldRecordIsNullException();
sp.PK_BigIntColumn = record.OldRecord.BigIntColumn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 PK_PrimaryKeyColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 PrimaryKeyColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}

public alldatatypetableSelectAll()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 PK_PrimaryKeyColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 PrimaryKeyColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int32 PK_IntColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int32 IntColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}

public identitytableSelectAll()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int32 PK_IntColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int32 IntColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 PK_BigIntColumn
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ public String DatabaseKey
((IDatabaseContext)this).DatabaseKey = value;
}
}
public String TransactionKey
{
get
{
return ((IDatabaseContext)this).TransactionKey;
}
set
{
((IDatabaseContext)this).TransactionKey = value;
}
}
public Int64 BigIntColumn
{
get
Expand Down
Loading

0 comments on commit 22cfd82

Please sign in to comment.