项目从mysql迁移到oracle报错

php中文网
发布: 2016-06-06 09:38:48
原创
1395人浏览过

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();
}

}
目的是把表格的数据获取显现出来
谢谢大家

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号