Inserts a new data definition to this metadata object.

@param td
The data definition. It can be a {@link DatabaseRelationDefinition} or a
{@link ParserViewDefinition} object.
349165
protected <T extends RelationDefinition> void add(T td, Map<RelationID, T> schema) {
        if (!isStillMutable) {
            throw new IllegalStateException("Too late, cannot add a schema");
        }
        schema.put(td.getID(), td);
        if (td.getID().hasSchema()) {
            RelationID noSchemaID = td.getID().getSchemalessID();
            if (!schema.containsKey(noSchemaID)) {
                schema.put(noSchemaID, td);
            }
            else {
                LOGGER.warn("DUPLICATE TABLE NAMES, USE QUALIFIED NAMES:\n" + td + "\nAND\n" + schema.get(noSchemaID));
                //schema.remove(noSchemaID);
                // TODO (ROMAN 8 Oct 2015): think of a better way of resolving ambiguities
            }
        }
    }
423649
private void addTableGenerator(ApplicationMetadata appMetadata, String persistenceUnit, List<TableInfo> tableInfos,
            EntityMetadata entityMetadata)
    {
        Metamodel metamodel = appMetadata.getMetamodel(persistenceUnit);
        IdDiscriptor keyValue = ((MetamodelImpl) metamodel).getKeyValue(entityMetadata.getEntityClazz().getName());
        if (keyValue != null && keyValue.getTableDiscriptor() != null)
        {
            TableInfo tableGeneratorDiscriptor = new TableInfo(keyValue.getTableDiscriptor().getTable(),
                    "CounterColumnType", String.class, keyValue.getTableDiscriptor().getPkColumnName());
            if (!tableInfos.contains(tableGeneratorDiscriptor))
            {
                tableGeneratorDiscriptor.addColumnInfo(getJoinColumn(tableGeneratorDiscriptor,
                        keyValue.getTableDiscriptor().getValueColumnName(), Long.class));
                tableInfos.add(tableGeneratorDiscriptor);
            }
        }
    }
146085
function(definition, client) {

  this.client = client;

  this.schema = null;

  this.ddlHelper = {
    tableName: null,
    pkAttrName: null,
    pkAutoIncrement: false,
    attrNamesToColNames: {},
    attrTypes: {},
    colNamesToAttrNames: {},
    colTypes: {},
    defaultValues: {},
    cqlCreateTable: null,
    indexes: {}
  };

  this._parseDefinition(definition);
}
1201938
@Override
	protected String addTableLine( String... lineEntries ) {

		StringBuilder sb = new StringBuilder();
		sb.append( "<tr>\n" );
		for( String s : lineEntries ) {
			sb.append( "\t<td>" );
			sb.append( s );
			sb.append( "</td>\n" );
		}

		sb.append( "</tr>\n" );
		return sb.toString();
	}
531723
@Override
	public <T extends DAO> T insert(DAO dao, boolean excludePrimaryKeys)  throws DatabaseException{
		ModelDef model = db.getModelMetaDataDefinition().getDefinition(dao.getModelName());
		if(excludePrimaryKeys){
			dao.add_IgnoreColumn( model.getPrimaryAttributes());
		}
		return insertRecord(dao, model, true);
	}
53633
@Given("^I insert in keyspace '(.+?)' and table '(.+?)' with:$")
    public void insertData(String keyspace, String table, DataTable datatable) {
        try {
            commonspec.getCassandraClient().useKeyspace(keyspace);
            int attrLength = datatable.getPickleRows().get(0).getCells().size();
            Map<String, Object> fields = new HashMap<String, Object>();
            for (int e = 1; e < datatable.getPickleRows().size(); e++) {
                for (int i = 0; i < attrLength; i++) {
                    fields.put(datatable.getPickleRows().get(0).getCells().get(i).getValue(), datatable.getPickleRows().get(e).getCells().get(i).getValue());

                }
                commonspec.getCassandraClient().insertData(keyspace + "." + table, fields);

            }
        } catch (Exception e) {
            commonspec.getLogger().debug("Exception captured");
            commonspec.getLogger().debug(e.toString());
            commonspec.getExceptions().add(e);
        }
    }
953867
public void addElement(SimpleCell element) throws BadElementException {
		if(!element.isCellgroup()) {
			throw new BadElementException("You can't add cells to a table directly, add them to a row first.");
		}
		content.add(element);
	}
1333879
protected void addPropertyReferenceFromElement(String id, Element element, BeanDefinitionBuilder bean) {
        String beanElement = element.getAttribute(id);
        bean.addPropertyReference(id, beanElement);
    }
814575
private void setUpdatedAtFromDefinition(@Nullable Long updatedAt) {
    if (updatedAt != null && updatedAt > definition.getUpdatedAt()) {
      setUpdatedAt(updatedAt);
    }
  }
1125385
def insertDataset(self, dataset):
        
        try:
            models.Dataset.create(
                id=dataset.getId(),
                name=dataset.getLocalId(),
                description=dataset.getDescription(),
                attributes=json.dumps(dataset.getAttributes()))
        except Exception:
            raise exceptions.DuplicateNameException(
                dataset.getLocalId())
