前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >HANA: View refactoring failed due to error 'NullPointerException'

HANA: View refactoring failed due to error 'NullPointerException'

作者头像
matinal
发布2020-11-27 15:49:48
5820
发布2020-11-27 15:49:48
举报
文章被收录于专栏:SAP Technical

If you ignore the prompt and continue the refactoring, the following error information will popup:

代码语言:javascript
复制
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:

代码语言:javascript
复制
SELECT * FROM "_SYS_REPO"."INACTIVE_OBJECT" WHERE package_id = '<package name>' AND object_name = '<referential view>';
代码语言:javascript
复制
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:

代码语言:javascript
复制
DELETE FROM "_SYS_REPO"."INACTIVE_OBJECT" WHERE package_id = '<package name>' AND object_name = '<referential view>';
代码语言:javascript
复制
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.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017/01/12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档