Skip to main content
Hint

This article is generated by AI translation.

Mapper Interface (BaseMapper)

BaseMapper<T> is a generic data access interface provided by dbVisitor. Based on Object Mapping, it automatically generates CRUD statements without writing any SQL.

Quick Start
BaseMapper<User> mapper = session.createBaseMapper(User.class);

// Insert
mapper.insert(user);

// Query by primary key
User found = mapper.selectById(1L);

// Pagination query
Page page = PageObject.of(0, 20);
PageResult<User> result = mapper.pageBySample(null, page);
Tip

How to obtain a Session depends on your project architecture. See Framework Integration for details.

User Guide