src/org/nutz/service/IdEntityService.java
public boolean exists(long id) {
        EntityField ef = getEntity().getIdField();
        if (null == ef)
            return false;
        return dao().count(getEntityClass(), Cnd.where(ef.getName(), "=", id)) > 0;
    }
public boolean exists(long id) {
        EntityField ef = getEntity().getIdField();
        if (null == ef)
            return false;
        return dao().count(getEntityClass(), Cnd.where(ef.getName(), "=", id)) > 0;
    }
public boolean exists ( long id ) { EntityField ef = getEntity ( ) . getIdField ( ) ; if ( null == ef ) return false ; return dao ( ) . count ( getEntityClass ( ) , Cnd . where ( ef . getName ( ) , "=" , id ) ) > 0 ; }
是否存在@Id所在属性的值为指定值的记录
@param id 属性的值
@return true,如果存在的话
是否存在