-
Notifications
You must be signed in to change notification settings - Fork 0
/
hasmanywithpointers_company.go
37 lines (31 loc) · 2.26 KB
/
hasmanywithpointers_company.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Code generated by badaas-cli v0.0.0, DO NOT EDIT.
package conditions
import (
condition "github.com/FrancoLiberali/cql/condition"
model "github.com/FrancoLiberali/cql/model"
hasmanywithpointers "github.com/FrancoLiberali/cql/cli/cmd/gen/conditions/tests/hasmanywithpointers"
"time"
)
func (companyWithPointersConditions companyWithPointersConditions) PreloadSellers(nestedPreloads ...condition.JoinCondition[hasmanywithpointers.SellerInPointers]) condition.Condition[hasmanywithpointers.CompanyWithPointers] {
return condition.NewCollectionPreloadCondition[hasmanywithpointers.CompanyWithPointers, hasmanywithpointers.SellerInPointers]("Sellers", nestedPreloads)
}
type companyWithPointersConditions struct {
ID condition.Field[hasmanywithpointers.CompanyWithPointers, model.UUID]
CreatedAt condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]
UpdatedAt condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]
DeletedAt condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]
}
var CompanyWithPointers = companyWithPointersConditions{
CreatedAt: condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]{Name: "CreatedAt"},
DeletedAt: condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]{Name: "DeletedAt"},
ID: condition.Field[hasmanywithpointers.CompanyWithPointers, model.UUID]{Name: "ID"},
UpdatedAt: condition.Field[hasmanywithpointers.CompanyWithPointers, time.Time]{Name: "UpdatedAt"},
}
// Preload allows preloading the CompanyWithPointers when doing a query
func (companyWithPointersConditions companyWithPointersConditions) Preload() condition.Condition[hasmanywithpointers.CompanyWithPointers] {
return condition.NewPreloadCondition[hasmanywithpointers.CompanyWithPointers](companyWithPointersConditions.ID, companyWithPointersConditions.CreatedAt, companyWithPointersConditions.UpdatedAt, companyWithPointersConditions.DeletedAt)
}
// PreloadRelations allows preloading all the CompanyWithPointers's relation when doing a query
func (companyWithPointersConditions companyWithPointersConditions) PreloadRelations() []condition.Condition[hasmanywithpointers.CompanyWithPointers] {
return []condition.Condition[hasmanywithpointers.CompanyWithPointers]{companyWithPointersConditions.PreloadSellers()}
}