- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for POLYMORPHIC (0.05 sec)
-
schema/relationship.go
// OwnerType string // } func (schema *Schema) buildPolymorphicRelation(relation *Relationship, field *Field) { polymorphic := field.TagSettings["POLYMORPHIC"] relation.Polymorphic = &Polymorphic{ Value: schema.Table, } var ( typeName = polymorphic + "Type" typeId = polymorphic + "ID" ) if value, ok := field.TagSettings["POLYMORPHICTYPE"]; ok { typeName = strings.TrimSpace(value) }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 16 04:11:05 UTC 2025 - 23.1K bytes - Viewed (1) -
schema/relationship_test.go
Schema: "User", FieldSchema: "Toy", Polymorphic: Polymorphic{ID: "OwnerID", Type: "OwnerType", Value: "users"}, References: []Reference{ {ForeignKey: "OwnerType", ForeignSchema: "Toy", PrimaryValue: "users"}, }, }, }, }, }) }) t.Run("has one with custom polymorphic type and id", func(t *testing.T) { type Toy struct { ID int
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 26.5K bytes - Viewed (0) -
schema/schema_helper_test.go
} if r.Polymorphic != nil { if r.Polymorphic.PolymorphicID.Name != relation.Polymorphic.ID { t.Errorf("schema %v relation's polymorphic id field expects %v, but got %v", s, relation.Polymorphic.ID, r.Polymorphic.PolymorphicID.Name) } if r.Polymorphic.PolymorphicType.Name != relation.Polymorphic.Type {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 7.5K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java
* * @author David Richter */ @NullUnmarked public class IteratorBenchmark { @Param({"0", "1", "16", "256", "4096", "65536"}) int size; // use concrete classes to remove any possible polymorphic overhead? Object[] array; ArrayList<Object> arrayList; LinkedList<Object> linkedList; @BeforeExperiment void setUp() { array = new Object[size];Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue May 13 17:27:14 UTC 2025 - 3.5K bytes - Viewed (0) -
schema/schema_test.go
References: []Reference{{"ID", "User", "UserID", "Pet", "", true}}, }, { Name: "Toys", Type: schema.HasMany, Schema: "User", FieldSchema: "Toy", Polymorphic: Polymorphic{ID: "OwnerID", Type: "OwnerType", Value: "users"}, References: []Reference{{"ID", "User", "OwnerID", "Toy", "", true}, {"", "", "OwnerType", "Toy", "users", false}}, }, {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/association_generics_test.go
t.Fatalf("Set Update many2many clear failed: %v", err) } else if rows != 0 { t.Fatalf("expected 0 rows affected, got %d", rows) } AssertAssociationCount(t, user, "Languages", 0, "after clear") } // Polymorphic Tools create and unlink func TestClauseAssociationSetUpdatePolymorphicTools(t *testing.T) { ctx := context.Background() user := User{Name: "TestClauseAssociationSetUpdatePolymorphicTools", Age: 25}
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 05:42:26 UTC 2025 - 37.9K bytes - Viewed (0) -
tests/associations_has_many_test.go
// Find var toys []Toy if DB.Model(&users).Association("Toys").Find(&toys); len(toys) != 6 { t.Errorf("toys count should be %v, but got %v", 6, len(toys)) } // Find Tools (polymorphic with custom type and id) var tools []Tools DB.Model(&users).Association("Tools").Find(&tools) if len(tools) != 2 { t.Errorf("tools count should be %v, but got %v", 2, len(tools)) } // Append
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 04:33:27 UTC 2025 - 16.3K bytes - Viewed (0)