HANA: View refactoring failed due to error 'NullPointerException'

本文介绍了解决HANA Studio中进行视图重构时出现的错误问题,包括错误的具体表现、产生的原因及如何通过SQL命令清除系统残留的无效条目来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you ignore the prompt and continue the refactoring, the following error information will popup:
Error occured during the refactoring of <view_name>java.lang.NullPointerException   
at com.sap.ndb.studio.modeler.job.type.copymodels.MoveModelsHandler.updateReferences(MoveModelsHandler.java)   
at com.sap.ndb.studio.modeler.job.type.copymodels.MoveModelsHandler.moveModels(MoveModelsHandler.java)   
at com.sap.ndb.studio.modeler.job.type.copymodels.RefactorModelsJob.moveModels(RefactorModelsJob.java)   
at com.sap.ndb.studio.modeler.job.type.copymodels.RefactorModelsJob.refactor(RefactorModelsJob.java)   
at com.sap.ndb.studio.modeler.job.type.copymodels.RefactorModelsJob.run(RefactorModelsJob.java)   
at org.eclipse.core.internal.jobs.Worker.run(Worker.java)


Environment
HANA database 1.0 all releases


Reproducing the Issue
On HANA Studio, find out your view, Right click it -> Refactor -> Move, in popup window, choose the target package that you would move to, then click "Next".


Cause
This problem is usually caused by one of the following reasons:
  1. When you deleted the referential view, something went wrong, so this object was not permanently deleted from HANA database, but only was marked for deletion and can't be shown in Navigator anymore.
  2. When you deleted the referencing relationship, something went wrong, so this relationship was not permanently deleted from HANA database and can't be shown in Modeler perspective.


Resolution
If you make sure that the referential view won't be used anymore, you need firstly check if the referential view or the referencing relationship is still existing in system views. You can use the following SQL statements for checking:
SELECT * FROM "_SYS_REPO"."INACTIVE_OBJECT" WHERE package_id = '<package name>' AND object_name = '<referential view>';
SELECT * FROM "_SYS_REPO"."INACTIVE_OBJECTCROSSREF" WHERE from_package_id = '<package name>' AND from_object_name = '<referential view>';
Delete the unwanted entries using SQL commands:
DELETE FROM "_SYS_REPO"."INACTIVE_OBJECT" WHERE package_id = '<package name>' AND object_name = '<referential view>';
DELETE FROM "_SYS_REPO"."INACTIVE_OBJECTCROSSREF" WHERE from_package_id = '<package name>' AND from_object_name = '<referential view>'; 
Then you can retry to refactor the primary view.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值