Creating rows in parent and child VO connected using a VL

Hi,

Today I got stuck with the requirement where I had to display the parent and child in the input mode. My problem was I am having two VOs both are connected to each other using a view link and both are having the id column. This column is a primary key for the Employee table and foreign key for the Description table which in tern also have a id column.

so my database schema is like this.


EQUITY_USERS
Name Null Type
------------------- -------- --------------
USERID NOT NULL NUMBER
USER_NAME NOT NULL VARCHAR2(20)
FULL_NAME VARCHAR2(20)
ACTIVATION_FLAG NOT NULL VARCHAR2(10)
DEACTIVATION_REASON VARCHAR2(2000)
ADMINUSERID NUMBER
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY VARCHAR2(20)
USER_TYPE VARCHAR2(10)
INSERTED_DATE DATE


and

desc EQUITY_USERS_ADDITIONAL_INFO
Name Null Type
------------- -------- -------------
USER_ID NOT NULL NUMBER
ADDRESS_LINE2 VARCHAR2(200)
PHONE_NUMBER VARCHAR2(20)
MOBILE_NUMBER VARCHAR2(20)
EMAIL_ID VARCHAR2(50)
CITY VARCHAR2(200)
STATE VARCHAR2(200)
PIN_CODE VARCHAR2(20)
ADDRESS_LINE3 VARCHAR2(200)
ADDRESS_LINE1 VARCHAR2(200)

Now I have two EO bases on this table and then two VOs bases on the same EOs. These two VOs are connected using a view link using id column. In the page I have dropped both the VOs as form with input box. But the problem I faced that even if I call create method of both the VOs before the page rendering the second VO was not rendering with the input box, or say row is not been created in the second row.

After a number of try what I did is create a method in AM and called this method before the page. The code which I need to write in this is


Row userRow = this.getEquityUsersVO().createRow();
this.getEquityUsersVO().insertRow(userRow);

Row userAdditionalRow= this.getEquityUserVOToEquityUserAdditionalInfoVO1().getDestination().createRow();
this.getEquityUserVOToEquityUserAdditionalInfoVO1().getDestination().insertRow(userAdditionalRow);



so what this code is doing its first creating the row in the first VO (parent) and then its inserting also so if any sequence code is there in the create method of the VO can be executed and then calling the create and insert for the child VO using the viewlink so that the same id can be transferred to the child automatically.


Now my form is opening properly

Comments

Popular posts from this blog

Executing a method bindings In Bean method.

Using Java Decompiler(JD) with Oracle Jdeveloper (Jdev)

Current Logged in User and Roles in ADF and Fusion Apps