org.squashtest.tm.service.internal.hibernate
Class GroupConcatFunction

java.lang.Object
  extended by org.hibernate.dialect.function.StandardSQLFunction
      extended by 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:

Author:
bsiri

Constructor Summary
GroupConcatFunction(String name)
           
GroupConcatFunction(String name, org.hibernate.type.Type registeredType)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupConcatFunction

public GroupConcatFunction(String name,
                           org.hibernate.type.Type registeredType)

GroupConcatFunction

public GroupConcatFunction(String name)
Method Detail

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.