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);
}
}
}
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);
}
}
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);
}
}
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);
}
}
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;
}
Aggregations