- Sort Score
- Num 10 results
- Language All
Results 1 - 9 of 9 for Polymorphic (0.11 seconds)
-
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) }
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Sun Nov 16 04:11:05 GMT 2025 - 23.1K bytes - Click Count (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
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) -
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 {Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Aug 28 02:57:17 GMT 2025 - 7.5K bytes - Click Count (0) -
utils/tests/models.go
) // User has one `Account` (has one), many `Pets` (has many) and `Toys` (has many - polymorphic) // He works in a Company (belongs to), he has a Manager (belongs to - single-table), and also managed a Team (has many - single-table) // He speaks many languages (many to many) and has many friends (many to many - single-table) // His pet also has one Toy (has one - polymorphic) // NamedPet is a reference to a named `Pet` (has one) type User struct {
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Click Count (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];Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Tue May 13 17:27:14 GMT 2025 - 3.5K bytes - Click Count (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}}, }, {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) -
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}
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Sep 12 05:42:26 GMT 2025 - 37.9K bytes - Click Count (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
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Sep 12 04:33:27 GMT 2025 - 16.3K bytes - Click Count (0) -
doc/go_spec.html
<code>Add</code> and <code>Slice</code>. </li> </ul> <h4 id="Go_1.18">Go 1.18</h4> <p> The 1.18 release adds polymorphic functions and types ("generics") to the language. Specifically: </p> <ul> <li> The set of <a href="#Operators_and_punctuation">operators and punctuation</a> includes the new token <code>~</code>. </li>
Created: Tue Dec 30 11:13:12 GMT 2025 - Last Modified: Tue Dec 02 23:07:19 GMT 2025 - 286.5K bytes - Click Count (1)