接口 IdEntityService<T extends Serializable>

类型参数:
T - 实体类型
所有超级接口:
EntityService<T>, ExtService<T>
所有已知子接口:
IdNameEntityService<T>

public interface IdEntityService<T extends Serializable> extends EntityService<T>
作者:
Kerbores(kerbores@gmail.com)
  • 方法详细资料

    • fetch

      default T fetch(long id)
      根据@Id所在的属性的值获取一个实体对象
      参数:
      id - 属性的值
      返回:
      实体对象,如不存在则返回null
    • delete

      default int delete(long id)
      根据@Id所在的属性的值删除一个实体对象
      参数:
      id - 属性的值
      返回:
      删除的记录数, 通常是0或者1
    • getMaxId

      default int getMaxId()
      根据@Id所在的属性在数据库中的最大值
      返回:
      最大值,若数据库中没有数据,会抛出空指针异常
    • exists

      default boolean exists(long id)
      是否存在@Id所在属性的值为指定值的记录
      参数:
      id - 属性的值
      返回:
      true,如果存在的话