use of org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity in project incubator-skywalking by apache.
the class AbstractPersistenceH2DAO method prepareBatchInsert.
@Override
public final H2SqlEntity prepareBatchInsert(STREAM_DATA streamData) {
Map<String, Object> source = streamDataToH2Data(streamData);
source.put(CommonTable.COLUMN_ID, streamData.getId());
H2SqlEntity entity = new H2SqlEntity();
String sql = SqlBuilder.buildBatchInsertSql(tableName(), source.keySet());
entity.setSql(sql);
entity.setParams(source.values().toArray(new Object[0]));
return entity;
}
use of org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity in project incubator-skywalking by apache.
the class AbstractPersistenceH2DAO method prepareBatchUpdate.
@Override
public final H2SqlEntity prepareBatchUpdate(STREAM_DATA streamData) {
Map<String, Object> source = streamDataToH2Data(streamData);
H2SqlEntity entity = new H2SqlEntity();
String sql = SqlBuilder.buildBatchUpdateSql(tableName(), source.keySet(), CommonTable.COLUMN_ID);
entity.setSql(sql);
List<Object> values = new ArrayList<>(source.values());
values.add(streamData.getId());
entity.setParams(values.toArray(new Object[0]));
return entity;
}
Aggregations