复制 OrderByElement

@param orig  原 OrderByElement
@param alias 新 OrderByElement 的排序要素
@return 复制的新 OrderByElement
344119
protected OrderByElement cloneOrderByElement(OrderByElement orig, String alias) {
        return cloneOrderByElement(orig, new Column(alias));
    }
791568
public OqlBuilder<T> orderBy(final int index, final String orderBy) {
    if (null != orders) {
      if (isNotEmpty(statement)) { throw new RuntimeException("cannot add order by to a exists statement."); }
      this.orders.addAll(index, Order.parse(orderBy));
    }
    return this;
  }
1326103
private function addOrderBy(QueryBuilder $qb, array $orderBy = [])
    {
        if (count($orderBy)) {
            $alias = $qb->getAllAliases()[0];
            foreach ($orderBy as $sortCol => $order) {
                $qb->orderBy($alias . '.' . $sortCol, $order);
            }
        }

        return $qb;
    }
203503
protected function applyQuerySort(QueryBuilder $queryBuilder, $alias = 'a')
    {
        $sort = $this->get('request')->get('sort');
        $order = $this->get('request')->get('order');

        if ($sort) {
            $repository = $this->get('orm.em')->getRepository($this->getEntityClass());
            // sort using the getQueryBuilderOrderedBy* magic method if defined
            $sortMethodName = 'getQueryBuilderOrderedBy'.ucfirst(strtolower($sort));
            if (method_exists($repository, $sortMethodName)) {
                $queryBuilder = call_user_method_array($sortMethodName, $repository, array($order, $queryBuilder));
            }
            // else sort by property name if exists
            elseif ($sort && property_exists($this->getEntityClass(), $sort)) {
                $queryBuilder->orderBy($alias.'.'.$sort, $order);
            }
        }
        // if empty sort use Gedmo Sortable annotation if enable
        elseif ($sort = $this->getSortableColumn()) {
            // pre order by group if defined
            if ($sortGroup = $this->getSortableGroup()) {
                $queryBuilder->orderBy($alias.'.'.$sortGroup);
            }
            $queryBuilder->addOrderBy($alias.'.'.$sort);
        }

        return $queryBuilder;
    }
810612
@Deprecated
    public static void createAlias(Client client, String alias, String index) throws Exception {
        logger.trace("createAlias({},{})", alias, index);
        AcknowledgedResponse response = client.admin().indices().prepareAliases().addAlias(index, alias).get();
        if (!response.isAcknowledged()) throw new Exception("Could not define alias [" + alias + "] for index [" + index + "].");
        logger.trace("/createAlias({},{})", alias, index);
    }
572354
public static <T> T copy(T orig) {
        if (orig == null) {
            return null;
        }
        try {
            // Write the object out to a byte array
            ByteArrayOutputStream fbos = new ByteArrayOutputStream();

            try (ObjectOutputStream out = new ObjectOutputStream(fbos)) {
                out.writeObject(orig);
                out.flush();
            }

            // Retrieve an input stream from the byte array and read
            // a copy of the object back in.
            try (ByteArrayInputStream fbis = new ByteArrayInputStream(fbos.toByteArray());
                 ObjectInputStream in = new ObjectInputStream(fbis))  {
                return (T) in.readObject();
            }
        } catch (IOException | ClassNotFoundException e) {
            throw new IllegalStateException("Cannot copy " + orig, e);
        }
    }
791684
function(orig) {
    this._super(orig);
    this._priorModel = orig._priorModel;
    this._model = orig._model;
    this._modelTable = orig._modelTable;
    this._arrayTransform = orig._arrayTransform;
    this._modelTransform = orig._modelTransform;
  }
980671
@NonNull
    @Override
    public OrderBy orderBy(@NonNull Ordering... orderings) {
        if (orderings == null) {
            throw new IllegalArgumentException("orderings is null.");
        }
        return new OrderBy(this, Arrays.asList(orderings));
    }
938384
public void setAlias(String alias) {
        this.alias = (alias != null && alias.isEmpty() == false ? alias : null);
    }
1164018
@Override
    public AliasType get(String key) {
        key = key.toUpperCase();
        AliasType type = super.get(key);

        if (type == null) {
            register(type = new AliasType(key));
        }

        return type;
    }
985701
public OrderBy add(String name, Order order) {
    failIfFieldNamePresent(name);
    this.elements.add(new SortElement(name, order, NullOrder.NULL_SMALLEST));
    return this;
  }
777926
public synchronized AsynchConsumerProxyQueue createOrderedProxyQueue(OrderingContext context,
                                                                        short id,
                                                                        short seqNumber)
      throws SIResourceException, SIIncorrectCallException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createOrderedProxyQueue", context);
      
      checkClosed();
      
      AsynchConsumerProxyQueue proxyQueue = new OrderedSessionProxyQueueImpl(this, 
                                                                             id, 
                                                                             conversation, 
                                                                             context);
      idToProxyQueueMap.put(new ImmutableId(id), proxyQueue);
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createOrderedProxyQueue", proxyQueue);
      return proxyQueue;
   }
518613
public static GoogRequire createWithAlias(String symbol, String alias) {
    CodeChunkUtils.checkId(alias);
    return new AutoValue_GoogRequire(
        symbol,
        VariableDeclaration.builder(alias).setRhs(GOOG_REQUIRE.call(stringLiteral(symbol))).build(),
        /*isTypeRequire=*/ false);
  }
987299
public boolean aliasExists(String alias) {
        try {
            final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(alias).build());
            return result.isSucceeded() && !Iterators.contains(result.getJsonObject().fieldNames(), alias);
        } catch (IOException e) {
            throw new ElasticsearchException("Couldn't check existence of alias " + alias, e);
        }
    }
99499
private ModelNode removeAliasFromList(ModelNode list, String alias) throws OperationFailedException {

        // check for empty string
        if (alias == null || alias.equals(""))
            return list ;

        // check for undefined list (AS7-3476)
        if (!list.isDefined()) {
            throw InfinispanMessages.MESSAGES.cannotRemoveAliasFromEmptyList(alias);
        }

        ModelNode newList = new ModelNode() ;
        List<ModelNode> listElements = list.asList();

        for (ModelNode listElement : listElements) {
            if (!listElement.asString().equals(alias)) {
                newList.add().set(listElement);
            }
        }
        return newList ;
    }
63782
@Override
  @SuppressWarnings("unchecked")
  public <E> Comparator<E> getOrderBy() {
    return ObjectUtils.defaultIfNull(ComparatorHolder.get(), ObjectUtils.defaultIfNull(
      orderBy, ComparableComparator.INSTANCE));
  }
740003
public Order ORDER(DomainObjectMatch<?> toOrder) {
		DomainObjectMatch<?> delegate = APIAccess.getDelegate(toOrder);
		DomainObjectMatch<?> match = delegate != null ? delegate : toOrder;
		OrderExpression oe = this.queryExecutor.getOrderFor(match);
		Order ret = APIAccess.createOrder(oe);
		QueryRecorder.recordInvocation(this, "ORDER", ret, QueryRecorder.placeHolder(match));
		return ret;
	}