private static boolean isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef) { return colDef.isPK() || (pkConstraint != null && pkConstraint.contains(colDef.getColumnDefName())); }
for( ColumnDef colDef : columnDefs) { if (colDef != null && !colDef.isNull()) { if(colDef.isPK()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY) .setColumnName(colDef.getColumnDefName().getColumnName()).build().buildException(); if (colDef != null && colDef.isPK() && table.getType() == VIEW && table.getViewType() != MAPPED) { throwIfLastPKOfParentIsVariableLength(getParentOfView(table), schemaName, tableName, colDef); if (!colDef.isPK()) { String colDefFamily = colDef.getColumnDefName().getFamilyName(); String familyName = null; columnQualifierBytes = EncodedColumnsUtil.getColumnQualifierBytes(colDef.getColumnDefName().getColumnName(), encodedCQ, table, colDef.isPK()); pkColumns.addAll(table.getPKColumns()); for (int i=0; i<numCols; ++i) { if (columnDefs.get(i).isPK()) { pkColumns.add(columns.get(i)); for (int i=0; i<numCols; ++i) { ColumnDef colDef = columnDefs.get(i); if (colDef.isPK()) { PDataType indexColDataType = IndexUtil.getIndexColumnDataType(colDef.isNull(), colDef.getDataType()); ColumnName indexColName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(null, colDef.getColumnDefName().getColumnName()));
for (ColumnDef colDef : colDefs) { rowTimeStampColumnAlreadyFound = checkAndValidateRowTimestampCol(colDef, pkConstraint, rowTimeStampColumnAlreadyFound, tableType); if (colDef.isPK()) { // i.e. the column is declared as CREATE TABLE COLNAME DATATYPE PRIMARY KEY... if (wasPKDefined) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS)
ColumnName columnDefName = def.getColumnDefName(); SortOrder sortOrder = def.getSortOrder(); boolean isPK = def.isPK(); boolean isRowTimestamp = def.isRowTimestamp(); if (pkConstraint != null) { if (def.isPK() && !pkConstraint.getColumnNames().isEmpty() ) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS) .setColumnName(columnName).build().buildException();
private static boolean isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef) { return colDef.isPK() || (pkConstraint != null && pkConstraint.contains(colDef.getColumnDefName())); }
private static boolean isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef) { return colDef.isPK() || (pkConstraint != null && pkConstraint.contains(colDef.getColumnDefName())); }
boolean isColumnDeclaredRowTimestamp = colDef.isRowTimestamp() || pkConstraint.isColumnRowTimestamp(columnDefName); if (isColumnDeclaredRowTimestamp) { boolean isColumnPartOfPk = colDef.isPK() || pkConstraint.contains(columnDefName);
for (ColumnDef colDef : colDefs) { rowTimeStampColumnAlreadyFound = checkAndValidateRowTimestampCol(colDef, pkConstraint, rowTimeStampColumnAlreadyFound, tableType); if (colDef.isPK()) { // i.e. the column is declared as CREATE TABLE COLNAME DATATYPE PRIMARY KEY... if (wasPKDefined) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS)
for( ColumnDef colDef : columnDefs) { if (colDef != null && !colDef.isNull()) { if(colDef.isPK()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY) .setColumnName(colDef.getColumnDefName().getColumnName()).build().buildException(); if (colDef != null && colDef.isPK() && table.getType() == VIEW && table.getViewType() != MAPPED) { throwIfLastPKOfParentIsFixedLength(getParentOfView(table), schemaName, tableName, colDef); if (!colDef.isPK()) { String colDefFamily = colDef.getColumnDefName().getFamilyName(); String familyName = null; columnQualifierBytes = EncodedColumnsUtil.getColumnQualifierBytes(colDef.getColumnDefName().getColumnName(), encodedCQ, table, colDef.isPK()); pkColumns.addAll(table.getPKColumns()); for (int i=0; i<numCols; ++i) { if (columnDefs.get(i).isPK()) { pkColumns.add(columns.get(i)); for (int i=0; i<numCols; ++i) { ColumnDef colDef = columnDefs.get(i); if (colDef.isPK()) { PDataType indexColDataType = IndexUtil.getIndexColumnDataType(colDef.isNull(), colDef.getDataType()); ColumnName indexColName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(null, colDef.getColumnDefName().getColumnName()));
for( ColumnDef colDef : columnDefs) { if (colDef != null && !colDef.isNull()) { if(colDef.isPK()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.NOT_NULLABLE_COLUMN_IN_ROW_KEY) .setColumnName(colDef.getColumnDefName().getColumnName()).build().buildException(); if (colDef != null && colDef.isPK() && table.getType() == VIEW && table.getViewType() != MAPPED) { throwIfLastPKOfParentIsVariableLength(getParentOfView(table), schemaName, tableName, colDef); if (!colDef.isPK()) { String colDefFamily = colDef.getColumnDefName().getFamilyName(); String familyName = null; columnQualifierBytes = EncodedColumnsUtil.getColumnQualifierBytes(colDef.getColumnDefName().getColumnName(), encodedCQ, table, colDef.isPK()); pkColumns.addAll(table.getPKColumns()); for (int i=0; i<numCols; ++i) { if (columnDefs.get(i).isPK()) { pkColumns.add(columns.get(i)); for (int i=0; i<numCols; ++i) { ColumnDef colDef = columnDefs.get(i); if (colDef.isPK()) { PDataType indexColDataType = IndexUtil.getIndexColumnDataType(colDef.isNull(), colDef.getDataType()); ColumnName indexColName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(null, colDef.getColumnDefName().getColumnName()));
for (ColumnDef colDef : colDefs) { rowTimeStampColumnAlreadyFound = checkAndValidateRowTimestampCol(colDef, pkConstraint, rowTimeStampColumnAlreadyFound, tableType); if (colDef.isPK()) { // i.e. the column is declared as CREATE TABLE COLNAME DATATYPE PRIMARY KEY... if (wasPKDefined) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS)
ColumnName columnDefName = def.getColumnDefName(); SortOrder sortOrder = def.getSortOrder(); boolean isPK = def.isPK(); boolean isRowTimestamp = def.isRowTimestamp(); if (pkConstraint != null) { if (def.isPK() && !pkConstraint.getColumnNames().isEmpty() ) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS) .setColumnName(columnName).build().buildException();
ColumnName columnDefName = def.getColumnDefName(); SortOrder sortOrder = def.getSortOrder(); boolean isPK = def.isPK(); boolean isRowTimestamp = def.isRowTimestamp(); if (pkConstraint != null) { if (def.isPK() && !pkConstraint.getColumnNames().isEmpty() ) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS) .setColumnName(columnName).build().buildException();
boolean isColumnDeclaredRowTimestamp = colDef.isRowTimestamp() || pkConstraint.isColumnRowTimestamp(columnDefName); if (isColumnDeclaredRowTimestamp) { boolean isColumnPartOfPk = colDef.isPK() || pkConstraint.contains(columnDefName);
boolean isColumnDeclaredRowTimestamp = colDef.isRowTimestamp() || pkConstraint.isColumnRowTimestamp(columnDefName); if (isColumnDeclaredRowTimestamp) { boolean isColumnPartOfPk = colDef.isPK() || pkConstraint.contains(columnDefName);