From 16b813a159422408dd94f15e0a01fb8b6619125c Mon Sep 17 00:00:00 2001 From: Apphost <125987965@qq.com> Date: Mon, 9 Mar 2015 22:00:34 +0800 Subject: [PATCH] fix non-int pk issues --- statement.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/statement.go b/statement.go index c7d881f4..baf4d9b0 100644 --- a/statement.go +++ b/statement.go @@ -599,7 +599,9 @@ func buildConditions(engine *Engine, table *core.Table, bean interface{}, if table, ok := engine.Tables[fieldValue.Type()]; ok { if len(table.PrimaryKeys) == 1 { pkField := reflect.Indirect(fieldValue).FieldByName(table.PKColumns()[0].FieldName) - if pkField.Int() != 0 { + // fix non-int pk issues + //if pkField.Int() != 0 { + if pkField.IsValid() { val = pkField.Interface() } else { continue