接口 BaseService<T>

所有已知子接口:
ActivityBasicScopeService, ActivityBudgetApplyStatisticsService, ActivityBudgetQueryStatisticsService, ActivityBudgetService, ActivityCultureApplyUserService, ActivityCultureService, ActivityDeclareService, ActivityReimbursementSchoolUnionService, ActivityReimbursementService, ActivitySportsApplyUserService, ActivitySportsService, AlipayService, ArticleAnalysisService, ArticleService, AssetDepreciationRecordService, AssetService, AssetStocktakingService, BenefitAddressService, BenefitGoodsCartService, BenefitGoodsCategoryService, BenefitGoodsOrderService, BenefitGoodsService, BenefitGoodsSpecificationsService, BenefitProjectService, BenefitStatisticsService, BenefitUserSelectionListService, BenefitUserSelectionMineService, BenefitUserSelectionService, BenefitUserService, BirthdayWishesService, BlessingService, BpmProcessDefineService, BpmProcessInstanceService, BuildHomeActService, BuildHomeKpiPlanService, BuildHomeKpiWriteService, CadreTrainingActService, CadreTrainingSignUpService, CheckTaskCommonService, ChildManageService, ClothingService, ClubUserJoinService, CommentBzService, CommentNrService, CommentPeoService, CommentStatisticsService, CommentZbService, CommonService, CondolenceService, CondolenceTypeService, ContributionApplyService, ContributionTypeService, DifficultHelpCommonService, DsznfmtxService, EduCoursesService, EduStudyRecordsService, EnrollmentRegistrationSummaryService, EvaluateActivityService, EvaluateService, ExcellentRecuperationLineService, ExcellentRecuperationSummaryService, ExcellentRecuperationTravelAgencyService, ExecutiveCommitteeConfigService, ExecutiveCommitteeMemberService, ExerciseCardService, FamilyActivityService, FamilyActivityStatisticsService, FamilyBlackListService, FellowshipActivityService, FellowshipActivityStatisticsService, FellowshipBlackListService, FitnessWalkCommonService, FitnessWalkPunchStatisticsService, FitnessWalkStepRaffleService, FundMemberChangeRecordService, FundMemberService, FundSubsidyService, GlobalMessageService, GrassrootsCongressMeetingService, GrassrootsCongressService, GuildHallMeetingService, GuildHallService, HealthCheckupProjectService, HealthCheckupSingleService, HonorApplyService, HonorCommonService, HuiminService, IntegralDetailService, IntegralInsertTaskOrSelectConfigService, IntegralManageService, KhBzService, KhNrService, KhXghshService, KhZbService, KhzpService, LeadThoughtInfoService, LegalApplyService, LegalDoctorService, LiteracyActivityService, LiteracyActivityStatisticsService, LiteracyBlackListService, MallCategoryService, MallGoodsService, MallGoodsSkuService, MaternityLeaveService, MeetingInfoService, MeetingOnlineService, MeetingTypeService, MeetingUserService, MemberApplyRecordService, MemberBranchUnionManageService, MemberCheckTaskService, MemberCommonService, MemberInfoService, MemberListVerificationService, MemberModelWorkerService, MemberPaymentService, MemberSchoolUnionManageService, MemberStatisticsService, MutualInsuranceProjectService, MutualInsuranceUserService, OutlayReimburseApplyService, OutlayReimburseSummaryService, OutlayUseDetailService, ProcessDefineService, ProcessDesignHisService, ProcessDesignService, ProcessInstanceService, ProcessSurrogateService, ProcessTaskActorService, ProcessTaskService, ProposalCommitteeFilingService, ProposalCommitteeFilingUnitService, ProposalCommonService, ProposalDelegationService, ProposalExportService, ProposalFeedbackEvaluationService, ProposalSchoolLeaderApprovalService, ProposalSecondedService, ProposalUnderTakeReplyService, ProposalWriteService, PsychologyApplyService, PsychologyDoctorService, QsvActivityService, QsvBankService, QsvQuizRankService, QsvQuizService, QsvSurveyService, QsvUserAnswerRecordService, RecuperationAuditService, RecuperationBaseManagerService, RecuperationEnrollService, RecuperationLineSelectService, RecuperationLineService, RecuperationTravelAgencyService, RestActService, RestActSignUpService, RetireSouvenirsBatchService, RetireSouvenirsLedgerService, SingleTeacherService, SiteApplyService, SiteInfoService, SiteTypeService, SpecialStaffManageService, SuggestionBoxService, SuggestionCommitteeFilingService, SuggestionCommitteeFilingUnitService, SuggestionCommonService, SuggestionDelegationService, SuggestionExportService, SuggestionSchoolLeaderApprovalService, SuggestionSecondedService, SuggestionUnderTakeReplyService, SuggestionWriteService, SysApiService, SysAppConfService, SysAppListService, SysAppTaskService, SysClubEvaluateService, SysClubExamineService, SysClubInfoManageService, SysClubService, SysClubUserService, SysConfigService, SysDataDictPullService, SysDataUnitPullService, SysDataUserPullService, SysDictService, SysFileService, SysHomeActivityService, SysLogService, SysMenuService, SysMsgService, SysMsgUserService, SysMsgUserSummaryService, SysOfficeTemplateService, SysRoleService, SysRouteService, SysTaskService, SysUnionGroupService, SysUnionService, SysUnitService, SysUserService, TeacherCongressDashBoardService, TeacherCongressDelegatePushService, TeacherCongressDelegateService, TeacherCongressInstitutionService, TeacherCongressInstitutionUserService, TeacherCongressSessionService, ThirtyTeachService, TrainSignUpActivityService, TrainSignUpActivityStatisticsService, TrainSignUpBlackListService, UnionReimburseService, WelfareListService, WelfareListSummaryService, WelfareProjectService, WelfareSelectionSituationService, WelfareSingleService, WelfareStatisticsService, WomanSanitaryProjectService, WomanSanitaryUserService, WorkerCongressDelegateService, WorkerCongressSessionService, WorkersHomeApplyService, WorkersHomeInfoService, YearPlanService, YearSummaryService
所有已知实现类:
ActivityBasicScopeServiceImpl, ActivityBudgetApplyStatisticsServiceImpl, ActivityBudgetQueryStatisticsServiceImpl, ActivityBudgetServiceImpl, ActivityCultureApplyUserServiceImpl, ActivityCultureServiceImpl, ActivityDeclareServiceImpl, ActivityReimbursementSchoolUnionServiceImpl, ActivityReimbursementServiceImpl, ActivitySportsApplyUserServiceImpl, ActivitySportsServiceImpl, AlipayNewServiceImpl, ArticleAnalysisServiceImpl, ArticleServiceImpl, AssetDepreciationRecordServiceImpl, AssetServiceImpl, AssetStocktakingServiceImpl, BaseServiceImpl, BenefitAddressServiceImpl, BenefitGoodsCartServiceImpl, BenefitGoodsCategoryServiceImpl, BenefitGoodsOrderServiceImpl, BenefitGoodsServiceImpl, BenefitGoodsSpecificationsServiceImpl, BenefitProjectServiceImpl, BenefitStatisticsServiceImpl, BenefitUserSelectionListServiceImpl, BenefitUserSelectionMineServiceImpl, BenefitUserSelectionServiceImpl, BenefitUserServiceImpl, BirthdayWishesServiceImpl, BlessingServiceImpl, BpmProcessDefineServiceImpl, BpmProcessInstanceServiceImpl, BuildHomeActServiceImpl, BuildHomeKpiPlanServiceImpl, BuildHomeKpiWriteServiceImpl, CadreTrainingActServiceImpl, CadreTrainingSignUpServiceImpl, CheckTaskCommonServiceImpl, ChildManageServiceImpl, ClothingServiceImpl, ClubUserJoinServiceImpl, CommentBzServiceImpl, CommentNrServiceImpl, CommentPeoServiceImpl, CommentStatisticsServiceImpl, CommentZbServiceImpl, CommonServiceImpl, CondolenceServiceImpl, CondolenceTypeServiceImpl, ContributionApplyServiceImpl, ContributionTypeServiceImpl, DifficultHelpCommonServiceImpl, DsznfmtxServiceImpl, EduCoursesServiceImpl, EduStudyRecordsServiceImpl, EnrollmentRegistrationSummaryServiceImpl, EvaluateActivityServiceImpl, EvaluateServiceImpl, ExcellentRecuperationLineServiceImpl, ExcellentRecuperationSummaryServiceImpl, ExcellentRecuperationTravelAgencyServiceImpl, ExecutiveCommitteeConfigServiceImpl, ExecutiveCommitteeMemberServiceImpl, ExerciseCardServiceImpl, FamilyActivityServiceImpl, FamilyActivityStatisticsServiceImpl, FamilyUserServiceImpl, FellowshipActivityServiceImpl, FellowshipActivityStatisticsServiceImpl, FellowshipUserServiceImpl, FitnessWalkCommonServiceImpl, FitnessWalkPunchStatisticsServiceImpl, FitnessWalkStepRaffleServiceImpl, FundMemberChangeRecordServiceImpl, FundMemberServiceImpl, FundSubsidyServiceImpl, GlobalMessageServiceImpl, GrassrootsCongressMeetingServiceImpl, GrassrootsCongressServiceImpl, GuildHallMeetingServiceImpl, GuildHallServiceImpl, HealthCheckupProjectServiceImpl, HealthCheckupSingleServiceImpl, HonorApplyServiceImpl, HonorCommonServiceImpl, HuiminServiceImpl, IntegralDetailServiceImpl, IntegralInsertTaskOrSelectConfigServiceImpl, IntegralManageServiceImpl, KhBzServiceImpl, KhNrServiceImpl, KhXghshServiceImpl, KhZbServiceImpl, KhzpServiceImpl, LeadThoughtInfoServiceImpl, LegalApplyServiceImpl, LegalDoctorServiceImpl, LiteracyActivityServiceImpl, LiteracyActivityStatisticsServiceImpl, LiteracyUserServiceImpl, MallCategoryServiceImpl, MallGoodsServiceImpl, MallGoodsSkuServiceImpl, MaternityLeaveServiceImpl, MeetingInfoServiceImpl, MeetingOnlineServiceImpl, MeetingTypeServiceImpl, MeetingUserServiceImpl, MemberApplyRecordServiceImpl, MemberBranchUnionManageServiceImpl, MemberCheckTaskServiceImpl, MemberInfoServiceImpl, MemberListVerificationServiceImpl, MemberManageServiceImpl, MemberModelWorkerServiceImpl, MemberPaymentServiceImpl, MemberSchoolUnionManageServiceImpl, MemberStatisticsServiceImpl, MutualInsuranceProjectServiceImpl, MutualInsuranceUserServiceImpl, OutlayReimburseApplyServiceImpl, OutlayReimburseSummaryServiceImpl, OutlayUseDetailServiceImpl, ProcessDefineServiceImpl, ProcessDesignHisServiceImpl, ProcessDesignServiceImpl, ProcessInstanceServiceImpl, ProcessSurrogateServiceImpl, ProcessTaskActorServiceImpl, ProcessTaskServiceImpl, ProposalCommitteeFilingServiceImpl, ProposalCommitteeFilingUnitServiceImpl, ProposalCommonServiceImpl, ProposalDelegationServiceImpl, ProposalExportServiceImpl, ProposalFeedbackEvaluationServiceImpl, ProposalSchoolLeaderApprovalServiceImpl, ProposalSecondedServiceImpl, ProposalUnderTakeReadServiceImpl, ProposalUnderTakeReplyServiceImpl, ProposalWriteServiceImpl, PsychologyApplyServiceImpl, PsychologyDoctorServiceImpl, QsvActivityServiceImpl, QsvBankServiceImpl, QsvQuizRankServiceImpl, QsvQuizServiceImpl, QsvSurveyServiceImpl, QsvUserAnswerRecordServiceImpl, RecuperationAuditServiceImpl, RecuperationBaseManagerServiceImpl, RecuperationEnrollServiceImpl, RecuperationLineSelectServiceImpl, RecuperationLineServiceImpl, RecuperationTravelAgencyServiceImpl, RestActServiceImpl, RestActSignUpServiceImpl, RetireSouvenirsBatchServiceImpl, RetireSouvenirsLedgerServiceImpl, SingleTeacherServiceImpl, SiteApplyServiceImpl, SiteInfoServiceImpl, SiteTypeServiceImpl, SpecialStaffManageServiceImpl, SuggestionBoxServiceImpl, SuggestionCommitteeFilingServiceImpl, SuggestionCommitteeFilingUnitServiceImpl, SuggestionCommonServiceImpl, SuggestionDelegationServiceImpl, SuggestionExportServiceImpl, SuggestionSchoolLeaderApprovalServiceImpl, SuggestionSecondedServiceImpl, SuggestionUnderTakeReadServiceImpl, SuggestionUnderTakeReplyServiceImpl, SuggestionWriteServiceImpl, SysApiServiceImpl, SysAppConfServiceImpl, SysAppListServiceImpl, SysAppTaskServiceImpl, SysClubEvaluateServiceImpl, SysClubExamineServiceImpl, SysClubInfoManageServiceImpl, SysClubServiceImpl, SysClubUserServiceImpl, SysConfigServiceImpl, SysDataDictPullServiceImpl, SysDataUnitPullServiceImpl, SysDataUserPullServiceImpl, SysDictServiceImpl, SysFileServiceImpl, SysHomeActivityServiceImpl, SysLogServiceImpl, SysMenuServiceImpl, SysMsgServiceImpl, SysMsgUserServiceImpl, SysMsgUserSummaryServiceImpl, SysOfficeTemplateServiceImpl, SysRoleServiceImpl, SysRouteServiceImpl, SysTaskServiceImpl, SysUnionGroupServiceImpl, SysUnionServiceImpl, SysUnitServiceImpl, SysUserServiceImpl, TeacherCongressDashBoardServiceImpl, TeacherCongressDelegatePushServiceImpl, TeacherCongressDelegateServiceImpl, TeacherCongressInstitutionServiceImpl, TeacherCongressInstitutionUserServiceImpl, TeacherCongressSessionServiceImpl, ThirtyTeachServiceImpl, TrainSignUpActivityServiceImpl, TrainSignUpActivityStatisticsServiceImpl, TrainSignUpUserServiceImpl, UnionReimburseServiceImpl, WelfareListServiceImpl, WelfareListSummaryServiceImpl, WelfareProjectServiceImpl, WelfareSelectionSituationServiceImpl, WelfareSingleServiceImpl, WelfareStatisticsServiceImpl, WomanSanitaryProjectServiceImpl, WomanSanitaryUserServiceImpl, WorkerCongressDelegateServiceImpl, WorkerCongressSessionServiceImpl, WorkersHomeApplyServiceImpl, WorkersHomeInfoServiceImpl, YearPlanServiceImpl, YearSummaryServiceImpl

