ORDER BY w
, какая логическая операция должна быть произведена? w
это не скаляр, который можно сравнить, а внутренняя машинерия.SELECT sum(num) AS num_sum OVER w FROM my_table WINDOW w AS (PARTITION BY name) ORDER BY num_sum;
ORDER BY w
? Сортировка по определению окна? Вы же сами приводите правильную цитату: Оконные функции разрешается использовать в запросе только в списке SELECT и предложении ORDER BY.
SELECT sum(num) OVER w
FROM my_table
WINDOW w AS (PARTITION BY name)
ORDER BY MAX(num) OVER w
/*
* Decompiled with CFR 0.151.
*/
package com.learning.enums;
public final class City
extends Enum<City> {
public static final /* enum */ City Moscow = new City("Moscow", 0, 45);
public static final /* enum */ City Novosibirsk = new City("Novosibirsk", 1, 50);
private int regionCode;
private static final /* synthetic */ City[] $VALUES;
public static City[] values() {
return (City[])$VALUES.clone();
}
public static City valueOf(String name) {
return Enum.valueOf(City.class, name);
}
private City(String string, int n, int regionCode) {
super(string, n);
this.regionCode = regionCode;
}
private static /* synthetic */ City[] $values() {
return new City[]{Moscow, Novosibirsk};
}
static {
$VALUES = City.$values();
}
}
DeferredResult provides an alternative to using a Callable for asynchronous request processing. While a Callable is executed concurrently on behalf of the application, with a DeferredResult the application can produce the result from a thread of its choice.
Subclasses can extend this class to easily associate additional data or behavior with the DeferredResult. For example, one might want to associate the user used to create the DeferredResult by extending the class and adding an additional property for the user. In this way, the user could easily be accessed later without the need to use a data structure to do the mapping.
An example of associating additional behavior to this class might be realized by extending the class to implement an additional interface. For example, one might want to implement Comparable so that when the DeferredResult is added to a PriorityQueue it is handled in the correct order.
По факту заметил, что с DiferredRestult могу указывать сам пул потоков, а с Callable нет.
Как установить в ответ http-код 412 и одновременно отменить выполнение запросов типа POST, PUT, DELETE?
@GetMapping
Второй с аннотацией @RequestMapping("/")
или @PostMapping
для выше упомянутых случаев, и добавить в его параметры HttpServletResponse resp
В теле метода: resp.setStatus(412); return "redirect:error_page.html";
Можно сделать метод void или делать переадресацию.@PostMapping
Read Committed is the default isolation level in PostgreSQL.
melkij=> select 'hello'::xml;
xml
-------
hello
(1 строка)
melkij=> select '<foo>hello'::xml;
ERROR: invalid XML content
СТРОКА 1: select '<foo>hello'::xml;
^
ПОДРОБНОСТИ: line 1: Premature end of data in tag foo line 1
<foo>hello
^
line 1: chunk is not well balanced
<foo>hello
При этом по факту я спокойно вставляю в таблицу произвольную строку и никакой проверки не происходит, данные спокойно записываются в таблицу.