- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 62 for associations (0.06 sec)
-
chainable_api.go
} func (db *DB) executeScopes() (tx *DB) { scopes := db.Statement.scopes db.Statement.scopes = nil for _, scope := range scopes { db = scope(db) } return db } // Preload preload associations with given conditions // // // get all users, and preload all non-cancelled orders // db.Preload("Orders", "state NOT IN (?)", "cancelled").Find(&users) func (db *DB) Preload(query string, args ...interface{}) (tx *DB) {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 19 01:49:06 UTC 2025 - 14.8K bytes - Viewed (0) -
generics.go
data[a.Column.Name] = a.Value } return assoc.Append(data) }, op.Association) } return s.handleAssociationForOwners(base, ctx, func(owner T, assoc *Association) error { return assoc.Append(op.Values...) }, op.Association) } // handleAssociationForOwners is a helper function that handles associations for all owners
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 02 14:09:18 UTC 2025 - 25.9K bytes - Viewed (0) -
statement.go
results[column] = result } else if column == "*" { notRestricted = result for _, dbName := range stmt.Schema.DBNames { results[dbName] = result } } else if column == clause.Associations { for _, rel := range stmt.Schema.Relationships.Relations { results[rel.Name] = result } } else if field := stmt.Schema.LookUpField(column); field != nil && field.DBName != "" {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 04:33:27 UTC 2025 - 20.9K bytes - Viewed (0) -
clause/association.go
type AssociationOpType int const ( OpUnlink AssociationOpType = iota // Unlink association OpDelete // Delete association records OpUpdate // Update association records OpCreate // Create association records with assignments ) // Association represents an association operation type Association struct {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 05:42:26 UTC 2025 - 1.2K bytes - Viewed (0) -
tests/named_polymorphic_test.go
t.Errorf("Should find has one polymorphic association") } hamsterToy = Toy{} DB.Model(&hamster).Association("OtherToy").Find(&hamsterToy) if hamsterToy.Name != hamster.OtherToy.Name { t.Errorf("Should find has one polymorphic association") } // Append DB.Model(&hamster).Association("PreferredToy").Append(&Toy{ Name: "bike 2", }) DB.Model(&hamster).Association("OtherToy").Append(&Toy{ Name: "treadmill 2",
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Wed Jul 08 09:59:40 UTC 2020 - 4.2K bytes - Viewed (0) -
tests/associations_has_many_test.go
} // test delete if err := tx.Model(&item).Association("Contents").Unscoped().Delete(&contents[0]); err != nil { t.Errorf("failed to delete Contents, got error: %v", err) } if count := tx.Model(&item).Association("Contents").Count(); count != 2 { t.Errorf("expected %d contents, got %d", 2, count) } // test clear if err := tx.Model(&item).Association("Contents").Unscoped().Clear(); err != nil {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 04:33:27 UTC 2025 - 16.3K bytes - Viewed (0) -
tests/associations_has_one_test.go
// Find var user2 User DB.Find(&user2, "id = ?", user.ID) DB.Model(&user2).Association("Account").Find(&user2.Account) CheckUser(t, user2, user) // Count AssertAssociationCount(t, user, "Account", 1, "") // Append account := Account{Number: "account-has-one-append"} if err := DB.Model(&user2).Association("Account").Append(&account); err != nil { t.Fatalf("Error happened when append account, got %v", err)
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 7.1K bytes - Viewed (0) -
tests/multi_primary_keys_test.go
var tags3 []Tag DB.Model(&blog).Association("Tags").Find(&tags3) if !compareTags(tags3, []string{"tag6"}) { t.Fatalf("Should find 1 tags after Delete") } if DB.Model(&blog).Association("Tags").Count() != 1 { t.Fatalf("Blog should has three tags after Delete") } DB.Model(&blog).Association("Tags").Delete(tag3) var tags4 []Tag
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 13.1K bytes - Viewed (0) -
tests/associations_belongs_to_test.go
// Clear DB.Model(&users).Association("Company").Clear() AssertAssociationCount(t, users, "Company", 0, "After Clear") DB.Model(&users).Association("Manager").Clear() AssertAssociationCount(t, users, "Manager", 0, "After Clear") // shared company company := Company{Name: "shared"} if err := DB.Model(&users[0]).Association("Company").Append(&company); err != nil {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 9.3K bytes - Viewed (0) -
compat/maven-compat/src/main/mdo/profiles.mdo
<association> <type>Activation</type> </association> </field> <field> <name>properties</name> <description>Extended configuration specific to this profile goes here.</description> <type>Properties</type> <association xml.mapStyle="inline"> <type>String</type>Registered: Sun Dec 28 03:35:09 UTC 2025 - Last Modified: Wed Jan 22 11:03:29 UTC 2025 - 13.8K bytes - Viewed (0)