public void setRowKeys() {
		System.out.println("Setting rowkeys");
		logger.info("Setting rowkeys");

		for (Table table : schema.getTables()) {
			List<Column> rowkey = fromStringsToColumns(
					usage.getKeyColumns(table.getName()), table);

			table.setAndEncodeKey(rowkey);

			// Key for nested entity
			for (ColumnFamily colFamily : table.getColumnFamilies()) {
				if (!colFamily.getBaseRelationalTable().equals(table.getName())
						&& colFamily.getType() == ColumnFamily.Type.MANY) {
					TableStatus tableMany = db.getTable(colFamily
							.getBaseRelationalTable());

					List<IndexStatus> pkMany = tableMany.getPrimaryKey();
					List<String> pkManyStr = new ArrayList<String>();
					for (IndexStatus index : pkMany) {
						boolean include = true;

						// only include the part of the nested pk that is not
						// part of the host pk
						for (ForeignKeyStatus fk : tableMany.getReferences()) {
							if (fk.getRefTable().equals(
									table.getBaseRelationalTableName())) {
								if (fk.getColumn().equals(index.getColumn())) {
									include = false;
								}
							}
						}

						if (include)
							pkManyStr.add(index.getColumn());
					}

					colFamily.setManyKey(this
							.fromStringsToColumns(pkManyStr, schema
									.getTable(colFamily
											.getBaseRelationalTable())));
				}
			}
		}
	}