At least in part because of EJB3 support, the Hibernate queries need to add the ability to better "guess" a parameter's type. The way this is being done is to base the "expected type" off the type of the property to which the parameter is related; previously, this just performed a guess based on the java class of the bound parameter value. The new code does this in the query parsers (this will only be available while using the ANTLR-based HQL parser).
The way this was done was to assume that the parameter is always an operand of some operator. Specifically, the operator *must* be either a binary or ternary operator. From the grammar, once an operator is recognized (and after its sub-tree has been parsed) the operator node is asked to "initialize" itself. Currently, this initialization logic only performs this expected parameter type resolution. Basically, it looks for any of its operands which happen to be a parameter; it then looks at its other operand(s) to determine an appropriate type to be expected for the parameter value. This is all done and working for logic operators. I am still in the process of adding it to the arithmetic operators. Anyway, this functionality will be available in the 3.1rc2 release, which I hope to cut next week. ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel