From: <leg...@at...> - 2003-12-27 17:55:25
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Sat, 27 Dec 2003 11:54 AM Body: In Eclipse. Right click on file -> Team -> Create Patch Not hard ;) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-579 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-579 Summary: Patch AbstractQuery so that it supports parameter lists Type: Improvement Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 2.0 final 2.1.1 Assignee: Reporter: Nick Heudecker Created: Fri, 26 Dec 2003 11:42 AM Updated: Sat, 27 Dec 2003 11:54 AM Environment: Any Description: Currently, the AbstractQuery class doesn't take into account setting parameter lists when using the 'setProperties(Object)' method. This would be extremely helpful to me. A patch is below. public Query setProperties(Object bean) throws HibernateException { Class clazz = bean.getClass(); String[] params = getNamedParameters(); for (int i = 0; i < params.length; i++) { String namedParam = params[i]; try { Getter getter = ReflectHelper.getter(clazz, namedParam); Class retType = getter.getReturnType(); if (retType.isArray() || retType instanceof java.util.Collection) { setParameterList( namedParam, getter.get(bean) ); } else { setParameter( namedParam, getter.get(bean), guessType( getter.getReturnType() ) ); } } catch (PropertyNotFoundException pnfe) { // shouldn't something be logged here....? } } return this; } --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |