项目从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();
}
}
目的是把表格的数据获取显现出来
谢谢大家

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.
