项目从mysql迁移到oracle报错
mysqloracle迁移
本来没有一点错误,迁移之后出现了很多,不知道哪位大神见过下面的问题:
17:23:54,967 ERROR BasicPropertyAccessor:118 - IllegalArgumentException in class: com.ebupt.dataWarehouse.entity.dataQualityMonitoring.MonTaskConEntity, setter method of property: TemporaryIId
17:23:54,995 ERROR BasicPropertyAccessor:122 - expected type: int, actual value: java.math.BigDecimal
17:23:55,000 DEBUG ConnectionManager:325 - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
17:23:55,006 ERROR MonTaskConDao:101 - org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.ebupt.dataWarehouse.entity.dataQualityMonitoring.MonTaskConEntity.TemporaryIId
17:23:55,009 DEBUG ConnectionManager:464 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
17:23:55,024 DEBUG ConnectionManager:325 - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
17:23:55,071 ERROR DataQualityMonitoringImpl:65 - org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.ebupt.dataWarehouse.entity.dataQualityMonitoring.MonTaskConEntity.TemporaryIId
17:23:55,073 ERROR MonitoringTaskConfigurationAction:54 - org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.ebupt.dataWarehouse.entity.dataQualityMonitoring.MonTaskConEntity.TemporaryIId
DAO层的相关函数是这样写的:
public List getMonTaskConList() throws Exception {
Session session = sessionFactory.openSession();
String sql = "SELECT d1.domain_id TemporaryIId, "
+ "d1.job_id TemporaryId, "
+ "d1.job_name job_name, "
+ "d1.is_effective is_effective, "
+ "d1.object_type object_type, "
+ "d1.object_name object_name, "
+ "d1.object_ename object_ename, "
+"d1.object_location object_location ,"
+"d1.time_field time_field, "
+ "COUNT(d2.rule_id) columnNum "
+ "from dq_conf_jobs d1, dq_conf_rule d2 "
//+ "where (d1.job_id = d2.job_id OR d1.job_id not in (SELECT job_id from dq_conf_rule)) AND d2.is_effective = '1'"
//+ "where ((d1.job_id = d2.job_id AND d1.domain_id = d2.domain_id) OR d1.job_id not in (SELECT job_id from dq_conf_rule)) AND d2.is_effective = '1'"
+ "where d1.job_id = d2.job_id OR d1.job_id not in (SELECT job_id from dq_conf_rule)"
//-- + "GROUP BY d1.job_id";
//非聚合函数字段都要在group by里面好像
+ "GROUP BY d1.job_id,d1.domain_id,d1.job_name,d1.is_effective,d1.object_type,d1.object_name,d1.object_ename,d1.object_location,d1.time_field";
//String sql = "";
try {
Query query = session.createSQLQuery(sql)
.addScalar("TemporaryIId")
.addScalar("TemporaryId")
.addScalar("job_name")
.addScalar("object_type")
.addScalar("object_name")
.addScalar("is_effective")
.addScalar("object_ename")
.addScalar("object_location")
.addScalar("time_field")
.addScalar("columnNum", Hibernate.INTEGER)
.setResultTransformer(Transformers.aliasToBean(MonTaskConEntity.class));
List resultList = query.list();
//查询rule总数,进行过滤
String countSql = "SELECT COUNT(*) FROM dq_conf_rule";
Query countQuery = session.createSQLQuery(countSql);
int count = ((Number) countQuery.uniqueResult()).intValue();
//数据整理,id.job_id的赋值,如果rule行数为总行数,则表明该job并没有rule
if (resultList != null && resultList.size() > 0) {
for (MonTaskConEntity entity : resultList) {
if (entity.getColumnNum() == count) {
entity.setColumnNum(0);
}
MonTaskConEntityId idEntity = new MonTaskConEntityId();
idEntity.setJob_id(entity.getTemporaryId());
idEntity.setDomain_id(entity.getTemporaryIId());
entity.setId(idEntity);
}
}
return resultList;
} catch (Exception e) {
log.error(e);
throw e;
} finally {
session.close();
}
}
目的是把表格的数据获取显现出来
谢谢大家

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

本文探讨了Docker中的优化MySQL内存使用量。 它讨论了监视技术(Docker统计,性能架构,外部工具)和配置策略。 其中包括Docker内存限制,交换和cgroups

本文介绍了MySQL的“无法打开共享库”错误。 该问题源于MySQL无法找到必要的共享库(.SO/.DLL文件)。解决方案涉及通过系统软件包M验证库安装

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

本文比较使用/不使用PhpMyAdmin的Podman容器直接在Linux上安装MySQL。 它详细介绍了每种方法的安装步骤,强调了Podman在孤立,可移植性和可重复性方面的优势,还

本文提供了SQLite的全面概述,SQLite是一个独立的,无服务器的关系数据库。 它详细介绍了SQLite的优势(简单,可移植性,易用性)和缺点(并发限制,可伸缩性挑战)。 c

本指南展示了使用自制在MacOS上安装和管理多个MySQL版本。 它强调使用自制装置隔离安装,以防止冲突。 本文详细详细介绍了安装,起始/停止服务和最佳PRA

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]
