Package org.cyclop.model

Examples of org.cyclop.model.CqlExtendedColumnName


  private void initColumnList(ColumnsModel columnsModel, WebMarkupContainer resultTable) {

    ListView<CqlExtendedColumnName> columnList = new ListView<CqlExtendedColumnName>("columnList", columnsModel) {
      @Override
      protected void populateItem(ListItem<CqlExtendedColumnName> item) {
        final CqlExtendedColumnName columnName = item.getModelObject();

        WebMarkupContainer columnListRow = new WebMarkupContainer("columnListRow");
        item.add(columnListRow);

        Label columnNameLabel = new Label("columnName", columnName.part);
View Full Code Here


  private void initColumnList(WebMarkupContainer resultTable, ColumnsModel columnsModel) {
    ListView<CqlExtendedColumnName> columnList = new ListView<CqlExtendedColumnName>("columnList", columnsModel) {
      @Override
      protected void populateItem(ListItem<CqlExtendedColumnName> item) {
        final CqlExtendedColumnName columnName = item.getModelObject();
        Label columnNameLabel = new Label("columnName", columnName.part);
        item.add(columnNameLabel);
      }
    };
    resultTable.add(columnList);
View Full Code Here

        ListView<CqlExtendedColumnName> columnValueList = new ListView<CqlExtendedColumnName>(
            "columnValueList", columnsModel) {

          @Override
          protected void populateItem(ListItem<CqlExtendedColumnName> item) {
            CqlExtendedColumnName column = item.getModelObject();

            CqlPartitionKey partitionKey = metadataModel.getObject().partitionKey;
            Component component = widgetFactory.createForColumn(row, partitionKey, column, "columnValue");
            item.add(component);
            component.setRenderBodyOnly(true);
View Full Code Here

  private void appendRow(PrintWriter out, Row row, List<CqlExtendedColumnName> cols) {
    LOG.debug("Appending next row");
    Iterator<CqlExtendedColumnName> it = cols.iterator();
    while (it.hasNext()) {
      CqlExtendedColumnName column = it.next();
      CqlDataType dataType = column.dataType;

      if (dataType.name == DataType.Name.SET || dataType.name == DataType.Name.LIST) {
        appendCollection(out, row, column);
View Full Code Here

      CqlColumnType columnType = typeMap.get(columnNameText.toLowerCase());
      if (columnType == null) {
        columnType = CqlColumnType.REGULAR;
        LOG.debug("Column type not found for: {} - using regular", columnNameText);
      }
      CqlExtendedColumnName columnName = new CqlExtendedColumnName(columnType, CqlDataType.create(dataType),
          columnNameText);
      if (columnType == CqlColumnType.PARTITION_KEY) {
        partitionKey = CqlPartitionKey.fromColumn(columnName);
      }
      columnsBuild.add(columnName);
View Full Code Here

    LOG.trace("Appending {}", columns);

    Iterator<CqlExtendedColumnName> commonColsIt = columns.iterator();
    while (commonColsIt.hasNext()) {
      CqlExtendedColumnName next = commonColsIt.next();
      out.append(prep(esc(next.toDisplayString())));

      if (commonColsIt.hasNext()) {
        out.append(conf.separatorColumn);
      }
    }
View Full Code Here

    CqlRowMetadata rowMetadata = res.rowMetadata;
    assertEquals(4, rowMetadata.columns.size());

    String comColsStr = rowMetadata.columns.toString();
    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.PARTITION_KEY,
        CqlDataType.create(DataType.uuid()), "id")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.CLUSTERING_KEY,
        CqlDataType.create(DataType.cint()), "id2")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.CLUSTERING_KEY,
        CqlDataType.create(DataType.varchar()), "id3")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.REGULAR,
        CqlDataType.create(DataType.varchar()), "deesc")));

    int rowsCnt = 0;
    for (Row row : res) {
      rowsCnt++;
View Full Code Here

  public void testExecute_SimplePkWithDynamicColumn() {
    qs.execute(new CqlQuery(CqlQueryType.USE, "USE CqlDemo"));
    CqlQueryResult res = qs.execute(new CqlQuery(CqlQueryType.SELECT, "select * from MyBooks where pages=2212"));

    CqlRowMetadata rowMetadata = res.rowMetadata;
    assertTrue(res.toString(), rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.REGULAR,
        CqlDataType.create(DataType.varchar()), "title")));

    String comColsStr = rowMetadata.columns.toString();
    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.PARTITION_KEY,
        CqlDataType.create(DataType.uuid()), "id")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.REGULAR,
        CqlDataType.create(DataType.set(DataType.varchar())), "authors")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.REGULAR,
        CqlDataType.create(DataType.cint()), "pages")));

    assertTrue(comColsStr, rowMetadata.columns.contains(new CqlExtendedColumnName(CqlColumnType.REGULAR,
        CqlDataType.create(DataType.map(DataType.varchar(), DataType.cdouble())), "price")));

    int rowsSize = 0;
    for (Row row : res) {
      rowsSize++;
View Full Code Here

TOP

Related Classes of org.cyclop.model.CqlExtendedColumnName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.