use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testCountByExample.
@Test
public void testCountByExample() throws InterruptedException {
UserEntity example = new UserEntity();
example.setName("嘎子");
example.setType((short) 1);
example.setCreatedAt(new Date());
userMapper.countByExample(example);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testUpdateByPrimaryKey.
@Test
public void testUpdateByPrimaryKey() {
UserEntity entity = userMapper.selectByPrimaryKey(4);
entity.setName("jim");
userMapper.updateByPrimaryKey(entity);
System.out.println("name:" + entity.getName());
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testPage.
@Test
public void testPage() {
Page<UserEntity> pageInfo;
UserEntity example = new UserEntity();
example.setType((short) 1);
PageParams pageParams = new PageParams(1, 10, new OrderBy("name"));
pageInfo = PageExecutor.pagination(pageParams, new PageDataLoader<UserEntity>() {
@Override
public List<UserEntity> load() {
return userMapper.selectByExample(example);
}
});
System.out.println(pageInfo);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testUpdateVersion.
@Test
public void testUpdateVersion() {
UserEntity entity = userMapper.selectByPrimaryKey(4);
// userMapper.insert(entity);
// userMapper.deleteByPrimaryKey(entity.getId());
entity.setName(RandomStringUtils.random(5, true, false));
entity.setStatus((short) 1);
entity.setVersion(4);
int result = userMapper.updateByPrimaryKeyWithVersion(entity);
System.out.println(result);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testUpdateByPrimaryKeySelective.
@Test
public void testUpdateByPrimaryKeySelective() {
UserEntity entity = userMapper.selectByPrimaryKey(4);
entity.setName("jim2");
userMapper.updateByPrimaryKeySelective(entity);
System.out.println("name:" + entity.getName());
}
Aggregations