diff --git a/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go b/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go index b32af2fb1e0..f71a3d378b5 100644 --- a/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go +++ b/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go @@ -93,36 +93,17 @@ func Test_Table_Relation_With_Scan(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_score" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -291,36 +272,17 @@ func Test_Table_Relation_With(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -491,36 +453,17 @@ func Test_Table_Relation_WithAll(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -606,36 +549,17 @@ func Test_Table_Relation_WithAll_List(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -747,36 +671,17 @@ func Test_Table_Relation_WithAllCondition_List(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -883,36 +788,17 @@ func Test_Table_Relation_WithAll_Embedded_With_SelfMaintained_Attributes(t *test tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -998,36 +884,17 @@ func Test_Table_Relation_WithAll_Embedded_Without_SelfMaintained_Attributes(t *t tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -1121,36 +988,17 @@ func Test_Table_Relation_WithAll_Embedded_WithoutMeta(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - `, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -1237,36 +1085,17 @@ func Test_Table_Relation_WithAll_AttributeStructAlsoHasWithTag(t *testing.T) { tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -1353,36 +1182,17 @@ func Test_Table_Relation_WithAll_AttributeStructAlsoHasWithTag_MoreDeep(t *testi tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) @@ -1499,36 +1309,17 @@ func Test_Table_Relation_With_AttributeStructAlsoHasWithTag_MoreDeep(t *testing. tableUserDetail = "user_detail" tableUserScores = "user_scores" ) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -name varchar(45) NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUser)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil { gtest.Error(err) } defer dropTable(tableUser) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -uid int(10) unsigned NOT NULL AUTO_INCREMENT, -address varchar(45) NOT NULL, -PRIMARY KEY (uid) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserDetail)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil { gtest.Error(err) } defer dropTable(tableUserDetail) - if _, err := db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE IF NOT EXISTS %s ( -id int(10) unsigned NOT NULL AUTO_INCREMENT, -uid int(10) unsigned NOT NULL, -score int(10) unsigned NOT NULL, -PRIMARY KEY (id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -`, tableUserScores)); err != nil { + if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil { gtest.Error(err) } defer dropTable(tableUserScores) diff --git a/contrib/drivers/mysql/testdata/with_tpl_user.sql b/contrib/drivers/mysql/testdata/with_tpl_user.sql new file mode 100644 index 00000000000..032e9c55dfd --- /dev/null +++ b/contrib/drivers/mysql/testdata/with_tpl_user.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS %s ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + name varchar(45) NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql b/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql new file mode 100644 index 00000000000..54bbccd090c --- /dev/null +++ b/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS %s ( + uid int(10) unsigned NOT NULL AUTO_INCREMENT, + address varchar(45) NOT NULL, + PRIMARY KEY (uid) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql b/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql new file mode 100644 index 00000000000..d1640ee0a49 --- /dev/null +++ b/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS %s ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + uid int(10) unsigned NOT NULL, + score int(10) unsigned NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/database/gdb/gdb_model_with.go b/database/gdb/gdb_model_with.go index 74c18caee34..1bef5a60f86 100644 --- a/database/gdb/gdb_model_with.go +++ b/database/gdb/gdb_model_with.go @@ -318,7 +318,7 @@ func (m *Model) parseWithTagInFieldStruct(field gstructs.Field) (output parseWit array []string key string ) - for _, v := range gstr.SplitAndTrim(ormTag, " ") { + for _, v := range gstr.SplitAndTrim(ormTag, ",") { array = gstr.Split(v, ":") if len(array) == 2 { key = array[0] @@ -327,9 +327,6 @@ func (m *Model) parseWithTagInFieldStruct(field gstructs.Field) (output parseWit data[key] += " " + gstr.Trim(v) } } - for k, v := range data { - data[k] = gstr.TrimRight(v, ",") - } output.With = data[OrmTagForWith] output.Where = data[OrmTagForWithWhere] output.Order = data[OrmTagForWithOrder]