Update Oracle unit test

This commit is contained in:
sunkaixuan 2022-12-20 16:25:24 +08:00
parent 47748ca2b5
commit 166f5ff422

View File

@ -22,6 +22,47 @@ namespace OrmTest
}).ExecuteCommand();
db.Insertable(new ORDER() { Name = "a" }).ExecuteCommand();
db.Updateable(new Order()
{
CustomId = 1,
CreateTime = DateTime.Now,
Id = 1,
Price = 1,
Name = "a"
}).ExecuteCommand();
db.Updateable(new List<Order>(){ new Order()
{
CustomId = 1,
CreateTime = DateTime.Now,
Id = 1,
Price = 1,
Name = "a"
},
new Order()
{
CustomId = 1,
CreateTime = DateTime.Now,
Id = 1,
Price = 1,
Name = "a"
} }).ExecuteCommand();
db.Updateable<Order>().SetColumns(it => new Order()
{
CustomId = 1,
Price = 1,
Name = "a"
}, true).Where(it => it.Id == 1).ExecuteCommand();
db.Updateable<ORDER>().SetColumns(it => new ORDER()
{
CustomId = 1,
Price = 1,
Name = "a"
}, true).Where(it => it.Id == 1).ExecuteCommand();
}
public class Order
@ -33,7 +74,7 @@ namespace OrmTest
/// </summary>
public string Name { get; set; }
public decimal Price { get; set; }
[SugarColumn(InsertServerTime =true)]
[SugarColumn(InsertServerTime =true,UpdateServerTime =true)]
public DateTime CreateTime { get; set; }
[SugarColumn(IsNullable = true)]
public int CustomId { get; set; }
@ -48,7 +89,7 @@ namespace OrmTest
/// </summary>
public string Name { get; set; }
public decimal Price { get; set; }
[SugarColumn(InsertSql = "sysdate")]
[SugarColumn(InsertSql = "sysdate", UpdateSql = "sysdate")]
public DateTime CreateTime { get; set; }
[SugarColumn(IsNullable = true)]
public int CustomId { get; set; }