package com.nanometer.smartlab.entity.handler;
|
|
import com.nanometer.smartlab.entity.enumtype.ApplyStatus;
|
import org.apache.ibatis.type.BaseTypeHandler;
|
import org.apache.ibatis.type.JdbcType;
|
|
import java.sql.CallableStatement;
|
import java.sql.PreparedStatement;
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
|
public class ApplyStatusHandler extends BaseTypeHandler<ApplyStatus> {
|
|
@Override
|
public ApplyStatus getNullableResult(ResultSet rs, String index) throws SQLException {
|
return ApplyStatus.parse(rs.getInt(index));
|
}
|
|
@Override
|
public ApplyStatus getNullableResult(ResultSet rs, int index) throws SQLException {
|
return ApplyStatus.parse(rs.getInt(index));
|
}
|
|
@Override
|
public ApplyStatus getNullableResult(CallableStatement cs, int index) throws SQLException {
|
return ApplyStatus.parse(cs.getInt(index));
|
}
|
|
@Override
|
public void setNonNullParameter(PreparedStatement ps, int index, ApplyStatus val, JdbcType arg3) throws SQLException {
|
ps.setInt(index, val.getKey());
|
}
|
}
|