[Hibernate-JIRA] Created: (HV-549) add method ValidatorImpl.validateElement(Annotation[], Class<?>, Type, Object value, Class<?>... groups)
by George Sapountzis (JIRA)
add method ValidatorImpl.validateElement(Annotation[], Class<?>, Type, Object value, Class<?>... groups)
--------------------------------------------------------------------------------------------------------
Key: HV-549
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-549
Project: Hibernate Validator
Issue Type: New Feature
Reporter: George Sapountzis
ValidatorImpl currently supports methods for validating bean properties / method parameters. Looking from the outside, I don't see a strong reason for using bean properties / method parameters other than that these elements are annotation placeholders.
Using TypeLiteral/AnnotationLiteral helper classes it seems possible to construct all the necessary metadata for a validation point programmatically. So, I propose to add a generic method where the annotations/type are passed by the user. The passed value need not be a bean, it could be a *primitive* value. The resulting set of constraint violations will just have a null root bean / method.
Hope you consider this a valid case and add such a method, or advise on an alternative way to achieve the same functionality. I'd like to do this without writing straw beans/methods and introspecting them just for the sake of adapting to the API. I am not able to find my way around to achieving this currently.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-7001) setMaxResults/offset generates illegal SQL for DB2 mainframe
by Brad Cupit (JIRA)
setMaxResults/offset generates illegal SQL for DB2 mainframe
------------------------------------------------------------
Key: HHH-7001
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-7001
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Final
Environment: DB2 v9 for z/OS (mainframe)
Reporter: Brad Cupit
the fix for HHH-2176 works for DB2 LUW (Linux/Unix/Windows) but does not work on DB2 for z/OS.
Specifically {{order of}} is not supported inside over():
{{select * from ( select inner2_.*, rownumber() over(order by order of inner2_) as rownumber_ from ( ...}}
I worked around this issue by extending the DB2 dialect and changing the above SQL to:
{{select * from ( select inner2_.*, rownumber() over(order by inner2_.SORT_COLUMN_ALIAS_HERE) as rownumber_ from ( ...}}
or for cases when the subquery isn't ordered:
{{select * from ( select inner2_.*, rownumber() over() as rownumber_ from ( ...}}
Which works for DB2 LUW and DB2 for z/OS.
I could provide a pull request, but to do this I had to parse the original SQL. *Is the Hibernate team interested in a pull request if the dialect has to parse SQL?*
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months