mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
@@ -248,6 +248,9 @@ func (cq *CarQuery) ExistX(ctx context.Context) bool {
|
||||
// Clone returns a duplicate of the query builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (cq *CarQuery) Clone() *CarQuery {
|
||||
if cq == nil {
|
||||
return nil
|
||||
}
|
||||
return &CarQuery{
|
||||
config: cq.config,
|
||||
limit: cq.limit,
|
||||
@@ -255,6 +258,7 @@ func (cq *CarQuery) Clone() *CarQuery {
|
||||
order: append([]OrderFunc{}, cq.order...),
|
||||
unique: append([]string{}, cq.unique...),
|
||||
predicates: append([]predicate.Car{}, cq.predicates...),
|
||||
withOwner: cq.withOwner.Clone(),
|
||||
// clone intermediate query.
|
||||
sql: cq.sql.Clone(),
|
||||
path: cq.path,
|
||||
|
||||
@@ -248,6 +248,9 @@ func (gq *GroupQuery) ExistX(ctx context.Context) bool {
|
||||
// Clone returns a duplicate of the query builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (gq *GroupQuery) Clone() *GroupQuery {
|
||||
if gq == nil {
|
||||
return nil
|
||||
}
|
||||
return &GroupQuery{
|
||||
config: gq.config,
|
||||
limit: gq.limit,
|
||||
@@ -255,6 +258,7 @@ func (gq *GroupQuery) Clone() *GroupQuery {
|
||||
order: append([]OrderFunc{}, gq.order...),
|
||||
unique: append([]string{}, gq.unique...),
|
||||
predicates: append([]predicate.Group{}, gq.predicates...),
|
||||
withUsers: gq.withUsers.Clone(),
|
||||
// clone intermediate query.
|
||||
sql: gq.sql.Clone(),
|
||||
path: gq.path,
|
||||
|
||||
@@ -272,6 +272,9 @@ func (uq *UserQuery) ExistX(ctx context.Context) bool {
|
||||
// Clone returns a duplicate of the query builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (uq *UserQuery) Clone() *UserQuery {
|
||||
if uq == nil {
|
||||
return nil
|
||||
}
|
||||
return &UserQuery{
|
||||
config: uq.config,
|
||||
limit: uq.limit,
|
||||
@@ -279,6 +282,8 @@ func (uq *UserQuery) Clone() *UserQuery {
|
||||
order: append([]OrderFunc{}, uq.order...),
|
||||
unique: append([]string{}, uq.unique...),
|
||||
predicates: append([]predicate.User{}, uq.predicates...),
|
||||
withCars: uq.withCars.Clone(),
|
||||
withGroups: uq.withGroups.Clone(),
|
||||
// clone intermediate query.
|
||||
sql: uq.sql.Clone(),
|
||||
path: uq.path,
|
||||
|
||||
Reference in New Issue
Block a user