From: <leg...@at...> - 2004-01-22 23:49:59
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Thu, 22 Jan 2004 1:27 PM Body: i also like the idea - but won't look into it in detail before returning from Val Thorens in 10 days ;) --------------------------------------------------------------------- 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: Open Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Versions: 2.1 2.0 final 2.1.1 Assignee: Max Rydahl Andersen Reporter: Nick Heudecker Created: Fri, 26 Dec 2003 11:42 AM Updated: Thu, 22 Jan 2004 1:27 PM 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 |