原神通数据库、oracle转postgresql进行适配

ERROR: column “XX” is of type smallint but expression is of type boolean

在代码中加入以下类,缺什么补什么。

package org.hibernate.dialect;

import java.sql.Types;

import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor;
import org.hibernate.type.descriptor.sql.LongVarbinaryTypeDescriptor;
import org.hibernate.type.descriptor.sql.LongVarcharTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;

/**
 * @author clong
 * @date: 20200610 
 * @version 1.0
 */
public class PostgreSQL20200610Dialect extends PostgreSQL9Dialect {
	@Override
	public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
		switch (sqlTypeDescriptor.getSqlType()) {
		case Types.CLOB:
			return LongVarcharTypeDescriptor.INSTANCE;
		case Types.BLOB:
			return LongVarbinaryTypeDescriptor.INSTANCE;
		case Types.BOOLEAN:
			return IntegerTypeDescriptor.INSTANCE;
		}
		return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
	}
}

你可能感兴趣的:(OSCAR)