错误:
oracle.jbo.DMLConstraintException:
JBO-26048: Constraint "Td_Parent_Id_FK" violated during post operation:
"Insert" using SQL Statement
原因:
When the TdChild row is inserted, the database complains that the value of its Td_Parent_ID foreign key doesn't correspond to any row in the TdParent table.
This occurred because:
The code created the TdChild before the TdParent
TdChild and TdParent entity objects are associated but not composed
The DML operations to save the new entity rows is done in chronological order, so the new TdChild gets inserted before the new TdParent.
解决方法:
public class TdChildImpl extends EntityImpl { private static EntityDefImpl mDefinitionObject; @Override public void postChanges(TransactionEvent e) { if (getPostState() == STATUS_NEW || getPostState() == STATUS_MODIFIED) { TdParentImpl tdParent= getTdParent(); if (tdParent!= null) { if (tdParent.getPostState() == STATUS_NEW) { tdParent.postChanges(e); } } } super.postChanges(e); } }
相关推荐
在本文中,我将讨论棘手的Spring Boot bean定义覆盖机制。 为了使您对该主题更加清楚,让我们从小测验开始。请看下一个简单的例子。 因此,我们有2种配置,它们使用名称beanName实例化bean,在主应用程序中,我们仅...
"Overloading&Overriding" 在面向对象编程中,Overloading和Overriding是两个重要的概念,它们都是多态性的体现。下面我们将对这两个概念进行详细的解释。 1. 方法重载(Overloading) 方法重载是让类以统一的...
这就是所谓的“控件重写”(Control Overriding)。标题“control-rewrite.rar_control_重写控件”提示我们这是一个关于控件重写的资源包,适用于初学者。描述中提到这个资料已经在Visual Studio 2008环境下测试过,...
However, to wrap subclassing and hooking into virtual function overriding it is an obscure technique unknown to a large population of Windows programmers. This is unfortunate, because there are many ...
The line (link) object of the control is very flexible, and can be hook to other objects or connect them together. By the way, the control has also some methods for supporting Delphi's clipboard and...
对于任何传入的 POST 请求,扩展函数检查路径是否以定义的操作名称之一(例如destroy )结尾。 如果是这样,它会将方法更改为相应的 HTTP 动词(例如DELETE )。 它还将更改请求的 url,删除操作部分并保持路由清洁...
#学习的101个经典例子,例子个个经典,涵盖C#的方方面面,带有说详尽的注释 Advanced - Multithreading - How-To Async Calls Advanced - Remoting - How-To TCP Remoting ...WinForms - Dynamic Control Creation
在Java入门与进阶设计第11章中,我们主要探讨了两个关键概念:继承(Inheritance)和覆盖(Overriding)。 首先,所有的Java对象都间接或直接地继承自`java.lang.Object`类,它是所有类的终极祖先。当你创建一个新...
Overriding an object managed by Dagger 2 is not easy, you need to define a TestModule and, if you want to inject your test object, a TestComponent. Using a DaggerMockRule it's possible to override ...
Method overriding allows a subclass to provide a different implementation for a method defined in its superclass, while method overloading involves having multiple methods with the same name but ...
- **Overloading and Overriding:** Learn about method overloading and overriding. 3. **Decision Statements:** - **If-Else Statements:** Master the use of if-else statements for conditional logic. -...
目录如下: 1 Introduction 2 Creating and Destroying Objects ...Item 89: For instance control, prefer enum types to readResolve Item 90: Consider serialization proxies instead of serialized instances
This chapter explains how to implement inheritance in F#, including overriding methods and accessing base class members. - **Generics (Chapter 10):** Generics provide a way to write type-safe code ...
接口和抽象类是实现OOP中多态性的重要工具,而方法覆盖(Method Overriding)则是体现类继承和多态性的关键概念。在这个项目"oop-java-overriding-davidlenner"中,我们将深入探讨这三个主题。 首先,我们来看接口...
方法覆盖(Method Overriding)是Java中多态性的重要体现,它允许子类对父类的方法进行重新定义,以实现特定的功能。本项目"oop-java-overriding-ereich1993"可能是一个教学资源,旨在帮助学习者理解这些概念并进行...
to gray in the specified display state. This is the overriding color level. 4. Examine the component in the graphics area, then press F5. 5. Changes the selected component's, USB_cover1, part-...
It is up to the application to define what consistency means, and isolation in some form is needed to achieve consistent results. SQL Server uses locking to achieve isolation. Definition of ...