Package 

Class BeanProxy.BeanInstance

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final BeanProxy.BeanInstance<B> setProperty(String db_field_name, Object value) 设置一个属性,该方法不会自动转换value的类型。如代理对象的idLong或者Int类型,现在有一个BigDecimal类型的值,如何将这个BigDecimal设置到id上呢?参考如下代码:
      BeanInstance<Object> instance = BeanProxy.fromBean(bean);
      String field_name = "id";
      
      Object typedValue = new ObjectMapper().convertValue(value, instance.getPropertyType(field_name));
      instance.setProperty(field_name, typedValue);
      final Object getProperty(String db_field_name) get
      final Class<?> getPropertyType(String db_field_name) 获取某属性的类型
      final B toBean() 获取bean
      final Class<B> getBeanType() 获取bean的类型
      final ClassParser.ParsedClass getParsedClass()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setProperty

         final BeanProxy.BeanInstance<B> setProperty(String db_field_name, Object value)

        设置一个属性,该方法不会自动转换value的类型。

        如代理对象的idLong或者Int类型,现在有一个BigDecimal类型的值,如何将这个BigDecimal设置到id上呢?

        参考如下代码:

        BeanInstance<Object> instance = BeanProxy.fromBean(bean);
        String field_name = "id";
        
        Object typedValue = new ObjectMapper().convertValue(value, instance.getPropertyType(field_name));
        instance.setProperty(field_name, typedValue);
      • toBean

         final B toBean()

        获取bean