Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for BelongsTo (0.07 sec)

  1. schema/relationship.go

    		schema.buildPolymorphicRelation(relation, field)
    	} else if many2many := field.TagSettings["MANY2MANY"]; many2many != "" {
    		schema.buildMany2ManyRelation(relation, field, many2many)
    	} else if belongsTo := field.TagSettings["BELONGSTO"]; belongsTo != "" {
    		schema.guessRelation(relation, field, guessBelongs)
    	} else {
    		switch field.IndirectFieldType.Kind() {
    		case reflect.Struct:
    			schema.guessRelation(relation, field, guessGuess)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (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)
    				}
    			}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (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}},
    		},
    		{
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 20 12:19:31 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top