Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ToQueryConditions (1.4 sec)

  1. callbacks/delete.go

    				continue
    			}
    
    			rel, ok := db.Statement.Schema.Relationships.Relations[column]
    			if !ok {
    				continue
    			}
    
    			switch rel.Type {
    			case schema.HasOne, schema.HasMany:
    				queryConds := rel.ToQueryConditions(db.Statement.Context, db.Statement.ReflectValue)
    				modelValue := reflect.New(rel.FieldSchema.ModelType).Interface()
    				tx := db.Session(&gorm.Session{NewDB: true}).Model(modelValue)
    				withoutConditions := false
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Sun May 25 07:40:40 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  2. association.go

    		} else {
    			reflect.Indirect(assignBack.Dest).Set(fieldValue)
    		}
    	}
    }
    
    func (association *Association) buildCondition() *DB {
    	var (
    		queryConds = association.Relationship.ToQueryConditions(association.DB.Statement.Context, association.DB.Statement.ReflectValue)
    		modelValue = reflect.New(association.Relationship.FieldSchema.ModelType).Interface()
    		tx         = association.DB.Model(modelValue)
    	)
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  3. schema/relationship.go

    			} else {
    				constraint.Schema = rel.Schema
    				constraint.ReferenceSchema = ref.PrimaryKey.Schema
    			}
    		}
    	}
    
    	return &constraint
    }
    
    func (rel *Relationship) ToQueryConditions(ctx context.Context, reflectValue reflect.Value) (conds []clause.Expression) {
    	table := rel.FieldSchema.Table
    	foreignFields := []*Field{}
    	relForeignKeys := []string{}
    
    	if rel.JoinTable != nil {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Aug 18 11:44:52 UTC 2025
    - 23.1K bytes
    - Viewed (1)
Back to top