add
gdg
2021-01-06 626028e5865122c43d97156d2cb221b751e5f18d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.nanometer.smartlab.entity.handler;
 
import com.nanometer.smartlab.entity.enumtype.ArrivalStatus;
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 ArrivalStatusHandler extends BaseTypeHandler<ArrivalStatus> {
 
    @Override
    public ArrivalStatus getNullableResult(ResultSet rs, String index) throws SQLException {
        return ArrivalStatus.parse(rs.getInt(index));
    }
 
    @Override
    public ArrivalStatus getNullableResult(ResultSet rs, int index) throws SQLException {
        return ArrivalStatus.parse(rs.getInt(index));
    }
 
    @Override
    public ArrivalStatus getNullableResult(CallableStatement cs, int index) throws SQLException {
        return ArrivalStatus.parse(cs.getInt(index));
    }
 
    @Override
    public void setNonNullParameter(PreparedStatement ps, int index, ArrivalStatus val, JdbcType arg3) throws SQLException {
        ps.setInt(index, val.getKey());
    }
}