Browse Source

删除报错代码

master
王梦远 2 days ago
parent
commit
1f95282869
  1. 40
      src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java

40
src/main/java/com/iflytop/colortitration/common/handler/DeviceTypeHandler.java

@ -1,40 +0,0 @@
package com.iflytop.colortitration.common.handler;
import com.iflytop.colortitration.common.enums.Device;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@MappedJdbcTypes(JdbcType.VARCHAR)
@MappedTypes(Device.class)
public class DeviceTypeHandler extends BaseTypeHandler<Device> {
@Override
public void setNonNullParameter(PreparedStatement ps, int i, Device parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, parameter.name());
}
@Override
public Device getNullableResult(ResultSet rs, String columnName) throws SQLException {
String name = rs.getString(columnName);
return name == null ? null : Device.valueOf(name);
}
@Override
public Device getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String name = rs.getString(columnIndex);
return name == null ? null : Device.valueOf(name);
}
@Override
public Device getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String name = cs.getString(columnIndex);
return name == null ? null : Device.valueOf(name);
}
}
Loading…
Cancel
Save