This content has been marked as final. Show 11 replies
How are you inserting the value for refIdTableB..? The error could be related to this field as Table C has association with Table B as well.
Also, at database level does these fields have Primary Key/Foreign Key relationship..?
Check this blog as well: http://one-size-doesnt-fit-all.blogspot.com/2008/05/jbo-25030-failed-to-find-or-invalidate.html
first of all, thank you for your reply.
I try to explain in a better way my problem
At database level the primary key of every table is the field Id (IdA, IdB, IdC, of type DBSequence). There is two foreign keys: refIdTableA --> IdA and refIdTableB --> IdB.
I would like to create a row in TableC, that it is a child of tableA, and where I can choose refIdTableB among the records in tableB (using a LOV that I have just created, I see correctly the rows just inserted in TableC).
I have just read that blog, but it is not about my problem.
I don't know how to create a new row? Declaritevely, programmatically? I have no idea.
I would like to create a new row in tableC where refIdTableA = IdA (tableA is its master table) and refIdTableB settable by a LOV.
when you are creating row in tableC are you using existing value of TableA idA in refIdTableA or you are populating a new value for that field and trying to propogate that new value as a new record in your master table (Table A)as well..?
I dont see any issues around refIdTableB since its populated through LOV. However, with refIdTableA column if the value that create doesn't exists in TableA idA column then you will hit this error if you don't handle the creation of new row in master table.
When I am creating a row in tableC I am using existing value of TableA idA in refIdTableA (so there is the value on master table) , while I want that other attributes of TableC are editable.
The associations that links tableA --> tableC and tableB-->tableC are composition association optimize for database cascade delete, Lock top-level container.
I don't know what is the right way to realize it... declarative? programmatically? if programmatically, how can implement it? using tableAEOImpl.java, or tableAVOImpl.java or myAppModuleImpl.java?
I have tried in a declarative way: using the createWithParams of tableC, passing as parameter the value of refIdTableA (I have this value because I am in a master/detail), but when I click on it, I have this error:
Impossibile to find or invalidate the property entity: entity TableCEO, row Key oracle.jbo.Key[-158 ]. oracle.jbo.InvalidOwnerException
I think I have this error because I have two composition relationship on TableC. Is there a solution? I need both two composition relations
Edited by: Andrea9 on 24-mar-2010 07:35
Which Create or Create with Params you are using..? I guess in your data controls, you will be having tableC VO directly as well as table C VO as a child to table A VO. If you use Create / Create with Params from table C VO which is under table A, then it should work. Otherwise, if you use Create under the direct ones then you will get this error. Hope it is clear for you.
Alternatively, check this sample for programmatic implementation. Hope this helps.
Yes, it is clear for me. I am using the CreateInsert/Create with Params in my data controls, where table C VO is a child to table A VO.
I think I have this error because I have two composition associations on the tableC (one with tableA and one with TableB).
I think that link is not good for my problem: I have just a master row (tableA), but I want to create a detail row in a table (tableC) that has a composition association with another table (tableB).
Then I don't understand a thing on that link: where have I to put the code that there is in the void main? I have not/don't find my main method.
As I understand, in your case you are not creating any master record during child record creation. Hence, you could create a custom method in AMImpl and expose that custom method as a client method. Once done, create an operation binding for this client method and invoke that from your bean.
You have understood well. This is my case.
Few days ago, I have created a method in AMImpl and I have exposed it. In my page, I dragged and dropped directly that method and I did not invoke that from my bean.
I don't understand why I have to invoke it from my bean and not directly from myAM.
I tried to use something similar that there is in the paragraph "4.12.4 How to Create a New Entity Row" of the manual. When I called the method to create the detail row I have the error because the detail row has two master.