From: <one...@us...> - 2002-12-28 02:25:52
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv21213/cirrus/hibernate/helpers Modified Files: ReflectHelper.java ArrayHelper.java Log Message: added support for <joined-subclass> to CodeGenerator added Query.getNamedParameters(), Query.setProperties() fixed a bug in Query.getReturnTypes() Index: ReflectHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/ReflectHelper.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ReflectHelper.java 7 Dec 2002 08:10:23 -0000 1.36 --- ReflectHelper.java 28 Dec 2002 02:25:49 -0000 1.37 *************** *** 10,14 **** import cirrus.hibernate.*; - import cirrus.hibernate.MappingException; import cirrus.hibernate.type.*; import cirrus.hibernate.type.Type; --- 10,13 ---- *************** *** 118,124 **** ! public static Method getMethod(Class theClass, String methodName) throws MappingException { ! if (theClass==Object.class || theClass==null) throw new MappingException( "Could not find a setter" ); // will be swallowed Method result; --- 117,123 ---- ! public static Method getMethod(Class theClass, String methodName) throws PropertyNotFoundException { ! if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed Method result; *************** *** 130,135 **** return getMethod( theClass.getSuperclass(), methodName ); } ! catch (MappingException me) { ! throw new MappingException( "Could not find method " + methodName + " in class " + theClass.getName() ); } } --- 129,134 ---- return getMethod( theClass.getSuperclass(), methodName ); } ! catch (PropertyNotFoundException me) { ! throw new PropertyNotFoundException( "Could not find method " + methodName + " in class " + theClass.getName() ); } } *************** *** 140,146 **** } ! public static Setter getSetter(Class theClass, String propertyName) throws MappingException { ! if (theClass==Object.class || theClass==null) throw new MappingException( "Could not find a setter" ); // will be swallowed Method result = setter(theClass, propertyName); --- 139,145 ---- } ! public static Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { ! if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed Method result = setter(theClass, propertyName); *************** *** 150,155 **** return getSetter( theClass.getSuperclass(), propertyName ); } ! catch (MappingException me) { ! throw new MappingException( "Could not find a setter for " + propertyName + " in class " + theClass.getName() ); } } --- 149,154 ---- return getSetter( theClass.getSuperclass(), propertyName ); } ! catch (PropertyNotFoundException me) { ! throw new PropertyNotFoundException( "Could not find a setter for " + propertyName + " in class " + theClass.getName() ); } } *************** *** 161,165 **** } ! private static Method setter(Class theClass, String propertyName) throws MappingException { Class returnType = getGetter(theClass, propertyName).getReturnType(); --- 160,164 ---- } ! private static Method setter(Class theClass, String propertyName) throws PropertyNotFoundException { Class returnType = getGetter(theClass, propertyName).getReturnType(); *************** *** 186,192 **** } ! public static Getter getGetter(Class theClass, String propertyName) throws MappingException { ! if (theClass==Object.class || theClass==null) throw new MappingException( "Could not find a getter" ); // will be swallowed Method result = getter(theClass, propertyName); --- 185,191 ---- } ! public static Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { ! if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a getter" ); // will be swallowed Method result = getter(theClass, propertyName); *************** *** 196,201 **** return getGetter( theClass.getSuperclass(), propertyName ); } ! catch (MappingException me) { ! throw new MappingException( "Could not find a getter for " + propertyName + " in class " + theClass.getName() ); } } --- 195,200 ---- return getGetter( theClass.getSuperclass(), propertyName ); } ! catch (PropertyNotFoundException me) { ! throw new PropertyNotFoundException( "Could not find a getter for " + propertyName + " in class " + theClass.getName() ); } } *************** *** 273,277 **** } ! public static Constructor getDefaultConstructor(Class clazz) throws MappingException { if (isAbstractClass(clazz)) return null; --- 272,276 ---- } ! public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException { if (isAbstractClass(clazz)) return null; *************** *** 284,288 **** return constructor; } catch (NoSuchMethodException nme) { ! throw new MappingException( "Object class " + clazz.getName() + " must declare a default (no-argument) constructor" --- 283,287 ---- return constructor; } catch (NoSuchMethodException nme) { ! throw new PropertyNotFoundException( "Object class " + clazz.getName() + " must declare a default (no-argument) constructor" Index: ArrayHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/ArrayHelper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ArrayHelper.java 28 Sep 2002 15:03:29 -0000 1.8 --- ArrayHelper.java 28 Dec 2002 02:25:49 -0000 1.9 *************** *** 18,28 **** } ! public static String[] toStringArray(java.util.List list) { ! return toStringArray( list.toArray() ); } ! public static int[] toIntArray(java.util.List list) { ! Iterator iter = list.iterator(); ! int[] arr = new int[ list.size() ]; int i=0; while( iter.hasNext() ) { --- 18,28 ---- } ! public static String[] toStringArray(java.util.Collection coll) { ! return toStringArray( coll.toArray() ); } ! public static int[] toIntArray(java.util.Collection coll) { ! Iterator iter = coll.iterator(); ! int[] arr = new int[ coll.size() ]; int i=0; while( iter.hasNext() ) { |