Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for GetUser (0.23 sec)

  1. tests/scopes_test.go

    	return func(d *gorm.DB) *gorm.DB {
    		return d.Where("name in (?)", names)
    	}
    }
    
    func TestScopes(t *testing.T) {
    	users := []*User{
    		GetUser("ScopeUser1", Config{}),
    		GetUser("ScopeUser2", Config{}),
    		GetUser("ScopeUser3", Config{}),
    	}
    
    	DB.Create(&users)
    
    	var users1, users2, users3 []User
    	DB.Scopes(NameIn1And2).Find(&users1)
    	if len(users1) != 2 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  2. tests/transaction_test.go

    		t.Fatalf("Should find saved record")
    	}
    }
    
    func TestNestedTransactionWithBlock(t *testing.T) {
    	var (
    		user  = *GetUser("transaction-nested", Config{})
    		user1 = *GetUser("transaction-nested-1", Config{})
    		user2 = *GetUser("transaction-nested-2", Config{})
    	)
    
    	if err := DB.Transaction(func(tx *gorm.DB) error {
    		tx.Create(&user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  3. tests/benchmark_test.go

    func BenchmarkCreate(b *testing.B) {
    	user := *GetUser("bench", Config{})
    
    	for x := 0; x < b.N; x++ {
    		user.ID = 0
    		DB.Create(&user)
    	}
    }
    
    func BenchmarkFind(b *testing.B) {
    	user := *GetUser("find", Config{})
    	DB.Create(&user)
    
    	for x := 0; x < b.N; x++ {
    		DB.Find(&User{}, "id = ?", user.ID)
    	}
    }
    
    func BenchmarkScan(b *testing.B) {
    	user := *GetUser("scan", Config{})
    	DB.Create(&user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 01 03:50:57 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  4. tests/associations_many2many_test.go

    	}
    
    	// Append
    	teams1 := []User{*GetUser("friend-append-1", Config{})}
    	teams2 := []User{}
    	teams3 := []*User{GetUser("friend-append-3-1", Config{}), GetUser("friend-append-3-2", Config{})}
    
    	DB.Model(&users).Association("Team").Append(&teams1, &teams2, &teams3)
    
    	AssertAssociationCount(t, users, "Team", 9, "After Append")
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
  5. tests/create_test.go

    		*GetUser("bulk_4", Config{Account: true, Pets: 3, Toys: 0, Company: false, Manager: true, Team: 0, Languages: 3, Friends: 0}),
    		*GetUser("bulk_5", Config{Account: false, Pets: 0, Toys: 3, Company: true, Manager: false, Team: 1, Languages: 3, Friends: 1}),
    		*GetUser("bulk_6", Config{Account: true, Pets: 4, Toys: 3, Company: false, Manager: true, Team: 1, Languages: 3, Friends: 0}),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  6. tests/update_test.go

    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestUpdate(t *testing.T) {
    	var (
    		users = []*User{
    			GetUser("update-1", Config{}),
    			GetUser("update-2", Config{}),
    			GetUser("update-3", Config{}),
    		}
    		user          = users[1]
    		lastUpdatedAt time.Time
    	)
    
    	checkUpdatedAtChanged := func(name string, n time.Time) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  7. tests/associations_has_many_test.go

    	}
    
    	AssertAssociationCount(t, user2, "Team", 0, "after clear")
    }
    
    func TestHasManyAssociationForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-hasmany-1", Config{Pets: 2}),
    		*GetUser("slice-hasmany-2", Config{Pets: 0}),
    		*GetUser("slice-hasmany-3", Config{Pets: 4}),
    	}
    
    	DB.Create(&users)
    
    	// Count
    	AssertAssociationCount(t, users, "Pets", 6, "")
    
    	// Find
    	var pets []Pet
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  8. tests/joins_test.go

    	}
    
    	CheckUser(t, user2, user)
    }
    
    func TestJoinsForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-joins-1", Config{Company: true, Manager: true, Account: true}),
    		*GetUser("slice-joins-2", Config{Company: true, Manager: true, Account: true}),
    		*GetUser("slice-joins-3", Config{Company: true, Manager: true, Account: true}),
    	}
    
    	DB.Create(&users)
    
    	var userIDs []uint
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  9. tests/query_test.go

    	users := []User{
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    		*GetUser("find_in_batches_with_offset_limit", Config{}),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java

                if (form instanceof EditForm) {
                    return ComponentUtil.getComponent(UserService.class).getUser(((EditForm) form).id);
                }
                break;
            default:
                break;
            }
            return OptionalEntity.empty();
        }
    
        public static OptionalEntity<User> getUser(final CreateForm form) {
            return getEntity(form).map(entity -> {
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 15.9K bytes
    - Viewed (0)
Back to top