From: <leg...@at...> - 2004-02-22 16:29:42
|
The following comment has been added to this issue: Author: CVS Notification Service Created: Sun, 22 Feb 2004 10:21 AM Body: CVS COMMIT LOG: SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/impl AbstractQueryImpl.java,1.1.2.22,1.1.2.23 Fix for HB-579 Query.setProperties(Object) now detects array's and collection's properties and delegate to the appropriate Query.setParameterList(). (Max Andersen, Nick Heudecker) --------------------------------------------------------------------- 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: Closed Priority: Minor Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Fix Fors: 2.1.3 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: Sun, 22 Feb 2004 10:21 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 |