@Override public Table getPreviewTable(final Datastore datastore) { try (DatastoreConnection con = datastore.openConnection()) { return con.getSchemaNavigator().convertToTable(_schemaName, _tableName); } }
@Override public DatastoreConnection openConnection() { final UsageAwareDatastoreConnection<E> connection = getDatastoreConnection(); if (connection instanceof UpdateableDatastoreConnection) { return new UpdateableDatastoreConnectionLease((UpdateableDatastoreConnection) connection); } else { return new DatastoreConnectionLease(connection); } }
@Override public PerformanceCharacteristics getPerformanceCharacteristics() { boolean queryOptimizationPreferred = true; boolean naturalRecordOrderConsistent = true; for (final Datastore datastore : _datastores) { final PerformanceCharacteristics performanceCharacteristics = datastore.getPerformanceCharacteristics(); queryOptimizationPreferred = queryOptimizationPreferred && performanceCharacteristics.isQueryOptimizationPreferred(); naturalRecordOrderConsistent = naturalRecordOrderConsistent && performanceCharacteristics.isNaturalRecordOrderConsistent(); } return new PerformanceCharacteristicsImpl(queryOptimizationPreferred, naturalRecordOrderConsistent); }
private Column[] getQueryConditionColumns() { if (queryConditionColumns == null) { if (isCarthesianProductMode()) { queryConditionColumns = new Column[0]; } else { try (DatastoreConnection con = datastore.openConnection()) { queryConditionColumns = con.getSchemaNavigator().convertToColumns(schemaName, tableName, conditionColumns); } } } return queryConditionColumns; }
public WriteDataResultImpl(final int writtenRowCount, final int updatesCount, final String datastoreName, final String schemaName, final String tableName) { _writtenRowCount = writtenRowCount; _updatesCount = updatesCount; _schemaName = schemaName; _tableName = tableName; _datastoreName = datastoreName; _datastoreFunc = catalog -> catalog.getDatastore(datastoreName); _errorRowCount = 0; _errorDatastore = null; }
private String getDatastoreName() { if (_datastore != null) { return _datastore.getName(); } return "<null>"; }
public Table[] convertToTables(final String[] tableNames) { final Table[] result = new Table[tableNames.length]; for (int i = 0; i < result.length; i++) { result[i] = convertToTable(tableNames[i]); } return result; }
public DatastoreConnectionImpl(final E dataContext, final Datastore datastore, final AutoCloseable... closeables) { super(datastore); _dataContext = dataContext; _schemaNavigator = new SchemaNavigator(dataContext); _closeables = closeables; }
/** * @return the description */ public String getDescription() { return _datastore.getDescription(); }
@Override public void close() { if (_datastoreConnection != null) { _datastoreConnection.close(); } }
public Column[] convertToColumns(final String[] columnNames) { final Column[] result = new Column[columnNames.length]; for (int i = 0; i < result.length; i++) { result[i] = convertToColumn(columnNames[i]); } return result; }
/** * Alternative constructor usable only for in-memory (ie. non-persistent) * datastores, because the datastore will not be able to create new * connections. * * @param name * @param dc */ public JdbcDatastore(final String name, final UpdateableDataContext dc) { this(name, null, null, null, null, null, false, null, null); setDataContextProvider(new UpdateableDatastoreConnectionImpl<>(dc, this)); }
public Schema[] convertToSchemas(final String[] schemaNames) { final Schema[] result = new Schema[schemaNames.length]; for (int i = 0; i < result.length; i++) { result[i] = convertToSchema(schemaNames[i]); } return result; }
@Override public String toString() { return "Neo4jDatastore[name=" + getName() + ", hostname=" + _hostname + ", port=" + _port + ", _username=" + _username + "]"; }
@Override public UpdateableDatastoreConnection openConnection() { final DatastoreConnection connection = super.openConnection(); return (UpdateableDatastoreConnection) connection; }
public DataSourceDatastoreConnection(final UpdateableDataContext dataContext, final Datastore datastore) { super(datastore); _dataContext = dataContext; _schemaNavigator = new SchemaNavigator(_dataContext); }
@Override public UpdateableDatastoreConnection openConnection() { final DatastoreConnection connection = super.openConnection(); return (UpdateableDatastoreConnection) connection; }
@Override public UpdateableDatastoreConnection openConnection() { final DatastoreConnection connection = super.openConnection(); return (UpdateableDatastoreConnection) connection; }
@Override public UpdateableDatastoreConnection openConnection() { final DatastoreConnection connection = super.openConnection(); return (UpdateableDatastoreConnection) connection; }
@Override public UpdateableDatastoreConnection openConnection() { final DatastoreConnection connection = super.openConnection(); return (UpdateableDatastoreConnection) connection; }