From: Daniele G. (JIRA) <no...@at...> - 2006-05-27 10:44:30
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-489?page=comments#action_23170 ] Daniele Gariboldi commented on HHH-489: --------------------------------------- In hibernate 3.1.2 i did so for PostgresSQL, just in case someone is looking for this (I was ;-) ). It would be useful to standardize on function names, for HQL beeing cross-db for bitwise operations. import org.hibernate.Hibernate; import org.hibernate.dialect.function.SQLFunctionTemplate; public class PostgreSQLDialect extends org.hibernate.dialect.PostgreSQLDialect { public PostgreSQLDialect() { super(); registerFunction("bit_and", new SQLFunctionTemplate(Hibernate.INTEGER,"?1 & ?2")); registerFunction("bit_or", new SQLFunctionTemplate(Hibernate.INTEGER,"?1 | ?2")); registerFunction("bit_not", new SQLFunctionTemplate(Hibernate.INTEGER,"~?1")); registerFunction("gbit_or", new SQLFunctionTemplate(Hibernate.INTEGER,"bit_or(?1)")); } } > Custom SQLFunction not being called > ----------------------------------- > > Key: HHH-489 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-489 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.3 > Environment: Java 1.4.2_04 > Hibernate 3.0.3 > MySQL 3.23.45-max-nt > mysql-connector-java-3.1.6 > Reporter: Darren Scott > Assignee: Gavin King > Attachments: hibernate-sqlfunction-test.zip > > > A custom SQLFunction I have written to implement bitwise AND behaviour for MySQL dialects is not being called as expected under Hibernate 3.0.2 and 3.0.3. The resulting SQL does not show the expected function translation from HQL bitwise_and(X,Y) to SQL X & Y. > This previously worked under Hibernate 3.0.1. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |