How can I use CONCAT()
and GROUP_CONCAT()
in HQL queries?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
subclass the dialect
and
or use SQLFunctionTemplate
If you are using createSQLQuery, use addScalar to that column as String.
About
concat
: it works exactly the same way as it does in MySQL (it concatenates strings, it is not an aggregate function).You can add
group_concat
as an sql function to your configuration. This way you assume that the underlaying DB knows this function, and you tie your program to MySQL.You also indicate that the output of the function is a string. Without this when you
group_concat
numeric fields Hibernate will assume the result also to be numeric and crash.