建议增加 DisableExtendsID 方法或 FixedIDName 方法 #1342
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1342
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
一个 model 有定义主键字段,带extends 字段,当 extends 字段类型结构体中也定义了主键字段时,不采用 where 方式 调用 session.ID(pkVal).Get 方法报错如下:
ID condition is error, expect 3 primarykeys, there are 1
很多时候都会一个 model 引用另一个 model 吧,这个时候没必要为了这个单独又添加个只是少个 pk标记或字段的 model.
建议增加方法指定不进行 extends 字段的主键处理,如 session.DisableExtendsID()
或增加方法强制指定主键字段,如 session.FixedIDName(“id”)