798382
private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata)
    {
        RelationMetadataProcessor relProcessor = null;
        try
        {
            relProcessor = RelationMetadataProcessorFactory
                    .getRelationMetadataProcessor(relationField, kunderaMetadata);

            this.factory.validate(relationField, new RelationAttributeRule());

            relProcessor = RelationMetadataProcessorFactory
                    .getRelationMetadataProcessor(relationField, kunderaMetadata);

            if (relProcessor != null)
            {
                relProcessor.addRelationIntoMetadata(relationField, metadata);
            }

        }
        catch (PersistenceException pe)
        {
            throw new MetamodelLoaderException("Error with relationship in @Entity(" + entityClass + "."
                    + relationField.getName() + "), reason: " + pe);
        }

    }
829635
public TableMetadata insertMetadata(String tableName, String version){
		TableMetadata result = new TableMetadata(this);
		result.setId(new Long(tableName.hashCode()));
		result.setName(tableName);
		result.setVersion(version);
		
		try{
			insertStatement.setLong(1, result.getId());
			insertStatement.setString(2, result.getName());
			insertStatement.setString(3, result.getVersion());
			insertStatement.executeUpdate();
		}catch(SQLException e){
			throw new BackendException("Could not insert new metadata-entry: " + result, e);
		}
		
		return result;
		
	}
1320627
public void add(Rec record) throws DBException
    {
        if (this.getRecord().getEditMode() != Constants.EDIT_ADD)
            throw new DBException(Constants.INVALID_RECORD);
        m_record = (FieldList)record;
        this.fieldsToData(record);
        this.doAdd(record);
        this.setDataSource(null);
        this.getRecord().setEditMode(Constants.EDIT_NONE);
    }
794920
public void insertTable(Table aTable, Point aLocation) {
        
        if (aTable == null) { 
        	throw new NullPointerException("insertTable - table has null-value");
        }
        if (aLocation == null) {
        	throw new NullPointerException("insertTable - point has null-value");
        }
        mTableInserted = true;
        aTable.complete();
        
        if (aLocation.y > columns) {
        	throw new IllegalArgumentException("insertTable -- wrong columnposition("+ aLocation.y + ") of location; max =" + columns);
        }
        
        int rowCount = aLocation.x + 1 - rows.size();
        int i = 0;
        if ( rowCount > 0 ) {   //create new rows ?
            for (; i < rowCount; i++) {
                rows.add(new Row(columns));
            }
        }
        
        rows.get(aLocation.x).setElement(aTable,aLocation.y);
        
        setCurrentLocationToNextValidPosition(aLocation);
    }
588174
public <T> void addColumn(Connection connection, Attribute<T, ?> attribute) {
        addColumn(connection, attribute, true);
    }
507958
private void addOrUpdateTable(File file) {
        try {
            String insertStmnt = FileUtils.readFileToString(file);
            DataSource ds = processSql(insertStmnt);
            DataSource existingDs = db().getDataSource(ds.getName());
            if (existingDs == null) {//We never saw this table before.
                db().addDataSource(ds);
                return;
            }
            // If startTime/endTime/templatePath changed then we should update the table.
            if (existingDs.getStartTime() != ds.getStartTime() || 
                    existingDs.getEndTime() != ds.getEndTime() ||
                    !existingDs.getTemplatePath().equals(ds.getTemplatePath())) {
                // We have to reuse the existing entity bean(else update will fail).
                existingDs.updateFrom(ds);
                db().updateDataSource(existingDs);
            }                 
        } catch (IOException ex) {
            log.error("Exception while loading druid sql file {} : {}", file, ex);
        }
    }
925543
public boolean createTableIfMissing (Connection conn, String table, List<String> columns,
                                         List<ColumnDefinition> definitions,
                                         List<List<String>> uniqueConstraintColumns,
                                         List<String> primaryKeyColumns)
        throws SQLException
    {
        if (tableExists(conn, table)) {
            return false;
        }
        if (columns.size() != definitions.size()) {
            throw new IllegalArgumentException("Column name and definition number mismatch");
        }

        StringBuilder builder = new StringBuilder("CREATE TABLE ").
            append(tableSQL(table)).append(" (");
        for (int ii = 0; ii < columns.size(); ii ++) {
            if (ii > 0) {
                builder.append(", ");
            }
            builder.append(columnSQL(columns.get(ii))).append(" ");
            builder.append(expandDefinition(definitions.get(ii)));
        }

        if (uniqueConstraintColumns != null) {
            for (List<String> uCols : uniqueConstraintColumns) {
                builder.append(", UNIQUE (");
                appendColumns(uCols, builder);
                builder.append(")");
            }
        }

        if (primaryKeyColumns != null && !primaryKeyColumns.isEmpty()) {
            builder.append(", PRIMARY KEY (");
            appendColumns(primaryKeyColumns, builder);
            builder.append(")");
        }

        builder.append(")");

        executeQuery(conn, builder.toString());
        log("Database table '" + table + "' created.");
        return true;
    }