Search in sources :

Example 1 with LongWrapper

use of org.seasar.doma.wrapper.LongWrapper in project doma by domaframework.

the class BuiltinTableIdGenerator method initialize.

@Override
public void initialize() {
    if (qualifiedTableName == null) {
        throw new JdbcException(Message.DOMA2033, "qualifiedTableName");
    }
    if (pkColumnName == null) {
        throw new JdbcException(Message.DOMA2033, "pkColumnName");
    }
    if (pkColumnValue == null) {
        throw new JdbcException(Message.DOMA2033, "pkColumnValue");
    }
    if (valueColumnName == null) {
        throw new JdbcException(Message.DOMA2033, "valueColumnName");
    }
    LongWrapper allocationSizeWrapper = new LongWrapper();
    allocationSizeWrapper.set(allocationSize);
    StringWrapper pkColumnValueWrapper = new StringWrapper();
    pkColumnValueWrapper.set(pkColumnValue);
    updateSql = new PreparedSql(SqlKind.UPDATE, createUpdateRawSql(), createUpdateFormattedSql(), null, Arrays.asList(new BasicInParameter<>(() -> allocationSizeWrapper), new BasicInParameter<>(() -> pkColumnValueWrapper)), SqlLogType.FORMATTED);
    selectSql = new PreparedSql(SqlKind.SELECT, createSelectRawSql(), createSelectFormattedSql(), null, Collections.singletonList(new BasicInParameter<>(() -> pkColumnValueWrapper)), SqlLogType.FORMATTED);
}
Also used : StringWrapper(org.seasar.doma.wrapper.StringWrapper) PreparedSql(org.seasar.doma.jdbc.PreparedSql) LongWrapper(org.seasar.doma.wrapper.LongWrapper) JdbcException(org.seasar.doma.jdbc.JdbcException)

Aggregations

JdbcException (org.seasar.doma.jdbc.JdbcException)1 PreparedSql (org.seasar.doma.jdbc.PreparedSql)1 LongWrapper (org.seasar.doma.wrapper.LongWrapper)1 StringWrapper (org.seasar.doma.wrapper.StringWrapper)1