Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
set json = :json where entityFQNHash=:entityFQNHash and extension=:extension and timestamp=:timestamp",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value =
"UPDATE
set json = (:json :: jsonb) where entityFQNHash=:entityFQNHash and extension=:extension and timestamp=:timestamp",
connectionType = POSTGRES)
void update(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("json") String json,
@Bind("timestamp") Long timestamp);
default void update(String entityFQNHash, String extension, String json, Long timestamp) {
update(getTimeSeriesTableName(), entityFQNHash, extension, json, timestamp);
}
@ConnectionAwareSqlUpdate(
value = "UPDATE
set json = :json where id=:id",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value = "UPDATE
" + "ORDER BY timestamp DESC LIMIT :limit OFFSET :offset")
List listWithOffset(
@Define("table") String table,
@BindMap Map params,
@Define("cond") String cond,
@Bind("limit") int limit,
@Bind("offset") int offset);
@SqlQuery(
"SELECT json FROM
"
+ "AND timestamp BETWEEN :startTs AND :endTs "
+ "ORDER BY timestamp DESC LIMIT :limit OFFSET :offset")
List listWithOffset(
@Define("table") String table,
@BindMap Map params,
@Define("cond") String cond,
@Bind("limit") int limit,
@Bind("offset") int offset,
@Bind("startTs") Long startTs,
@Bind("endTs") Long endTs);
@SqlQuery(
"SELECT json FROM "
+ "(SELECT id, json, ROW_NUMBER() OVER(PARTITION BY ORDER BY timestamp DESC) AS row_num "
+ "FROM
"
+ "AND timestamp BETWEEN :startTs AND :endTs "
+ "ORDER BY timestamp DESC) ranked "
+ "WHERE ranked.row_num = 1 LIMIT :limit OFFSET :offset")
List listWithOffset(
@Define("table") String table,
@Define("cond") String cond,
@Define("partition") String partition,
@Bind("limit") int limit,
@Bind("offset") int offset,
@Bind("startTs") Long startTs,
@Bind("endTs") Long endTs);
default List listWithOffset(
ListFilter filter, int limit, int offset, Long startTs, Long endTs, boolean latest) {
return latest
? listWithOffset(
getTimeSeriesTableName(),
filter.getCondition(),
getPartitionFieldName(),
limit,
offset,
startTs,
endTs)
: listWithOffset(
getTimeSeriesTableName(),
filter.getQueryParams(),
filter.getCondition(),
limit,
offset,
startTs,
endTs);
}
default List listWithOffset(ListFilter filter, int limit, int offset) {
return listWithOffset(
getTimeSeriesTableName(), filter.getQueryParams(), filter.getCondition(), limit, offset);
}
@ConnectionAwareSqlUpdate(
value =
"UPDATE
set json = :json where entityFQNHash=:entityFQNHash and extension=:extension and timestamp=:timestamp and json -> '$.operation' = :operation",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value =
"UPDATE
set json = (:json :: jsonb) where entityFQNHash=:entityFQNHash and extension=:extension and timestamp=:timestamp and json #>>'{operation}' = :operation",
connectionType = POSTGRES)
void updateExtensionByOperation(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("json") String json,
@Bind("timestamp") Long timestamp,
@Bind("operation") String operation);
default void updateExtensionByOperation(
String entityFQNHash, String extension, String json, Long timestamp, String operation) {
updateExtensionByOperation(
getTimeSeriesTableName(), entityFQNHash, extension, json, timestamp, operation);
}
@SqlQuery(
"SELECT json FROM
")
int listCount(
@Define("table") String table, @BindMap Map params, @Define("cond") String cond);
default int listCount(ListFilter filter) {
return listCount(getTimeSeriesTableName(), filter.getQueryParams(), filter.getCondition());
}
default int listCount() {
return listCount(new ListFilter(null));
}
@SqlQuery("SELECT count(*) FROM
AND timestamp BETWEEN :startTs AND :endTs")
int listCount(
@Define("table") String table,
@BindMap Map params,
@Define("cond") String cond,
@Bind("startTs") Long startTs,
@Bind("endTs") Long endTs);
@SqlQuery(
"SELECT count(*) FROM "
+ "(SELECT id, ROW_NUMBER() OVER(PARTITION BY ORDER BY timestamp DESC) AS row_num FROM "
+ "
AND timestamp BETWEEN :startTs AND :endTs) ranked "
+ "WHERE ranked.row_num = 1")
int listCount(
@Define("table") String table,
@Define("partition") String partition,
@BindMap Map params,
@Define("cond") String cond,
@Bind("startTs") Long startTs,
@Bind("endTs") Long endTs);
default int listCount(ListFilter filter, Long startTs, Long endTs, boolean latest) {
return latest
? listCount(
getTimeSeriesTableName(),
getPartitionFieldName(),
filter.getQueryParams(),
filter.getCondition(),
startTs,
endTs)
: listCount(
getTimeSeriesTableName(),
filter.getQueryParams(),
filter.getCondition(),
startTs,
endTs);
}
@SqlQuery("SELECT json FROM
WHERE id = :id")
String getById(@Define("table") String table, @Bind("id") String id);
default String getById(UUID id) {
return getById(getTimeSeriesTableName(), id.toString());
}
@SqlUpdate(value = "DELETE from
WHERE id = :id")
void deleteById(@Define("table") String table, @Bind("id") String id);
default void deleteById(UUID id) {
deleteById(getTimeSeriesTableName(), id.toString());
}
/** @deprecated */
@SqlQuery("SELECT COUNT(DISTINCT entityFQN) FROM
")
@Deprecated(since = "1.1.1")
int listDistinctCount(@Define("table") String table);
default void listDistinctCount() {
listDistinctCount(getTimeSeriesTableName());
}
@ConnectionAwareSqlQuery(
value =
"WITH data AS (SELECT ROW_NUMBER() OVER(ORDER BY timestamp ASC) AS row_num, json "
+ "FROM
WHERE entityFQNHash = :entityFQNHash) "
+ "SELECT row_num, json FROM data WHERE row_num > :after LIMIT :limit",
connectionType = MYSQL)
@ConnectionAwareSqlQuery(
value =
"WITH data AS (SELECT ROW_NUMBER() OVER(ORDER BY timestamp ASC) AS row_num, json "
+ "FROM
WHERE entityFQNHash = :entityFQNHash) "
+ "SELECT row_num, json FROM data WHERE row_num > (:after :: integer) LIMIT :limit",
connectionType = POSTGRES)
@RegisterRowMapper(ReportDataMapper.class)
List getAfterExtension(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("limit") int limit,
@Bind("after") String after);
default List getAfterExtension(
String entityFQNHash, int limit, String after) {
return getAfterExtension(getTimeSeriesTableName(), entityFQNHash, limit, after);
}
@SqlQuery(
"SELECT json FROM
WHERE entityFQNHash = :entityFQNHash AND extension = :extension AND timestamp = :timestamp")
String getExtensionAtTimestamp(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("timestamp") long timestamp);
default String getExtensionAtTimestamp(String entityFQNHash, String extension, long timestamp) {
return getExtensionAtTimestamp(getTimeSeriesTableName(), entityFQNHash, extension, timestamp);
}
@ConnectionAwareSqlQuery(
value =
"SELECT json FROM
WHERE entityFQNHash = :entityFQNHash AND extension = :extension AND timestamp = :timestamp AND json -> '$.operation' = :operation",
connectionType = MYSQL)
@ConnectionAwareSqlQuery(
value =
"SELECT json FROM
WHERE entityFQNHash = :entityFQNHash AND extension = :extension AND timestamp = :timestamp AND json #>>'{operation}' = :operation",
connectionType = POSTGRES)
String getExtensionAtTimestampWithOperation(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("timestamp") long timestamp,
@Bind("operation") String operation);
default String getExtensionAtTimestampWithOperation(
String entityFQNHash, String extension, long timestamp, String operation) {
return getExtensionAtTimestampWithOperation(
getTimeSeriesTableName(), entityFQNHash, extension, timestamp, operation);
}
@SqlQuery(
"SELECT json FROM
WHERE entityFQNHash = :entityFQNHash AND extension = :extension AND timestamp = :timestamp")
void deleteAtTimestamp(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("timestamp") Long timestamp);
default void deleteAtTimestamp(String entityFQNHash, String extension, Long timestamp) {
deleteAtTimestamp(getTimeSeriesTableName(), entityFQNHash, extension, timestamp);
}
@SqlUpdate(
"DELETE FROM
WHERE entityFQNHash = :entityFQNHash AND extension = :extension AND timestamp < :timestamp")
void deleteBeforeTimestamp(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("timestamp") Long timestamp);
default void deleteBeforeTimestamp(String entityFQNHash, String extension, Long timestamp) {
deleteBeforeTimestamp(getTimeSeriesTableName(), entityFQNHash, extension, timestamp);
}
@SqlQuery(
"SELECT json FROM
where entityFQNHash = :entityFQNHash and extension = :extension "
+ " AND timestamp >= :startTs and timestamp <= :endTs ORDER BY timestamp DESC")
List listBetweenTimestamps(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("startTs") Long startTs,
@Bind("endTs") long endTs);
default List listBetweenTimestamps(
String entityFQNHash, String extension, Long startTs, long endTs) {
return listBetweenTimestamps(
getTimeSeriesTableName(), entityFQNHash, extension, startTs, endTs);
}
@SqlQuery(
"SELECT json FROM
where entityFQNHash = :entityFQNHash and extension = :extension "
+ " AND timestamp >= :startTs and timestamp <= :endTs ORDER BY timestamp ")
List listBetweenTimestampsByOrder(
@Define("table") String table,
@BindFQN("entityFQNHash") String entityFQNHash,
@Bind("extension") String extension,
@Bind("startTs") Long startTs,
@Bind("endTs") long endTs,
@Define("orderBy") OrderBy orderBy);
default List listBetweenTimestampsByOrder(
String entityFQNHash, String extension, Long startTs, long endTs, OrderBy orderBy) {
return listBetweenTimestampsByOrder(
getTimeSeriesTableName(), entityFQNHash, extension, startTs, endTs, orderBy);
}
@ConnectionAwareSqlUpdate(
value =
"UPDATE