- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for OwnPrimaryKey (0.06 sec)
-
schema/schema_helper_test.go
found = true } } if !found { var refs []string for _, rf := range r.References { var primaryKey, primaryKeySchema string
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 7.5K bytes - Viewed (0) -
association.go
// we have to record the old BelongsTo value if association.Unscope && rel.Type == schema.BelongsTo { var foreignFields []*schema.Field for _, ref := range rel.References { if !ref.OwnPrimaryKey { foreignFields = append(foreignFields, ref.ForeignKey) } } if _, fvs := schema.GetIdentityFieldValuesMap(association.DB.Statement.Context, reflectValue, foreignFields); len(fvs) > 0 {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 21.5K bytes - Viewed (0) -
callbacks/associations.go
continue } setupReferences := func(obj reflect.Value, elem reflect.Value) { for _, ref := range rel.References { if !ref.OwnPrimaryKey { pv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, elem) db.AddError(ref.ForeignKey.Set(db.Statement.Context, obj, pv)) if dest, ok := db.Statement.Dest.(map[string]interface{}); ok {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Feb 13 06:16:26 UTC 2025 - 14.4K bytes - Viewed (0) -
schema/relationship.go
} for _, ref := range rel.References { if ref.PrimaryKey != nil && (rel.JoinTable == nil || ref.OwnPrimaryKey) { constraint.ForeignKeys = append(constraint.ForeignKeys, ref.ForeignKey) constraint.References = append(constraint.References, ref.PrimaryKey) if ref.OwnPrimaryKey { constraint.Schema = ref.ForeignKey.Schema constraint.ReferenceSchema = rel.Schema } else {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 23.1K bytes - Viewed (1) -
callbacks/preload.go
joinRelForeignFields = make([]*schema.Field, 0, len(rel.References)) joinForeignKeys = make([]string, 0, len(rel.References)) ) for _, ref := range rel.References { if ref.OwnPrimaryKey { joinForeignKeys = append(joinForeignKeys, ref.ForeignKey.DBName) joinForeignFields = append(joinForeignFields, ref.ForeignKey) foreignFields = append(foreignFields, ref.PrimaryKey)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 11.7K bytes - Viewed (0) -
callbacks/delete.go
table = rel.JoinTable.Table tx = db.Session(&gorm.Session{NewDB: true}).Model(modelValue).Table(table) ) for _, ref := range rel.References { if ref.OwnPrimaryKey { foreignFields = append(foreignFields, ref.PrimaryKey) relForeignKeys = append(relForeignKeys, ref.ForeignKey.DBName) } else if ref.PrimaryValue != "" { queryConds = append(queryConds, clause.Eq{
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 5.8K bytes - Viewed (0) -
callbacks/query.go
Expression: join.Expression, } } exprs := make([]clause.Expression, len(relation.References)) for idx, ref := range relation.References { if ref.OwnPrimaryKey { exprs[idx] = clause.Eq{ Column: clause.Column{Table: parentTableName, Name: ref.PrimaryKey.DBName}, Value: clause.Column{Table: tableAliasName, Name: ref.ForeignKey.DBName}, }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 10.4K bytes - Viewed (1) -
generics.go
tx.AddError(fmt.Errorf("many2many relation %s don't support LimitPerRecord", association)) return tx } refColumns := []clause.Column{} for _, rel := range relation.References { if rel.OwnPrimaryKey { refColumns = append(refColumns, clause.Column{Name: rel.ForeignKey.DBName}) } } if len(refColumns) != 0 { selectExpr := clause.CommaExpression{}
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 15.5K bytes - Viewed (0)