+
+ /**
+ * Some "setter" for a value in given Storeable instance and target class
+ *
+ * @param instance An instance of a Storeable class
+ * @param targetClass The target class (where the field resides)
+ * @param columnName Column name (= field name)
+ * @param value Value to set
+ * @throws java.lang.NoSuchMethodException If the setter is not found
+ * @throws java.lang.IllegalAccessException If the setter cannot be accessed
+ * @throws java.lang.reflect.InvocationTargetException Any other problem?
+ */
+ protected void setValueInStoreableFromColumn (final Storeable instance, final String targetClass, final String columnName, final String value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ // Trace message
+ this.getLogger().trace("instance=" + instance + ",targetClass=" + targetClass + ",columnName=" + columnName + ",value=" + value + " - CALLED!");
+
+ // A '$' means not our field
+ if (columnName.startsWith("$")) {
+ // Don't handle these
+ throw new IllegalArgumentException("columnsName contains $");
+ }
+
+ // Determine if the given column is boolean
+ if (this.isBooleanField(instance, targetClass, columnName)) {
+ // Debug message
+ this.getLogger().debug("Column " + columnName + " represents a boolean field.");
+
+ // Yes, then call other method
+ this.setBooleanField(instance, targetClass, this.convertColumnNameToSetterMethod(columnName), Boolean.parseBoolean(value));
+ }
+
+ // Convert column name to field name
+ String methodName = this.convertColumnNameToSetterMethod(columnName);
+
+ // Debug message
+ this.getLogger().debug(MessageFormat.format("methodName={0}", methodName));
+
+ // Get field
+ this.setField(instance, targetClass, methodName, value);
+
+ // Trace message
+ this.getLogger().trace("EXIT!");
+ }
+
+ /**
+ * Some "getter" for a value from given Storeable instance and target class
+ *
+ * @param instance An instance of a Storeable class
+ * @param targetClass The target class (where the field resides)
+ * @param columnName Column name (= field name)
+ * @return value Value to get
+ * @throws java.lang.NoSuchMethodException If the getter was not found
+ * @throws java.lang.IllegalAccessException If the getter cannot be accessed
+ * @throws java.lang.reflect.InvocationTargetException Some other problems?
+ */
+ protected Object getValueInStoreableFromColumn (final Storeable instance, final String targetClass, final String columnName) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("instance={0},targetClass={1},columnName={2} - CALLED!", instance, targetClass, columnName));
+
+ // A '$' means not our field
+ if (columnName.startsWith("$")) {
+ // Don't handle these
+ throw new IllegalArgumentException("columnsName contains $");
+ }
+
+ // Determine if the given column is boolean
+ if (this.isBooleanField(instance, targetClass, columnName)) {
+ // Debug message
+ this.getLogger().debug("Column " + columnName + " represents a boolean field.");
+
+ // Yes, then call other method
+ return this.getBooleanField(instance, targetClass, this.convertColumnNameToGetterMethod(columnName, true));
+ }
+
+ // Convert column name to field name
+ String methodName = this.convertColumnNameToGetterMethod(columnName, false);
+
+ // Debug message
+ this.getLogger().debug(MessageFormat.format("methodName={0}", methodName));
+
+ // Get field
+ Object value = this.getField(instance, targetClass, methodName);
+
+ // Trace message
+ this.getLogger().trace("value=" + value + " - EXIT!");
+
+ // Return value
+ return value;
+ }