Examples of ColumnDefinition


Examples of com.infoclinika.mssharing.model.internal.entity.ColumnDefinition

    private Collection<ViewColumn> transformViewToModel(Set<ColumnInfo> columns) {

        return from(columns).transform(new Function<ColumnInfo, ViewColumn>() {
            @Override
            public ViewColumn apply(ColumnInfo input) {
                final ColumnDefinition columnDefinition = columnDefinitionRepo.findOne(input.originalColumn);
                return new ViewColumn(columnDefinition, input.order);
            }
        }).toImmutableSet();
    }
View Full Code Here

Examples of com.netflix.astyanax.ddl.ColumnDefinition

   
      List<ColumnDefinition> colDefs = cfDef.getColumnDefinitionList();
      Assert.assertTrue(7 == colDefs.size());
   
      for (int i=1; i<=5; i++) {
        ColumnDefinition colDef = colDefs.get(i-1);
        Assert.assertEquals("column" + i, colDef.getName());
        Assert.assertNotNull(colDef.getValidationClass());
      }
      ColumnDefinition colDef = colDefs.get(6);
      Assert.assertEquals("value", colDef.getName());
      Assert.assertNotNull(colDef.getValidationClass());
     
      cfDef = ksDef.getColumnFamily("population");
      Assert.assertEquals("population", cfDef.getName());
     
      colDefs = cfDef.getColumnDefinitionList();
      Assert.assertTrue(7 == colDefs.size());
   
      for (int i=1; i<=5; i++) {
        colDef = colDefs.get(i-1);
        Assert.assertEquals("column" + i, colDef.getName());
        Assert.assertNotNull(colDef.getValidationClass());
      }
      colDef = colDefs.get(6);
      Assert.assertEquals("value", colDef.getName());
      Assert.assertNotNull(colDef.getValidationClass());
    }

    keyspace.dropKeyspace();
  }
View Full Code Here

