"<-" 属性的问题 #735

Open
opened 2017-09-22 07:58:34 +00:00 by aqtata · 3 comments
aqtata commented 2017-09-22 07:58:34 +00:00 (Migrated from github.com)

结构体中的一个字段是多表查询时临时存储数据用的,不用直接写入数据库,所以我将它声明为"<-",我的理解是加了这个属性的字段在create/update时不会在sql语句中生成字段信息。
但是实际操作起来发现sql语句中还是有这个字段。

1
2
3

我只能显示地在Omit中加入排除这个字段才行。
是我对这个属性的理解有误还是BUG?

结构体中的一个字段是多表查询时临时存储数据用的,不用直接写入数据库,所以我将它声明为"<-",我的理解是加了这个属性的字段在create/update时不会在sql语句中生成字段信息。 但是实际操作起来发现sql语句中还是有这个字段。 ![1](https://user-images.githubusercontent.com/11865762/30734685-cb712af2-9fae-11e7-9886-e6b68a981a95.png) ![2](https://user-images.githubusercontent.com/11865762/30734686-cb825c8c-9fae-11e7-9d1d-dbef539b47d7.png) ![3](https://user-images.githubusercontent.com/11865762/30734687-cb877f1e-9fae-11e7-81bc-002e6740c37c.png) 我只能显示地在Omit中加入排除这个字段才行。 是我对这个属性的理解有误还是BUG?

<-属性只是表示这个字段在插入和更新时不会出现,在获取时还是有。

<-属性只是表示这个字段在插入和更新时不会出现,在获取时还是有。
aqtata commented 2017-09-22 09:40:40 +00:00 (Migrated from github.com)

那我理解的是正确的,但是我反馈的图片中可以看到,我是执行的Update操作,然而sql语句中还是出现了。

那我理解的是正确的,但是我反馈的图片中可以看到,我是执行的Update操作,然而sql语句中还是出现了。
mlboy commented 2017-09-25 09:48:35 +00:00 (Migrated from github.com)

感觉是因为你用了 AllCols 所以就会出现了

感觉是因为你用了 AllCols 所以就会出现了
lunny added this to the 1.3.0 milestone 2021-08-04 05:07:34 +00:00
lunny added the
kind
proposal
label 2021-08-04 05:07:42 +00:00
lunny modified the milestone from 1.3.0 to 2.0.0 2021-10-20 00:55:24 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#735
No description provided.