Class Entity

java.lang.Object
org.miaixz.bus.core.basic.entity.Entity
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
OAuth2

public class Entity extends Object implements Serializable
Entity 实体
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Field Details

    • id

      protected String id
      数据主键
  • Constructor Details

    • Entity

      public Entity()
  • Method Details

    • isPKNotNull

      public <T> boolean isPKNotNull(T entity, String field)
      根据主键属性,判断主键是否值为空
      Type Parameters:
      T - 对象
      Parameters:
      entity - 反射对象
      field - 属性
      Returns:
      主键为空, 则返回false;主键有值,返回true
    • getValue

      public <T> Object getValue(T entity, String field)
      依据对象的属性获取对象值
      Type Parameters:
      T - 对象
      Parameters:
      entity - 反射对象
      field - 属性数组
      Returns:
      返回对象属性值
    • setValue

      public <T> void setValue(T entity, String[] fields, Object[] value)
      依据对象的属性数组和值数组对进行赋值
      Type Parameters:
      T - 对象
      Parameters:
      entity - 反射对象
      fields - 属性数组
      value - 值数组