// NewParentIdQuery creates and initializes a new parent_id query.
546838
func NewParentIdQuery(typ, id string) *ParentIdQuery {
	return &ParentIdQuery{
		typ: typ,
		id:  id,
	}
}
969225
func NewDisjunctionQuery(queries ...FtsQuery) *DisjunctionQuery {
	q := &DisjunctionQuery{newFtsQueryBase()}
	q.options["disjuncts"] = []FtsQuery{}
	return q.Or(queries...)
}
736233
func (p *basePlan) ReplaceParent(parent, newPar Plan) error {
	for i, par := range p.parents {
		if par.GetID() == parent.GetID() {
			p.parents[i] = newPar
			return nil
		}
	}
	return SystemInternalErrorType.Gen("ReplaceParent Failed!")
}
792595
func newQuery(t Term, qopts map[string]interface{}, copts *ConnectOpts) (q Query, err error) {
	queryOpts := map[string]interface{}{}
	for k, v := range qopts {
		queryOpts[k], err = Expr(v).Build()
		if err != nil {
			return
		}
	}
	if copts.Database != "" {
		queryOpts["db"], err = DB(copts.Database).Build()
		if err != nil {
			return
		}
	}

	builtTerm, err := t.Build()
	if err != nil {
		return q, err
	}

	// Construct query
	return Query{
		Type:      p.Query_START,
		Term:      &t,
		Opts:      queryOpts,
		builtTerm: builtTerm,
	}, nil
}
319373
func (e SearchService) NewQuery(idx, statement string) (query SearchQuery, err error) {
	// validate statement
	if !strings.Contains(statement, ":") {
		err = errors.New("statement is malformed")
		return
	}

	query = SearchQuery{
		Index: idx,
		Query: statement,
		// These are the defaults in chef: https://github.com/opscode/chef/blob/master/lib/chef/search/query.rb#L102-L105
		SortBy: "X_CHEF_id_CHEF_X asc",
		Start:  0,
		Rows:   1000,
	}

	return
}
50897
func (q *ParentIdQuery) QueryName(queryName string) *ParentIdQuery {
	q.queryName = queryName
	return q
}
1244029
func (m *Machine) ParentId() (string, bool) {
	parentId := ParentId(m.Id())
	return parentId, parentId != ""
}
487165
func (s *PutFileInput) SetParentCommitId(v string) *PutFileInput {
	s.ParentCommitId = &v
	return s
}
636114
func (s *MoveAccountInput) SetDestinationParentId(v string) *MoveAccountInput {
	s.DestinationParentId = &v
	return s
}
1070476
func (rbac *RBAC) GetParents(id string) ([]string, error) {
	rbac.mutex.Lock()
	defer rbac.mutex.Unlock()
	if _, ok := rbac.roles[id]; !ok {
		return nil, ErrRoleNotExist
	}
	ids, ok := rbac.parents[id]
	if !ok {
		return nil, nil
	}
	var parents []string
	for parent := range ids {
		parents = append(parents, parent)
	}
	return parents, nil
}
362971
func (l AncestorList) GetParentOf(workItemID uuid.UUID) *Ancestor {
	for _, a := range l {
		if a.DirectChildID == workItemID {
			return &a
		}
	}
	return nil
}
1099409
func NewQueryStringQuery(query string) *QueryStringQuery {
	q := &QueryStringQuery{newFtsQueryBase()}
	q.options["query"] = query
	return q
}
821124
func (q *ParentIdQuery) Id(id string) *ParentIdQuery {
	q.id = id
	return q
}
69639
func NewQuery(db *DB, executor Executor, sql string) *Query {
	rawSQL, placeholders := db.processSQL(sql)
	return &Query{
		executor:     executor,
		sql:          sql,
		rawSQL:       rawSQL,
		placeholders: placeholders,
		params:       Params{},
		FieldMapper:  db.FieldMapper,
		LogFunc:      db.LogFunc,
		PerfFunc:     db.PerfFunc,
	}
}
726129
func newIISQueryBuilderWithKind(kind string) *iisQueryBuilder {
	q := datastore.NewQuery(kind)
	bldr := &iisQueryBuilder{q: q}
	bldr.Foo = &iisQueryProperty{
		bldr: bldr,
		name: "Foo",
	}

	if plugger, ok := interface{}(bldr).(qbgutils.Plugger); ok {
		bldr.plugin = plugger.Plugin()
		bldr.plugin.Init("IIS")
	}

	return bldr
}
1223937
func NewBoolQuery() *BoolQuery {
	return &BoolQuery{
		mustClauses:    make([]Query, 0),
		mustNotClauses: make([]Query, 0),
		filterClauses:  make([]Query, 0),
		shouldClauses:  make([]Query, 0),
	}
}
681423
func (p *basePlan) AddParent(parent Plan) {
	p.parents = append(p.parents, parent)
}