org.squashtest.tm.service.internal.hibernate
Class GroupConcatFunction
java.lang.Object
org.hibernate.dialect.function.StandardSQLFunction
org.squashtest.tm.service.internal.hibernate.GroupConcatFunction
- All Implemented Interfaces:
- org.hibernate.dialect.function.SQLFunction
public class GroupConcatFunction
- extends org.hibernate.dialect.function.StandardSQLFunction
This custom implementation of group_concat. Because it can contain an embedded expression, hibernate will try to parse it just as if
it was within the scope of the main query - thus causing parsing exception.
To prevent this we had to make the awkward syntax as follow:
- group_concat(col identifier) : will concatenate as expected over the column identifier.
- group_concat(col identifier 1, 'order by', col identifier 2, ['asc|desc']) : will send this to the target db as 'group_concat(id1 order by id2 [asc|desc])'
- Author:
- bsiri
|
Method Summary |
String |
render(org.hibernate.type.Type firstArgumentType,
List arguments,
org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
|
| Methods inherited from class org.hibernate.dialect.function.StandardSQLFunction |
getName, getReturnType, getType, hasArguments, hasParenthesesIfNoArguments, toString |
GroupConcatFunction
public GroupConcatFunction(String name,
org.hibernate.type.Type registeredType)
GroupConcatFunction
public GroupConcatFunction(String name)
render
public String render(org.hibernate.type.Type firstArgumentType,
List arguments,
org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
- Specified by:
render in interface org.hibernate.dialect.function.SQLFunction- Overrides:
render in class org.hibernate.dialect.function.StandardSQLFunction
Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.