diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanProperty.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanProperty.java index 58fa8227a..d0ea03299 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanProperty.java +++ b/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanProperty.java @@ -181,16 +181,6 @@ public class BeanProperty implements ElPropertyValue { */ final Map extraAttributeMap; - /** - * The method used to read the property. - */ - final Method readMethod; - - /** - * The method used to write the property. - */ - final Method writeMethod; - /** * Generator for insert or update timestamp etc. */ @@ -290,8 +280,6 @@ public class BeanProperty implements ElPropertyValue { this.embedded = deploy.isEmbedded(); this.id = deploy.isId(); this.generatedProperty = deploy.getGeneratedProperty(); - this.readMethod = deploy.getReadMethod(); - this.writeMethod = deploy.getWriteMethod(); this.getter = deploy.getGetter(); this.setter = deploy.getSetter(); @@ -382,8 +370,6 @@ public class BeanProperty implements ElPropertyValue { this.embedded = source.isEmbedded(); this.id = source.isId(); this.generatedProperty = source.getGeneratedProperty(); - this.readMethod = source.getReadMethod(); - this.writeMethod = source.getWriteMethod(); this.getter = source.getter; this.setter = source.setter; this.extraAttributeMap = source.extraAttributeMap; @@ -609,20 +595,6 @@ public class BeanProperty implements ElPropertyValue { return indexName; } - /** - * Return the getter method. - */ - public Method getReadMethod() { - return readMethod; - } - - /** - * Return the setter method. - */ - public Method getWriteMethod() { - return writeMethod; - } - /** * Return true if this object is part of an inheritance hierarchy. */ diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanPropertyCompoundRoot.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanPropertyCompoundRoot.java index d496c7563..2e916cf64 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanPropertyCompoundRoot.java +++ b/src/main/java/com/avaje/ebeaninternal/server/deploy/BeanPropertyCompoundRoot.java @@ -17,18 +17,11 @@ import com.avaje.ebeaninternal.server.type.CtCompoundProperty; * scalar properties match to DB columns and the non-scalar ones are here solely * to support EL expression language for nested compound types. *

- * - * @author rbygrave */ public class BeanPropertyCompoundRoot { private final BeanPropertySetter setter; - /** - * The method used to write the property. - */ - private final Method writeMethod; - private final String name; private final String fullBeanName; @@ -42,7 +35,6 @@ public class BeanPropertyCompoundRoot { this.fullBeanName = deploy.getFullBeanName(); this.name = deploy.getName(); this.setter = deploy.getSetter(); - this.writeMethod = deploy.getWriteMethod(); this.propList = new ArrayList(); this.propMap = new LinkedHashMap(); } @@ -75,13 +67,7 @@ public class BeanPropertyCompoundRoot { */ public void setRootValue(EntityBean bean, Object value) { try { - if (bean instanceof EntityBean) { - setter.set(bean, value); - } else { - Object[] args = new Object[1]; - args[0] = value; - writeMethod.invoke(bean, args); - } + setter.set(bean, value); } catch (Exception ex) { String beanType = bean == null ? "null" : bean.getClass().getName(); String msg = "set " + name + " with arg[" + value + "] on ["+fullBeanName+"] with type[" + beanType + "] threw error"; @@ -94,13 +80,7 @@ public class BeanPropertyCompoundRoot { */ public void setRootValueIntercept(EntityBean bean, Object value) { try { - if (bean instanceof EntityBean) { - setter.setIntercept(bean, value); - } else { - Object[] args = new Object[1]; - args[0] = value; - writeMethod.invoke(bean, args); - } + setter.setIntercept(bean, value); } catch (Exception ex) { String beanType = bean == null ? "null" : bean.getClass().getName(); String msg = "setIntercept " + name + " arg[" + value + "] on ["+fullBeanName+"] with type[" + beanType + "] threw error";