Package org.teiid.metadata

Examples of org.teiid.metadata.KeyRecord


      if (!this.connectorEnv.isModelAuditFields() && isAuditField(relationship.getForeignKeyField())) {
                continue;
            }

      Table parent = tableMap.get(NameUtil.normalizeName(relationship.getParentTable()));
      KeyRecord pk = parent.getPrimaryKey();
      if (null == pk) {
                throw new RuntimeException("ERROR !!primary key column not found!!"); //$NON-NLS-1$
            }
      ArrayList<String> columnNames = new ArrayList<String>();
      columnNames.add(pk.getName());
     
     
      Table child = tableMap.get(NameUtil.normalizeName(relationship.getChildTable()));
     
      Column col = null;
View Full Code Here


            for (KeyRecord columnSetRecordImpl : tableRecord.getIndexes()) {
          loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
          columnSetRecordImpl.setParent(tableRecord);
        }
            if (tableRecord.getPrimaryKey() != null) {
              KeyRecord primaryKey = getPrimaryKey(tableRecord.getPrimaryKey().getUUID());
              loadColumnSetRecords(primaryKey, uuidColumnMap);
              primaryKey.setParent(tableRecord);
              tableRecord.setPrimaryKey(primaryKey);
            }
            String groupUUID = tableRecord.getUUID();
            if (tableRecord.isVirtual()) {
              TransformationRecordImpl update = (TransformationRecordImpl)getRecordByType(groupUUID, MetadataConstants.RECORD_TYPE.UPDATE_TRANSFORM,false);
View Full Code Here

      }
      }
    }

  private KeyRecord getPrimaryKey(String uuid) {
    KeyRecord key = this.primaryKeyCache.get(uuid);
    if (key == null) {
            throw new TeiidRuntimeException(uuid+" PrimaryKey "+TransformationMetadata.NOT_EXISTS_MESSAGE); //$NON-NLS-1$
      }
    return key;
  }
View Full Code Here

            case MetadataConstants.RECORD_TYPE.TABLE: return createTableRecord(record);
            case MetadataConstants.RECORD_TYPE.JOIN_DESCRIPTOR: return null;
            case MetadataConstants.RECORD_TYPE.CALLABLE: return createProcedureRecord(record);
            case MetadataConstants.RECORD_TYPE.CALLABLE_PARAMETER: return createProcedureParameterRecord(record);
            case MetadataConstants.RECORD_TYPE.COLUMN: return createColumnRecord(record);
            case MetadataConstants.RECORD_TYPE.ACCESS_PATTERN: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.AccessPattern));
            case MetadataConstants.RECORD_TYPE.INDEX: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Index));
            case MetadataConstants.RECORD_TYPE.RESULT_SET: return createColumnSetRecord(record, new ColumnSet());
            case MetadataConstants.RECORD_TYPE.UNIQUE_KEY: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Unique));
            case MetadataConstants.RECORD_TYPE.PRIMARY_KEY: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Primary));
            case MetadataConstants.RECORD_TYPE.FOREIGN_KEY: return createForeignKeyRecord(record);
            case MetadataConstants.RECORD_TYPE.DATATYPE: return createDatatypeRecord(record);
            case MetadataConstants.RECORD_TYPE.SELECT_TRANSFORM:
            case MetadataConstants.RECORD_TYPE.INSERT_TRANSFORM:
            case MetadataConstants.RECORD_TYPE.UPDATE_TRANSFORM:
View Full Code Here

        tokenIndex++;

        // The next token is the UUID of the primary key
        String id = getObjectValue(tokens.get(tokenIndex++));
        if (id != null) {
          KeyRecord pk = new KeyRecord(KeyRecord.Type.Primary);
          pk.setUUID(id);
          table.setPrimaryKey(pk);
        }

        tokenIndex+=4; //skip reading uuids for associated records
View Full Code Here

   * @param elements the elements of the key (will be used as if they were
   * metadata IDs)
   * @return key metadata object
   */
  public static KeyRecord createKey(KeyRecord.Type type, String name, Table group, List<Column> elements) {
    KeyRecord key = new KeyRecord(type);
    key.setName(name);
    for (Column column : elements) {
      key.addColumn(column);
    }
    switch (type) {
    case Primary:
      group.setPrimaryKey(key);
      break;
View Full Code Here

      new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.BOOLEAN, DataTypeManager.DefaultDataTypes.DOUBLE });
    if (!allUpdatable) {
      pm1g1e.get(0).setUpdatable(false);
    }
   
    KeyRecord pk = RealMetadataFactory.createKey(Type.Primary, "pk", pm1g1, pm1g1e.subList(0, 1));
   
    List<Column> pm1g2e = RealMetadataFactory.createElements(pm1g2,
      new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
      new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.BOOLEAN, DataTypeManager.DefaultDataTypes.DOUBLE });
View Full Code Here

TOP

Related Classes of org.teiid.metadata.KeyRecord

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.