Examples of net.sf.jsqlparser.statement.create.table.ColumnDefinition

        Token tk = null;
        Token tk2 = null;
        Token tk3 = null;
        ColDataType colDataType = null;
        String stringList = null;
        ColumnDefinition coldef = null;
        List indexes = new ArrayList();
        List colNames = null;
        Index index = null;
        String parameter = null;
    jj_consume_token(K_CREATE);
    label_27:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case K_KEY:
      case K_NOT:
      case K_NULL:
      case K_PRIMARY:
      case S_DOUBLE:
      case S_INTEGER:
      case S_IDENTIFIER:
      case S_CHAR_LITERAL:
      case 77:
      case 79:
        ;
        break;
      default:
        jj_la1[136] = jj_gen;
        break label_27;
      }
      CreateParameter();
    }
    jj_consume_token(K_TABLE);
    table = Table();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 79:
      jj_consume_token(79);
      columnName = jj_consume_token(S_IDENTIFIER);
      colDataType = ColDataType();
                        columnSpecs = new ArrayList();
      label_28:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case K_KEY:
        case K_NOT:
        case K_NULL:
        case K_PRIMARY:
        case S_DOUBLE:
        case S_INTEGER:
        case S_IDENTIFIER:
        case S_CHAR_LITERAL:
        case 77:
        case 79:
          ;
          break;
        default:
          jj_la1[137] = jj_gen;
          break label_28;
        }
        parameter = CreateParameter();
                                                columnSpecs.add(parameter);
      }
                        coldef = new ColumnDefinition();
                        coldef.setColumnName(columnName.image);
                        coldef.setColDataType(colDataType);
                        if (columnSpecs.size() > 0)
                                coldef.setColumnSpecStrings(columnSpecs);
                        columnDefinitions.add(coldef);
      label_29:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 78:
          ;
          break;
        default:
          jj_la1[138] = jj_gen;
          break label_29;
        }
        jj_consume_token(78);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case K_INDEX:
          tk = jj_consume_token(K_INDEX);
          tk3 = jj_consume_token(S_IDENTIFIER);
          colNames = ColumnsNamesList();
                                                        index = new Index();
                                                        index.setType(tk.image);
                                                        index.setName(tk3.image);
                                                        index.setColumnsNames(colNames);
                                                        indexes.add(index);
          break;
        case K_PRIMARY:
          tk = jj_consume_token(K_PRIMARY);
          tk2 = jj_consume_token(K_KEY);
          colNames = ColumnsNamesList();
                                                        index = new Index();
                                                        index.setType(tk.image + " "+ tk2.image);
                                                        index.setColumnsNames(colNames);
                                                        indexes.add(index);
          break;
        case K_KEY:
          tk = jj_consume_token(K_KEY);
          tk3 = jj_consume_token(S_IDENTIFIER);
          colNames = ColumnsNamesList();
                                                        index = new Index();
                                                        index.setType(tk.image);
                                                        index.setName(tk3.image);
                                                        index.setColumnsNames(colNames);
                                                        indexes.add(index);
          break;
        case S_IDENTIFIER:
          columnName = jj_consume_token(S_IDENTIFIER);
          colDataType = ColDataType();
                                                columnSpecs = new ArrayList();
          label_30:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case K_KEY:
            case K_NOT:
            case K_NULL:
            case K_PRIMARY:
            case S_DOUBLE:
            case S_INTEGER:
            case S_IDENTIFIER:
            case S_CHAR_LITERAL:
            case 77:
            case 79:
              ;
              break;
            default:
              jj_la1[139] = jj_gen;
              break label_30;
            }
            parameter = CreateParameter();
                                                                              columnSpecs.add(parameter);
          }
                                                coldef = new ColumnDefinition();
                                                coldef.setColumnName(columnName.image);
                                                coldef.setColDataType(colDataType);
                                                if (columnSpecs.size() > 0)
                                                        coldef.setColumnSpecStrings(columnSpecs);
                                                columnDefinitions.add(coldef);
          break;
        default:
          jj_la1[140] = jj_gen;
          jj_consume_token(-1);
View Full Code Here

