本文整理了Java中org.apache.metamodel.schema.Table.getPrimaryKeys()
方法的一些代码示例,展示了Table.getPrimaryKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getPrimaryKeys()
方法的具体详情如下:
包路径:org.apache.metamodel.schema.Table
类名称:Table
方法名:getPrimaryKeys
[英]Gets the columns of this table that are known to be primary keys. See Column#isPrimaryKey().
[中]
代码示例来源:origin: apache/metamodel
public Schema toSerializableForm() {
for (Table table : getTables()) {
table.getColumns();
table.getIndexedColumns();
table.getPrimaryKeys();
}
loadRelations();
return this;
}
代码示例来源:origin: org.apache.metamodel/MetaModel-jdbc
public Schema toSerializableForm() {
for (Table table : getTables()) {
table.getColumns();
table.getIndexedColumns();
table.getPrimaryKeys();
}
loadRelations();
return this;
}
代码示例来源:origin: org.eobjects.analyzerbeans/AnalyzerBeans-core
Column[] primaryKeyColumns = _table.getPrimaryKeys();
if (primaryKeyColumns == null || primaryKeyColumns.length == 0) {
logger.info("No primary keys defined for table {}, not pre-selecting primary keys", _table.getName());
代码示例来源:origin: datacleaner/DataCleaner
/**
* Inspects the row processed tables primary keys. If all primary keys are
* in the source columns of the AnalysisJob, they will be added to the
* physically queried columns.
*
* Adding the primary keys to the query is a trade-off: It helps a lot in
* making eg. annotated rows referenceable to the source table, but it may
* also potentially make the job heavier to execute since a lot of (unique)
* values will be retrieved.
*/
public void addPrimaryKeysIfSourced() {
final List<Column> primaryKeyColumns = getTable().getPrimaryKeys();
if (primaryKeyColumns == null || primaryKeyColumns.isEmpty()) {
logger.info("No primary keys defined for table {}, not pre-selecting primary keys", getTable().getName());
return;
}
final Collection<InputColumn<?>> sourceInputColumns = getAnalysisJob().getSourceColumns();
final List<Column> sourceColumns = CollectionUtils.map(sourceInputColumns, InputColumn::getPhysicalColumn);
for (final Column primaryKeyColumn : primaryKeyColumns) {
if (!sourceColumns.contains(primaryKeyColumn)) {
logger.info("Primary key column {} not added to source columns, not pre-selecting primary keys");
return;
}
}
addPhysicalColumns(primaryKeyColumns);
}
代码示例来源:origin: datacleaner/DataCleaner
final List<Column> primaryKeys = sourceTable.getPrimaryKeys();
if (primaryKeys.size() == 1) {
final Column primaryKey = primaryKeys.get(0);
代码示例来源:origin: org.eobjects.analyzerbeans/AnalyzerBeans-cluster
final Column[] primaryKeys = sourceTable.getPrimaryKeys();
if (primaryKeys.length == 1) {
final Column primaryKey = primaryKeys[0];
内容来源于网络,如有侵权,请联系作者删除!