Search in sources :

Example 1 with RecordStore

use of com.revolsys.record.schema.RecordStore in project com.revolsys.open by revolsys.

the class JdbcUtils method appendWhere.

public static void appendWhere(final StringBuilder sql, final Query query) {
    final Condition where = query.getWhereCondition();
    if (!where.isEmpty()) {
        sql.append(" WHERE ");
        final RecordDefinition recordDefinition = query.getRecordDefinition();
        if (recordDefinition == null) {
            where.appendSql(query, null, sql);
        } else {
            final RecordStore recordStore = recordDefinition.getRecordStore();
            where.appendSql(query, recordStore, sql);
        }
    }
}
Also used : Condition(com.revolsys.record.query.Condition) JdbcRecordStore(com.revolsys.jdbc.io.JdbcRecordStore) RecordStore(com.revolsys.record.schema.RecordStore) RecordDefinition(com.revolsys.record.schema.RecordDefinition)

Example 2 with RecordStore

use of com.revolsys.record.schema.RecordStore in project com.revolsys.open by revolsys.

the class RecordStoreRecordAndGeometryWriterFactory method newRecordWriter.

@Override
public RecordWriter newRecordWriter(final RecordDefinition recordDefinition, final Resource resource) {
    final File file = resource.getFile();
    final RecordStore recordStore = RecordStore.newRecordStore(file);
    if (recordStore == null) {
        return null;
    } else {
        recordStore.initialize();
        return new RecordStoreRecordWriter(recordStore, recordDefinition);
    }
}
Also used : RecordStore(com.revolsys.record.schema.RecordStore) File(java.io.File)

Example 3 with RecordStore

use of com.revolsys.record.schema.RecordStore in project com.revolsys.open by revolsys.

the class DelegatingRecordStoreHandler method invoke.

@Override
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
    int numArgs;
    if (args == null) {
        numArgs = 0;
    } else {
        numArgs = args.length;
    }
    if (method.getName().equals("toString") && numArgs == 0) {
        return this.label;
    } else if (method.getName().equals("getLabel") && numArgs == 0) {
        return this.label;
    } else if (method.getName().equals("hashCode") && numArgs == 0) {
        return this.label.hashCode();
    } else if (method.getName().equals("equals") && numArgs == 1) {
        final boolean equal = args[0] == proxy;
        return equal;
    } else if (method.getName().equals("close") && numArgs == 0) {
        if (this.recordStore != null) {
            final RecordStore recordStore = getRecordStore();
            recordStore.close();
            this.recordStore = null;
        }
        return null;
    } else {
        final RecordStore recordStore = getRecordStore();
        return method.invoke(recordStore, args);
    }
}
Also used : RecordStore(com.revolsys.record.schema.RecordStore)

Example 4 with RecordStore

use of com.revolsys.record.schema.RecordStore in project com.revolsys.open by revolsys.

the class ArcSdeStGeometryRecordStoreExtension method preProcess.

@Override
public void preProcess(final RecordStoreSchema schema) {
    final JdbcRecordStoreSchema jdbcSchema = (JdbcRecordStoreSchema) schema;
    final RecordStore recordStore = schema.getRecordStore();
    final OracleRecordStore oracleRecordStore = (OracleRecordStore) recordStore;
    try {
        try (final Connection connection = oracleRecordStore.getJdbcConnection()) {
            final String schemaName = jdbcSchema.getDbName();
            loadTableProperties(connection, schema, schemaName);
            loadColumnProperties(schema, schemaName, connection);
        }
    } catch (final Throwable e) {
        Logs.error(this, "Unable to get ArcSDE metadata for schema " + schema.getName(), e);
    }
}
Also used : JdbcRecordStoreSchema(com.revolsys.jdbc.io.JdbcRecordStoreSchema) OracleRecordStore(com.revolsys.oracle.recordstore.OracleRecordStore) RecordStore(com.revolsys.record.schema.RecordStore) Connection(java.sql.Connection) OracleRecordStore(com.revolsys.oracle.recordstore.OracleRecordStore)

Example 5 with RecordStore

use of com.revolsys.record.schema.RecordStore in project com.revolsys.open by revolsys.

the class LayerRecordForm method addCodeTableLabelField.

protected ObjectLabelField addCodeTableLabelField(final String fieldName) {
    final RecordStore recordStore = getRecordStore();
    final CodeTable codeTable = recordStore.getCodeTableByFieldName(fieldName);
    final ObjectLabelField field = new ObjectLabelField(fieldName, codeTable);
    field.setFont(SwingUtil.FONT);
    addField(fieldName, field);
    return field;
}
Also used : CodeTable(com.revolsys.record.code.CodeTable) RecordStore(com.revolsys.record.schema.RecordStore) ObjectLabelField(com.revolsys.swing.field.ObjectLabelField)

Aggregations

RecordStore (com.revolsys.record.schema.RecordStore)25 RecordDefinition (com.revolsys.record.schema.RecordDefinition)11 Identifier (com.revolsys.identifier.Identifier)5 Transaction (com.revolsys.transaction.Transaction)4 ArrayList (java.util.ArrayList)4 PathName (com.revolsys.io.PathName)3 Record (com.revolsys.record.Record)3 RecordReader (com.revolsys.record.io.RecordReader)3 Query (com.revolsys.record.query.Query)3 HashMap (java.util.HashMap)3 BaseCloseable (com.revolsys.io.BaseCloseable)2 CodeTable (com.revolsys.record.code.CodeTable)2 Condition (com.revolsys.record.query.Condition)2 AbstractRecordStore (com.revolsys.record.schema.AbstractRecordStore)2 RecordStoreSchemaElement (com.revolsys.record.schema.RecordStoreSchemaElement)2 BaseTreeNode (com.revolsys.swing.tree.BaseTreeNode)2 Map (java.util.Map)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 MapEx (com.revolsys.collection.map.MapEx)1 JdbcRecordStore (com.revolsys.jdbc.io.JdbcRecordStore)1