public interface BaseService<T>
Created by wizzer on 2016/12/22.
  • 方法概要

    修饰符和类型
    方法
    说明
    int
    清空表
    int
    clear(String tableName)
    清空表
    int
    clear(String tableName, org.nutz.dao.Condition cnd)
    按条件清除一组数据
    int
    clear(org.nutz.dao.Condition cnd)
    按条件清除一组数据
    int
    统计对象表条数
    int
    count(String tableName)
    统计表记录条数
    int
    count(String tableName, org.nutz.dao.Condition cnd)
    统计符合条件的记录条数
    int
    count(org.nutz.dao.Condition cnd)
    统计符合条件的对象表条数
    int
    count(org.nutz.dao.sql.Sql sql)
    自定义SQL统计
    org.nutz.dao.Dao
    dao()
     
    org.nutz.lang.util.NutMap
    data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, org.nutz.dao.Cnd cnd, String linkName)
    DataTable Page
    org.nutz.lang.util.NutMap
    data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, org.nutz.dao.Cnd cnd, String linkName, org.nutz.dao.Cnd subCnd)
    DataTable Page
    org.nutz.lang.util.NutMap
    data(int length, int start, int draw, org.nutz.dao.Cnd cnd, String linkName)
    DataTable Page
    org.nutz.lang.util.NutMap
    data(int length, int start, int draw, org.nutz.dao.sql.Sql countSql, org.nutz.dao.sql.Sql orderSql)
    DataTable Page 自定义SQL
    org.nutz.lang.util.NutMap
    data(int length, int start, int draw, org.nutz.dao.sql.Sql countSql, org.nutz.dao.sql.Sql orderSql, boolean countOnly)
    DataTable Page 自定义SQL
    int
    delete(int id)
    通过int主键删除数据
    int
    delete(long id)
    通过long主键删除数据
    void
    delete(Integer[] ids)
    批量删除
    void
    delete(Long[] ids)
    批量删除
    int
    通过string主键删除数据
    void
    delete(String[] ids)
    批量删除
    void
    批量删除
    org.nutz.dao.sql.Sql
    execute(org.nutz.dao.sql.Sql sql)
    执行一条自定义SQL
    boolean
    exists(Object... pks)
    复合主键专用
    <T> T
    fastInsert(T obj)
    快速插入一个对象,对象的 '@Prev' 以及 '@Next' 在这个函数里不起作用
    fetch(long id)
    通过数字型主键查询对象
    通过字符型主键查询对象
    fetch(org.nutz.dao.Condition cnd)
    查出符合条件的第一条记录
    <T> T
    fetchLinks(T obj, String regex)
    查询关联表
    <T> T
    fetchLinks(T obj, String regex, org.nutz.dao.Condition cnd)
    查询关联表
    org.nutz.lang.util.NutMap
    fetchMap(org.nutz.dao.sql.Sql sql)
    获取Map
    <C> C
    fetchVO(org.nutz.dao.sql.Sql sql, Class<C> clazz)
    自定义SQL查询VO对象
    fetchx(Object... pks)
    复合主键专用
    org.nutz.dao.entity.Entity<T>
    获取实体的Entity
    获取实体类型
    getField(String fieldName, int id)
    通过INT主键获取部分字段值
    getField(String fieldName, long id)
    通过LONG主键获取部分字段值
    getField(String fieldName, String name)
    通过NAME主键获取部分字段值
    getField(String fieldName, org.nutz.dao.Condition cnd)
    通过条件获取部分字段值
    getMap(org.nutz.dao.sql.Sql sql)
    自定义sql获取map key-value
    int
    获取某个对象,最大的 ID 值,这个对象必须声明了 '@Id'
    org.nutz.lang.util.NutMap
    getNutMap(org.nutz.dao.sql.Sql sql)
    自定义sql获取NutMap key-value
    获取TREEID父级
    getSubPath(String tableName, String colName, String value)
    计算子节点TREEID
    void
    insert(String tableName, org.nutz.dao.Chain chain)
    自由的向一个数据表插入一条数据
    <T> T
    insert(T obj)
    将一个对象插入到一个数据库
    <T> T
    insert(T obj, org.nutz.dao.FieldFilter filter)
    将一个对象按FieldFilter过滤后,插入到一个数据源。
    <T> T
    insertLinks(T obj, String regex)
    根据一个正则表达式,仅将对象所有的关联字段插入到数据库中,并不包括对象本身
    <T> T
    根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
    <T> T
    insertOrUpdate(T obj, org.nutz.dao.FieldFilter insertFieldFilter, org.nutz.dao.FieldFilter updateFieldFilter)
    根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
    <T> T
    insertRelation(T obj, String regex)
    将对象的一个或者多个,多对多的关联信息,插入数据表
    <T> T
    insertWith(T obj, String regex)
    将对象插入数据库同时,也将符合一个正则表达式的所有关联字段关联的对象统统插入相应的数据库
    List<org.nutz.dao.entity.Record>
    list(org.nutz.dao.sql.Sql sql)
    自定义SQL返回Record记录集,Record是个MAP但不区分大小写 别返回Map对象,因为MySql和Oracle中字段名有大小写之分
    listEntity(org.nutz.dao.sql.Sql sql)
    自定义查询,并返回当前实体类对象
    List<org.nutz.lang.util.NutMap>
    listMap(org.nutz.dao.sql.Sql sql)
    自定义SQL返回NutMap记录集,区分大小写
    <C> Pagination<C>
    listPage(Integer pageNumber, int pageSize, Class<C> clazz, org.nutz.dao.Condition cnd)
    分页 只要你的class是实体类 就是标注了@Table 就可以不写service 直接用这个
    listPage(Integer pageNumber, int pageSize, String tableName, org.nutz.dao.Condition cnd)
    分页查询(tabelName)
    listPage(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd)
    分页查询(cnd)
    listPage(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String fieldName)
    分页查询,获取部分字段(cnd)
    listPage(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql)
    分页查询(sql)
    listPage(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
    分页查询
    listPage(Integer pageNumber, String tableName, org.nutz.dao.Condition cnd)
    分页查询
    listPage(Integer pageNumber, org.nutz.dao.Condition cnd)
    分页查询
    listPage(Integer pageNumber, org.nutz.dao.sql.Sql sql)
    分页查询
    listPage(Integer pageNumber, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
    分页查询
    listPageLinks(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String linkName)
    关联查询
    listPageLinks(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition subCnd)
    关联查询,带子查询条件
    listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd)
    分页查询并返回包含实体类内容的NutMap对象
    listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql)
    分页查询(sql)
    listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
    分页查询
    listPageMap(Integer pageNumber, org.nutz.dao.Condition cnd)
    分页查询并返回包含实体类内容的NutMap对象
    listPageMap(Integer pageNumber, org.nutz.dao.sql.Sql sql)
    分页查询
    listPageMap(Integer pageNumber, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
    分页查询
    <C> Pagination<C>
    listPageVO(PageForm pageForm, org.nutz.dao.sql.Sql sql, Class<C> clazz)
    自定义分页sql 返回自定义类型
    <C> List<C>
    listVO(org.nutz.dao.sql.Sql sql, Class<C> clazz)
    自定义sql 返回自定义类型
    获取全部数据
    query(String linkName)
    获取表及关联表全部数据
    org.nutz.lang.util.NutMap
    query(String tableName, String keyColumnName, String valueColumnName, org.nutz.dao.Condition cnd)
    查询获取NutMap对象
    org.nutz.lang.util.NutMap
    query(String keyColumnName, String valueColumnName, org.nutz.dao.Condition cnd)
    查询获取NutMap对象
    query(String fieldName, org.nutz.dao.Condition cnd)
    查询获取部分字段
    query(org.nutz.dao.Condition cnd)
    查询一组对象。
    query(org.nutz.dao.Condition cnd, String linkName)
     
    query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition linkCnd)
    获取表及关联表全部数据(支持子查询)
    query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition linkCnd, org.nutz.dao.pager.Pager pager)
    分页关联字段查询(支持关联条件)
    query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.pager.Pager pager)
    分页关联字段查询
    query(org.nutz.dao.Condition cnd, org.nutz.dao.pager.Pager pager)
    分页查询
    int
    更新数据
    int
    update(String tableName, org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
    部分更新表
    int
    update(org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
    部分更新实体表
    int
    updateAndIncrIfMatch(Object obj, org.nutz.dao.FieldFilter fieldFilter, String fieldName)
    乐观锁, 以特定字段的值作为限制条件,更新对象,并自增该字段.
    int
    更新数据忽略值为null的字段
    <T> T
    updateLinks(T obj, String regex)
    根据一个正则表达式,仅更新对象所有的关联字段,并不包括对象本身
    int
    updateRelation(Class<?> classOfT, String regex, org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
    多对多关联是通过一个中间表将两条数据表记录关联起来。
    <T> T
    updateWith(T obj, String regex)
    将对象更新的同时,也将符合一个正则表达式的所有关联字段关联的对象统统更新
    int
    基于版本的更新,版本不一样无法更新到数据
    int
    updateWithVersion(Object obj, org.nutz.dao.FieldFilter filter)
    基于版本的更新,版本不一样无法更新到数据
    int
    伪删除
    int
    vDelete(String[] ids)
    批量伪删除
    int
    vDelete(String tableName, org.nutz.dao.Condition cnd)
    根据条件进行伪删除
    int
    批量伪删除
    int
    vDelete(org.nutz.dao.Condition cnd)
    根据条件进行伪删除
  • 方法详细资料

    • dao

      org.nutz.dao.Dao dao()
    • getEntity

      org.nutz.dao.entity.Entity<T> getEntity()
      获取实体的Entity
      返回:
      实体的Entity
    • getEntityClass

      Class<T> getEntityClass()
      获取实体类型
      返回:
      实体类型
    • count

      int count(org.nutz.dao.Condition cnd)
      统计符合条件的对象表条数
      参数:
      cnd -
      返回:
    • count

      int count()
      统计对象表条数
      返回:
    • count

      int count(String tableName, org.nutz.dao.Condition cnd)
      统计符合条件的记录条数
      参数:
      tableName -
      cnd -
      返回:
    • count

      int count(String tableName)
      统计表记录条数
      参数:
      tableName -
      返回:
    • count

      int count(org.nutz.dao.sql.Sql sql)
      自定义SQL统计
      参数:
      sql -
      返回:
    • fetch

      T fetch(long id)
      通过数字型主键查询对象
      参数:
      id -
      返回:
    • fetchVO

      <C> C fetchVO(org.nutz.dao.sql.Sql sql, Class<C> clazz)
      自定义SQL查询VO对象
      类型参数:
      C -
      参数:
      sql -
      clazz -
      返回:
      味大无需多盐
    • fetch

      T fetch(String id)
      通过字符型主键查询对象
      参数:
      id -
      返回:
    • fetchLinks

      <T> T fetchLinks(T obj, String regex)
      查询关联表
      参数:
      obj - 数据对象,可以是普通对象或集合,但不是类
      regex - 为null查询全部,支持通配符 ^(a|b)$
      返回:
    • fetchLinks

      <T> T fetchLinks(T obj, String regex, org.nutz.dao.Condition cnd)
      查询关联表
      参数:
      obj - 数据对象,可以是普通对象或集合,但不是类
      regex - 为null查询全部,支持通配符 ^(a|b)$
      cnd - 关联字段的过滤(排序,条件语句,分页等)
      返回:
    • fetch

      T fetch(org.nutz.dao.Condition cnd)
      查出符合条件的第一条记录
      参数:
      cnd - 查询条件
      返回:
      实体, 如不存在则为null
    • fetchx

      T fetchx(Object... pks)
      复合主键专用
      参数:
      pks - 键值
      返回:
      对象 T
    • exists

      boolean exists(Object... pks)
      复合主键专用
      参数:
      pks - 键值
      返回:
      对象 T
    • insert

      <T> T insert(T obj)
      将一个对象插入到一个数据库
      参数:
      obj - 要被插入的对象 它可以是: 普通 POJO 集合 数组 Map 注意:如果是集合,数组或者 Map,所有的对象必须类型相同,否则可能会出错
      返回:
      插入后的对象
    • insert

      <T> T insert(T obj, org.nutz.dao.FieldFilter filter)
      将一个对象按FieldFilter过滤后,插入到一个数据源。

      dao.insert(pet, FieldFilter.create(Pet.class, FieldMatcher.create(false)));

      参数:
      obj - 要被插入的对象
      filter - 字段过滤器, 其中FieldMatcher.isIgnoreId生效
      返回:
      插入后的对象
      另请参阅:
      • Dao.insert(Object)
    • insertOrUpdate

      <T> T insertOrUpdate(T obj)
      根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
      参数:
      obj - 对象
      返回:
      原对象
    • insertOrUpdate

      <T> T insertOrUpdate(T obj, org.nutz.dao.FieldFilter insertFieldFilter, org.nutz.dao.FieldFilter updateFieldFilter)
      根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
      参数:
      obj - 对象
      insertFieldFilter - 插入时的字段过滤, 可以是null
      updateFieldFilter - 更新时的字段过滤,可以是null
      返回:
      原对象
    • insert

      void insert(String tableName, org.nutz.dao.Chain chain)
      自由的向一个数据表插入一条数据
      参数:
      tableName - 表名
      chain - 数据名值链
    • fastInsert

      <T> T fastInsert(T obj)
      快速插入一个对象,对象的 '@Prev' 以及 '@Next' 在这个函数里不起作用
      参数:
      obj -
      返回:
    • insertWith

      <T> T insertWith(T obj, String regex)
      将对象插入数据库同时,也将符合一个正则表达式的所有关联字段关联的对象统统插入相应的数据库

      关于关联字段更多信息,请参看 '@One' | '@Many' | '@ManyMany' 更多的描述

      参数:
      obj - 数据对象
      regex - 正则表达式,描述了什么样的关联字段将被关注。如果为 null,则表示全部的关联字段都会被插入
      返回:
      数据对象本身
      另请参阅:
      • One
      • Many
      • ManyMany
    • insertLinks

      <T> T insertLinks(T obj, String regex)
      根据一个正则表达式,仅将对象所有的关联字段插入到数据库中,并不包括对象本身
      参数:
      obj - 数据对象
      regex - 正则表达式,描述了什么样的关联字段将被关注。如果为 null,则表示全部的关联字段都会被插入
      返回:
      数据对象本身
      另请参阅:
      • One
      • Many
      • ManyMany
    • insertRelation

      <T> T insertRelation(T obj, String regex)
      将对象的一个或者多个,多对多的关联信息,插入数据表
      参数:
      obj - 对象
      regex - 正则表达式,描述了那种多对多关联字段将被执行该操作
      返回:
      对象自身
      另请参阅:
      • ManyMany
    • update

      int update(Object obj)
      更新数据
      参数:
      obj -
      返回:
    • updateIgnoreNull

      int updateIgnoreNull(Object obj)
      更新数据忽略值为null的字段
      参数:
      obj -
      返回:
    • update

      int update(org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
      部分更新实体表
      参数:
      chain -
      cnd -
      返回:
    • update

      int update(String tableName, org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
      部分更新表
      参数:
      tableName -
      chain -
      cnd -
      返回:
    • updateWith

      <T> T updateWith(T obj, String regex)
      将对象更新的同时,也将符合一个正则表达式的所有关联字段关联的对象统统更新

      关于关联字段更多信息,请参看 '@One' | '@Many' | '@ManyMany' 更多的描述

      参数:
      obj - 数据对象
      regex - 正则表达式,描述了什么样的关联字段将被关注。如果为 null,则表示全部的关联字段都会被更新
      返回:
      数据对象本身
      另请参阅:
      • One
      • Many
      • ManyMany
    • updateLinks

      <T> T updateLinks(T obj, String regex)
      根据一个正则表达式,仅更新对象所有的关联字段,并不包括对象本身
      参数:
      obj - 数据对象
      regex - 正则表达式,描述了什么样的关联字段将被关注。如果为 null,则表示全部的关联字段都会被更新
      返回:
      数据对象本身
      另请参阅:
      • One
      • Many
      • ManyMany
    • updateRelation

      int updateRelation(Class<?> classOfT, String regex, org.nutz.dao.Chain chain, org.nutz.dao.Condition cnd)
      多对多关联是通过一个中间表将两条数据表记录关联起来。

      而这个中间表可能还有其他的字段,比如描述关联的权重等

      这个操作可以让你一次更新某一个对象中多个多对多关联的数据

      参数:
      classOfT - 对象类型
      regex - 正则表达式,描述了那种多对多关联字段将被执行该操作
      chain - 针对中间关联表的名值链。
      cnd - 针对中间关联表的 WHERE 条件
      返回:
      共有多少条数据被更新
      另请参阅:
      • ManyMany
    • updateWithVersion

      int updateWithVersion(Object obj)
      基于版本的更新,版本不一样无法更新到数据
      参数:
      obj - 需要更新的对象, 必须有version属性
      返回:
      若更新成功, 大于0, 否则小于0
    • updateWithVersion

      int updateWithVersion(Object obj, org.nutz.dao.FieldFilter filter)
      基于版本的更新,版本不一样无法更新到数据
      参数:
      obj - 需要更新的对象, 必须有version属性
      filter - 需要过滤的字段设置
      返回:
      若更新成功, 大于0, 否则小于0
    • updateAndIncrIfMatch

      int updateAndIncrIfMatch(Object obj, org.nutz.dao.FieldFilter fieldFilter, String fieldName)
      乐观锁, 以特定字段的值作为限制条件,更新对象,并自增该字段.

      执行的sql如下:

      update t_user set age=30, city="广州", version=version+1 where name="wendal" and version=124;

      参数:
      obj - 需要更新的对象, 必须带@Id/@Name/@Pk中的其中一种.
      fieldFilter - 需要过滤的属性. 若设置了哪些字段不更新,那务必确保过滤掉fieldName的字段
      fieldName - 参考字段的Java属性名.默认是"version",可以是任意数值字段
      返回:
      若更新成功, 返回值大于0, 否则小于等于0
    • getMaxId

      int getMaxId()
      获取某个对象,最大的 ID 值,这个对象必须声明了 '@Id'
      返回:
    • delete

      int delete(long id)
      通过long主键删除数据
      参数:
      id -
      返回:
    • delete

      int delete(int id)
      通过int主键删除数据
      参数:
      id -
      返回:
    • delete

      int delete(String id)
      通过string主键删除数据
      参数:
      id -
      返回:
    • delete

      void delete(Integer[] ids)
      批量删除
      参数:
      ids -
    • delete

      void delete(Long[] ids)
      批量删除
      参数:
      ids -
    • delete

      void delete(String[] ids)
      批量删除
      参数:
      ids -
    • delete

      void delete(List<String> ids)
      批量删除
      参数:
      ids -
    • clear

      int clear()
      清空表
      返回:
    • clear

      int clear(String tableName)
      清空表
      返回:
    • clear

      int clear(org.nutz.dao.Condition cnd)
      按条件清除一组数据
      返回:
    • clear

      int clear(String tableName, org.nutz.dao.Condition cnd)
      按条件清除一组数据
      返回:
    • vDelete

      int vDelete(String id)
      伪删除
      参数:
      id -
      返回:
    • vDelete

      int vDelete(String[] ids)
      批量伪删除
      参数:
      ids -
      返回:
    • vDelete

      int vDelete(List<String> ids)
      批量伪删除
      参数:
      ids -
      返回:
    • vDelete

      int vDelete(org.nutz.dao.Condition cnd)
      根据条件进行伪删除
      参数:
      cnd -
      返回:
    • vDelete

      int vDelete(String tableName, org.nutz.dao.Condition cnd)
      根据条件进行伪删除
      参数:
      cnd -
      返回:
    • getField

      T getField(String fieldName, long id)
      通过LONG主键获取部分字段值
      参数:
      fieldName -
      id -
      返回:
    • getField

      T getField(String fieldName, int id)
      通过INT主键获取部分字段值
      参数:
      fieldName -
      id -
      返回:
    • getField

      T getField(String fieldName, String name)
      通过NAME主键获取部分字段值
      参数:
      fieldName - 支持通配符 ^(a|b)$
      name -
      返回:
    • getField

      T getField(String fieldName, org.nutz.dao.Condition cnd)
      通过条件获取部分字段值
      参数:
      fieldName - 支持通配符 ^(a|b)$
      cnd -
      返回:
    • query

      List<T> query(String fieldName, org.nutz.dao.Condition cnd)
      查询获取部分字段
      参数:
      fieldName - 支持通配符 ^(a|b)$
      cnd -
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd)
      查询一组对象。你可以为这次查询设定条件
      参数:
      cnd - WHERE 条件。如果为 null,将获取全部数据,顺序为数据库原生顺序
      只有在调用这个函数的时候, cnd.limit 才会生效
      返回:
      对象列表
    • query

      List<T> query()
      获取全部数据
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd, String linkName)
      参数:
      cnd - 查询条件
      linkName - 关联字段,支持正则 ^(a|b)$
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition linkCnd)
      获取表及关联表全部数据(支持子查询)
      参数:
      cnd - 查询条件
      linkName - 关联字段,支持正则 ^(a|b)$
      linkCnd - 关联条件
      返回:
    • query

      List<T> query(String linkName)
      获取表及关联表全部数据
      参数:
      linkName - 关联字段,支持正则 ^(a|b)$
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.pager.Pager pager)
      分页关联字段查询
      参数:
      cnd - 查询条件
      linkName - 关联字段,支持正则 ^(a|b)$
      pager - 分页对象
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition linkCnd, org.nutz.dao.pager.Pager pager)
      分页关联字段查询(支持关联条件)
      参数:
      cnd - 查询条件
      linkName - 关联字段,支持正则 ^(a|b)$
      linkCnd - 关联条件
      pager - 分页对象
      返回:
    • query

      List<T> query(org.nutz.dao.Condition cnd, org.nutz.dao.pager.Pager pager)
      分页查询
      参数:
      cnd - 查询条件
      pager - 分页对象
      返回:
    • query

      org.nutz.lang.util.NutMap query(String keyColumnName, String valueColumnName, org.nutz.dao.Condition cnd)
      查询获取NutMap对象
      参数:
      keyColumnName - 作为key的字段名
      valueColumnName - 作为value的字段名
      cnd - 查询条件
      返回:
    • query

      org.nutz.lang.util.NutMap query(String tableName, String keyColumnName, String valueColumnName, org.nutz.dao.Condition cnd)
      查询获取NutMap对象
      参数:
      tableName - 表名
      keyColumnName - 作为key的字段名
      valueColumnName - 作为value的字段名
      cnd - 查询条件
      返回:
    • getSubPath

      String getSubPath(String tableName, String colName, String value)
      计算子节点TREEID
      参数:
      tableName -
      colName -
      value -
      返回:
    • getParentPath

      String getParentPath(String path)
      获取TREEID父级
      参数:
      path -
      返回:
    • execute

      org.nutz.dao.sql.Sql execute(org.nutz.dao.sql.Sql sql)
      执行一条自定义SQL
      参数:
      sql -
      返回:
    • list

      List<org.nutz.dao.entity.Record> list(org.nutz.dao.sql.Sql sql)
      自定义SQL返回Record记录集,Record是个MAP但不区分大小写 别返回Map对象,因为MySql和Oracle中字段名有大小写之分
      参数:
      sql -
      返回:
    • listMap

      List<org.nutz.lang.util.NutMap> listMap(org.nutz.dao.sql.Sql sql)
      自定义SQL返回NutMap记录集,区分大小写
      参数:
      sql -
      返回:
    • listVO

      <C> List<C> listVO(org.nutz.dao.sql.Sql sql, Class<C> clazz)
      自定义sql 返回自定义类型
      参数:
      sql -
      返回:
    • listPageVO

      <C> Pagination<C> listPageVO(PageForm pageForm, org.nutz.dao.sql.Sql sql, Class<C> clazz)
      自定义分页sql 返回自定义类型
      参数:
      sql -
      返回:
    • listEntity

      List<T> listEntity(org.nutz.dao.sql.Sql sql)
      自定义查询,并返回当前实体类对象
      参数:
      sql -
      返回:
    • getMap

      Map getMap(org.nutz.dao.sql.Sql sql)
      自定义sql获取map key-value
      参数:
      sql -
      返回:
    • getNutMap

      org.nutz.lang.util.NutMap getNutMap(org.nutz.dao.sql.Sql sql)
      自定义sql获取NutMap key-value
      参数:
      sql -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, org.nutz.dao.Condition cnd)
      分页查询
      参数:
      pageNumber -
      cnd -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, org.nutz.dao.sql.Sql sql)
      分页查询
      参数:
      pageNumber -
      sql -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql)
      分页查询(sql)
      参数:
      pageNumber -
      pageSize -
      sql -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
      分页查询
      参数:
      pageNumber -
      sql - 查询语句
      countSql - 统计语句
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
      分页查询
      参数:
      pageNumber -
      pageSize -
      sql - 查询语句
      countSql - 统计语句
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, org.nutz.dao.sql.Sql sql)
      分页查询
      参数:
      pageNumber -
      sql -
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql)
      分页查询(sql)
      参数:
      pageNumber -
      pageSize -
      sql -
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
      分页查询
      参数:
      pageNumber -
      sql - 查询语句
      countSql - 统计语句
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.sql.Sql sql, org.nutz.dao.sql.Sql countSql)
      分页查询
      参数:
      pageNumber -
      pageSize -
      sql - 查询语句
      countSql - 统计语句
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, String tableName, org.nutz.dao.Condition cnd)
      分页查询
      参数:
      pageNumber -
      tableName -
      cnd -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd)
      分页查询(cnd)
      参数:
      pageNumber -
      pageSize -
      cnd -
      返回:
    • listPage

      <C> Pagination<C> listPage(Integer pageNumber, int pageSize, Class<C> clazz, org.nutz.dao.Condition cnd)
      分页 只要你的class是实体类 就是标注了@Table 就可以不写service 直接用这个
      类型参数:
      C -
      参数:
      pageNumber -
      pageSize -
      clazz -
      cnd -
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String fieldName)
      分页查询,获取部分字段(cnd)
      参数:
      pageNumber -
      pageSize -
      cnd -
      fieldName - 支持通配符 ^(a|b)$
      返回:
    • listPageLinks

      Pagination listPageLinks(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String linkName)
      关联查询
      参数:
      pageNumber -
      pageSize -
      cnd -
      linkName - 支持通配符 ^(a|b)$
      返回:
    • listPageLinks

      Pagination listPageLinks(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd, String linkName, org.nutz.dao.Condition subCnd)
      关联查询,带子查询条件
      参数:
      pageNumber -
      pageSize -
      cnd -
      linkName - 支持通配符 ^(a|b)$
      subCnd - 子查询条件
      返回:
    • listPage

      Pagination listPage(Integer pageNumber, int pageSize, String tableName, org.nutz.dao.Condition cnd)
      分页查询(tabelName)
      参数:
      pageNumber -
      pageSize -
      tableName -
      cnd -
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, org.nutz.dao.Condition cnd)
      分页查询并返回包含实体类内容的NutMap对象
      参数:
      pageNumber -
      cnd -
      返回:
    • listPageMap

      Pagination listPageMap(Integer pageNumber, int pageSize, org.nutz.dao.Condition cnd)
      分页查询并返回包含实体类内容的NutMap对象
      参数:
      pageNumber -
      pageSize -
      cnd -
      返回:
    • data

      org.nutz.lang.util.NutMap data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, org.nutz.dao.Cnd cnd, String linkName)
      DataTable Page
      参数:
      length - 页大小
      start - start
      draw - draw
      orders - 排序
      columns - 字段
      cnd - 查询条件
      linkName - 关联查询 支持通配符 ^(a|b)$
      返回:
    • data

      org.nutz.lang.util.NutMap data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, org.nutz.dao.Cnd cnd, String linkName, org.nutz.dao.Cnd subCnd)
      DataTable Page
      参数:
      length - 页大小
      start - start
      draw - draw
      orders - 排序
      columns - 字段
      cnd - 查询条件
      linkName - 关联查询 支持通配符 ^(a|b)$
      subCnd - 关联查询条件
      返回:
    • data

      org.nutz.lang.util.NutMap data(int length, int start, int draw, org.nutz.dao.sql.Sql countSql, org.nutz.dao.sql.Sql orderSql)
      DataTable Page 自定义SQL
      参数:
      length - 页大小
      start - start
      draw - draw
      countSql - 统计查询语句
      orderSql - 结果查询语句
      返回:
    • data

      org.nutz.lang.util.NutMap data(int length, int start, int draw, org.nutz.dao.sql.Sql countSql, org.nutz.dao.sql.Sql orderSql, boolean countOnly)
      DataTable Page 自定义SQL
      参数:
      length - 页大小
      start - start
      draw - draw
      countSql - 统计查询语句
      orderSql - 结果查询语句
      countOnly - 统计查询语句是否只有count()
      返回:
    • data

      org.nutz.lang.util.NutMap data(int length, int start, int draw, org.nutz.dao.Cnd cnd, String linkName)
      DataTable Page
      参数:
      length - 页大小
      start - start
      draw - draw
      cnd - 查询条件
      linkName - 关联查询 支持通配符 ^(a|b)$
      返回:
    • fetchMap

      org.nutz.lang.util.NutMap fetchMap(org.nutz.dao.sql.Sql sql)
      获取Map
      参数:
      sql -
      返回: