| | |
| | | package com.yeshi.fanli.util.mybatishandler.msg;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum;
|
| | |
|
| | | public class MsgTypeInviteTypeEnumHandler extends BaseTypeHandler<MsgTypeInviteTypeEnum> {
|
| | |
|
| | | @Override
|
| | | public MsgTypeInviteTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return MsgTypeInviteTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgTypeInviteTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return MsgTypeInviteTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgTypeInviteTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return MsgTypeInviteTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, MsgTypeInviteTypeEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.util.mybatishandler.msg; |
| | | |
| | | import java.sql.CallableStatement; |
| | | import java.sql.PreparedStatement; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | |
| | | import org.apache.ibatis.type.BaseTypeHandler; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum; |
| | | |
| | | public class MsgTypeInviteTypeEnumHandler extends BaseTypeHandler<MsgTypeInviteTypeEnum> { |
| | | |
| | | @Override |
| | | public MsgTypeInviteTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | return MsgTypeInviteTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MsgTypeInviteTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | // 根据数据库中的key值,定位SexEnum子类 |
| | | return MsgTypeInviteTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MsgTypeInviteTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | // 根据数据库中的key值,定位SexEnum子类 |
| | | return MsgTypeInviteTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, MsgTypeInviteTypeEnum arg2, JdbcType arg3) |
| | | throws SQLException { |
| | | arg0.setString(arg1, arg2.name()); |
| | | } |
| | | |
| | | } |