Examples of net.sf.jsqlparser.statement.create.table.ColumnDefinition

    String tableName=createTable.getTable().getName();
    buffer.append("\r\n");

    for(int i=0;i<createTable.getColumnDefinitions().size();i++)
    {
      ColumnDefinition col=(ColumnDefinition)createTable.getColumnDefinitions().get(i);
      String colname=col.getColumnName();
      String[] coltype=col.getColDataType().getDataType().split("_mdrill_");
      String type=coltype[0];
      String fieldstore=store;
      if(coltype.length>1)
      {
        fieldstore=coltype[1];
View Full Code Here

Examples of net.sf.jsqlparser.statement.create.table.ColumnDefinition

  public void deParse(CreateTable createTable) {
    buffer.append("CREATE TABLE " + createTable.getTable().getWholeTableName());
    if (createTable.getColumnDefinitions() != null) {
      buffer.append(" { ");
      for (Iterator iter = createTable.getColumnDefinitions().iterator(); iter.hasNext();) {
        ColumnDefinition columnDefinition = (ColumnDefinition) iter.next();
        buffer.append(columnDefinition.getColumnName());
        buffer.append(" ");
        buffer.append(columnDefinition.getColDataType().getDataType());
        if (columnDefinition.getColDataType().getArgumentsStringList() != null) {
          for (Iterator iterator = columnDefinition.getColDataType().getArgumentsStringList().iterator(); iterator.hasNext();) {
            buffer.append(" ");
            buffer.append((String) iterator.next());
          }
        }
        if (columnDefinition.getColumnSpecStrings() != null) {
          for (Iterator iterator = columnDefinition.getColumnSpecStrings().iterator(); iterator.hasNext();) {
            buffer.append(" ");
            buffer.append((String) iterator.next());
          }
        }
View Full Code Here

Examples of org.apache.blur.thrift.generated.ColumnDefinition

    }
    return schema;
  }

  private static ColumnDefinition getColumnDefinition(FieldTypeDefinition fieldTypeDefinition) {
    ColumnDefinition columnDefinition = new ColumnDefinition();
    columnDefinition.setFamily(fieldTypeDefinition.getFamily());
    columnDefinition.setColumnName(fieldTypeDefinition.getColumnName());
    columnDefinition.setSubColumnName(fieldTypeDefinition.getSubColumnName());
    columnDefinition.setFieldLessIndexed(fieldTypeDefinition.isFieldLessIndexed());
    columnDefinition.setFieldType(fieldTypeDefinition.getFieldType());
    columnDefinition.setProperties(fieldTypeDefinition.getProperties());
    return columnDefinition;
  }
View Full Code Here

Examples of org.apache.cassandra.config.ColumnDefinition

       
        // figure out what needs to be added and dropped.
        // future: if/when we have modifiable settings for secondary indexes, they'll need to be handled here.
        for (ByteBuffer indexedColumn : indexedColumns.keySet())
        {
            ColumnDefinition def = metadata.getColumn_metadata().get(indexedColumn);
            if (def == null || def.getIndexType() == null)
                removeIndex(indexedColumn);
        }

        for (ColumnDefinition cdef : metadata.getColumn_metadata().values())
            if (cdef.getIndexType() != null && !indexedColumns.containsKey(cdef.name))
View Full Code Here

Examples of org.apache.cassandra.config.ColumnDefinition

        rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("k1"));
        rm.add(new QueryPath("Indexed2", null, ByteBufferUtil.bytes("birthdate")), ByteBufferUtil.bytes(1L), 1);
        rm.apply();

        ColumnFamilyStore cfs = table.getColumnFamilyStore("Indexed2");
        ColumnDefinition old = cfs.metadata.getColumn_metadata().get(ByteBufferUtil.bytes("birthdate"));
        ColumnDefinition cd = new ColumnDefinition(old.name, old.getValidator().getClass().getName(), IndexType.KEYS, "birthdate_index");
        Future<?> future = cfs.addIndex(cd);
        future.get();
        // we had a bug (CASSANDRA-2244) where index would get created but not flushed -- check for that
        assert cfs.getIndexedColumnFamilyStore(cd.name).getSSTables().size() > 0;
View Full Code Here

Examples of org.apache.cassandra.config.ColumnDefinition

    {
        Map<ByteBuffer, ColumnDefinition> indexes = new HashMap<ByteBuffer, ColumnDefinition>();
        for (int i = 0; i < 5; i++)
        {
            ByteBuffer name = ByteBuffer.wrap(new byte[] { (byte)i });
            indexes.put(name, new ColumnDefinition(name, null, IndexType.KEYS, Integer.toString(i)));
        }
        CFMetaData cfm = new CFMetaData("Keyspace1",
                "TestApplyCFM_CF",
                ColumnFamilyType.Standard,
                BytesType.instance,
View Full Code Here

Examples of org.apache.cassandra.config.ColumnDefinition

        ColumnFamilyStore indexedCfs = cfs.getIndexedColumnFamilyStore(cfs.getIndexedColumns().iterator().next());
        Descriptor desc = indexedCfs.getSSTables().iterator().next().descriptor;

        // drop the index
        CFMetaData meta = CFMetaData.rename(cfs.metadata, cfs.metadata.cfName); // abusing rename to clone
        ColumnDefinition cdOld = meta.column_metadata.values().iterator().next();
        ColumnDefinition cdNew = new ColumnDefinition(cdOld.name, cdOld.getValidator().getClass().getName(), null, null);
        meta.column_metadata.put(cdOld.name, cdNew);
        UpdateColumnFamily update = new UpdateColumnFamily(CFMetaData.convertToAvro(meta));
        update.apply();

        // check
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.