Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 6 of 6 for BelongsTo (0.06 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. schema/relationship_test.go

    				"Country": {
    					Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country",
    					References: []Reference{
    						{PrimaryKey: "ID", PrimarySchema: "Country", ForeignKey: "CountryID", ForeignSchema: "Org"},
    					},
    				},
    			},
    		},
    		"VisitingAddress": {
    			Relations: map[string]Relation{
    				"Country": {
    					Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country",
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Mon Aug 18 11:44:52 GMT 2025
    - 26.5K bytes
    - Click Count (0)
  2. association.go

    		reflectValue := association.DB.Statement.ReflectValue
    		rel := association.Relationship
    
    		var oldBelongsToExpr clause.Expression
    		// 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)
    				}
    			}
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Sun Oct 26 12:09:12 GMT 2025
    - 23.6K bytes
    - Click Count (0)
  3. schema/schema_test.go

    		},
    		{
    			Name: "Company", Type: schema.BelongsTo, Schema: "User", FieldSchema: "Company",
    			References: []Reference{{"ID", "Company", "CompanyID", "User", "", false}},
    		},
    		{
    			Name: "Manager", Type: schema.BelongsTo, Schema: "User", FieldSchema: "User",
    			References: []Reference{{"ID", "User", "ManagerID", "User", "", false}},
    		},
    		{
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Thu Aug 28 02:57:17 GMT 2025
    - 13.3K bytes
    - Click Count (0)
  4. callbacks/update.go

    				db.Statement.ReflectValue = db.Statement.ReflectValue.Elem()
    			}
    
    			if dest, ok := db.Statement.Dest.(map[string]interface{}); ok {
    				for _, rel := range db.Statement.Schema.Relationships.BelongsTo {
    					if _, ok := dest[rel.Name]; ok {
    						db.AddError(rel.Field.Set(db.Statement.Context, db.Statement.ReflectValue, dest[rel.Name]))
    					}
    				}
    			}
    		}
    	}
    }
    
    // BeforeUpdate before update hooks
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Sun May 25 07:40:40 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  5. callbacks/associations.go

    		if db.Error == nil && db.Statement.Schema != nil {
    			selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create)
    
    			// Save Belongs To associations
    			for _, rel := range db.Statement.Schema.Relationships.BelongsTo {
    				if v, ok := selectColumns[rel.Name]; (ok && !v) || (!ok && restricted) {
    					continue
    				}
    
    				setupReferences := func(obj reflect.Value, elem reflect.Value) {
    					for _, ref := range rel.References {
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Thu Feb 13 06:16:26 GMT 2025
    - 14.4K bytes
    - Click Count (0)
  6. generics.go

    			return assocDB.Updates(fkNil).Error
    		case clause.OpDelete:
    			return assocDB.Delete(assocModel).Error
    		case clause.OpUpdate:
    			return assocDB.Updates(setMap).Error
    		}
    	case schema.BelongsTo:
    		switch op.Type {
    		case clause.OpDelete:
    			return base.Transaction(func(tx *DB) error {
    				assocDB.Statement.ConnPool = tx.Statement.ConnPool
    				base.Statement.ConnPool = tx.Statement.ConnPool
    
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Sun Nov 02 14:09:18 GMT 2025
    - 25.9K bytes
    - Click Count (0)
Back to Top