Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for belongsTo (0.24 sec)

  1. schema/relationship_test.go

    				"Country": {
    					Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country",
    					References: []Reference{
    						{PrimaryKey: "ID", PrimarySchema: "Country", ForeignKey: "CountryID", ForeignSchema: "Org"},
    					},
    				},
    			},
    		},
    		"VisitingAddress": {
    			Relations: map[string]Relation{
    				"Country": {
    					Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country",
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. schema/relationship.go

    	HasMany   RelationshipType = "has_many"     // HasManyRel has many relationship
    	BelongsTo RelationshipType = "belongs_to"   // BelongsToRel belongs to relationship
    	Many2Many RelationshipType = "many_to_many" // Many2ManyRel many to many relationship
    	has       RelationshipType = "has"
    )
    
    type Relationships struct {
    	HasOne    []*Relationship
    	BelongsTo []*Relationship
    	HasMany   []*Relationship
    	Many2Many []*Relationship
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  3. 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)
    				}
    			}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  4. 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}},
    		},
    		{
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  5. callbacks/associations.go

    	return func(db *gorm.DB) {
    		if db.Error == nil && db.Statement.Schema != nil {
    			selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create)
    
    			// Save Belongs To associations
    			for _, rel := range db.Statement.Schema.Relationships.BelongsTo {
    				if v, ok := selectColumns[rel.Name]; (ok && !v) || (!ok && restricted) {
    					continue
    				}
    
    				setupReferences := func(obj reflect.Value, elem reflect.Value) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  6. tests/associations_test.go

    	if err := DB.AutoMigrate(&Profile{}, &Member{}); err != nil {
    		t.Fatalf("Failed to migrate, got error: %v", err)
    	}
    
    	member := Member{Name: "foreign_key_constraints_belongs_to", Profile: Profile{Name: "my_profile_belongs_to", Refer: 1}}
    
    	DB.Create(&member)
    
    	var profile Profile
    	if err := DB.First(&profile, "id = ?", member.Profile.ID).Error; err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  7. build-logic-commons/code-quality-rules/src/main/resources/classycle/classycle_report_resources.zip

    Size Girth Radius Diameter Layer Package Cycles Name Number of packagess Best Fragment Size Girth Radius Diameter Layer Layers Layer Number of classes Classes of layer : Classes and Packages Click on or to go to the cycle to which the class/package belongs. Class/Package Size Used by Uses internal Uses external Layer Source(s) # Member of cycle Classes using : uses: true uses: Packages using : uses: true uses: Classes of cycle : Best fragmenter(s) of cycle : Center classes of cycle : Packages of cycle...
    ZIP Archive
    - Registered: Wed May 01 11:36:15 GMT 2024
    - Last Modified: Wed Dec 09 08:14:05 GMT 2020
    - 23.4K bytes
    - Viewed (0)
  8. maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java

            if (projectRealm != null) {
                Thread.currentThread().setContextClassLoader(projectRealm);
            }
        }
    
        // TODO I'm really wondering where this method belongs; smells like it should be on MavenProject, but for some
        // reason it isn't ? This localization is kind-of a code smell.
    
        public static String getKey(MavenProject project) {
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Wed Sep 06 08:39:32 GMT 2023
    - 10.2K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/eventbus/SubscriberRegistry.java

       */
      private final ConcurrentMap<Class<?>, CopyOnWriteArraySet<Subscriber>> subscribers =
          Maps.newConcurrentMap();
    
      /** The event bus this registry belongs to. */
      @Weak private final EventBus bus;
    
      SubscriberRegistry(EventBus bus) {
        this.bus = checkNotNull(bus);
      }
    
      /** Registers all subscriber methods on the given listener object. */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 22 13:05:46 GMT 2021
    - 10.5K bytes
    - Viewed (0)
  10. tests/upsert_test.go

    		t.Errorf("has many association should be saved")
    	}
    
    	if err := DB.Where("number = ?", "1231231231").First(&Account{}).Error; err != nil {
    		t.Errorf("belongs to association should be saved")
    	}
    }
    
    func TestUpdateWithMissWhere(t *testing.T) {
    	type User struct {
    		ID   uint   `gorm:"column:id;<-:create"`
    		Name string `gorm:"column:name"`
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
Back to top