Search in sources :

Example 6 with InsertBuilder

use of io.leopard.jdbc.builder.InsertBuilder in project leopard by tanhaichao.

the class AdminDaoMysqlImpl method add.

@Override
public boolean add(Admin admin) {
    InsertBuilder builder = new NullInsertBuilder("admin");
    builder.setLong("adminId", admin.getAdminId());
    builder.setString("username", admin.getUsername());
    builder.setString("password", admin.getPassword());
    builder.setList("roles", admin.getRoleList());
    builder.setString("salt", admin.getSalt());
    builder.setString("name", admin.getName());
    builder.setBool("disabled", admin.isDisabled());
    builder.setDate("posttime", admin.getPosttime());
    return jdbc.insertForBoolean(builder);
}
Also used : InsertBuilder(io.leopard.jdbc.builder.InsertBuilder) NullInsertBuilder(io.leopard.jdbc.builder.NullInsertBuilder) NullInsertBuilder(io.leopard.jdbc.builder.NullInsertBuilder)

Example 7 with InsertBuilder

use of io.leopard.jdbc.builder.InsertBuilder in project leopard by tanhaichao.

the class CaptchaDaoMysqlImpl method add.

@Override
public boolean add(Captcha captcha) {
    InsertBuilder builder = new InsertBuilder(tableName);
    builder.setString("captchaId", captcha.getCaptchaId());
    builder.setString("type", captcha.getType());
    builder.setString("target", captcha.getTarget());
    builder.setString("account", captcha.getAccount());
    builder.setString("captcha", captcha.getCaptcha());
    builder.setString("data", captcha.getData());
    builder.setBool("used", captcha.isUsed());
    builder.setDate("posttime", captcha.getPosttime());
    builder.setDate("expiryTime", captcha.getExpiryTime());
    builder.setDate("lmodify", captcha.getLmodify());
    return jdbc.insertForBoolean(builder);
}
Also used : InsertBuilder(io.leopard.jdbc.builder.InsertBuilder)

Aggregations

InsertBuilder (io.leopard.jdbc.builder.InsertBuilder)7 NullInsertBuilder (io.leopard.jdbc.builder.NullInsertBuilder)1 Field (java.lang.reflect.Field)1 Date (java.util.Date)1 List (java.util.List)1 Test (org.junit.Test)1 InvalidDataAccessApiUsageException (org.springframework.dao.InvalidDataAccessApiUsageException)1