How can I make this join in ADF and make CRUD operation in this

How to make this relation in ADF
I have table employees and this is my master table
Table Name: Employees
Columns:
Employee_id(PK)
Employee_name
Employee_Salary
I have a child table that is called related employee that contains employees related to this employee
Table_name: Related_Employee
Columns:
Related_Employee_Table_Id(PK)
Employee_id(FK)
Related_Employee_Id
When I open employee id = 100 for example and add related employee id = 10
this is added with no problem but the requirement is that when I open employee 10 I find employee id 100 as related employee
How can I make this scenario.

The best way to understand this is to look at an example. If you are using an oracle database such as XE for you have a schema called hr. This shema has a number of tables two of which are departments and employees. a department has multiple employees correct. So in your example a employee may be related to x # of other employees perhaps. A very similar scenario as that in the hr Schema. If you don't have an Oracle XE database, download one from here -> http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
Create Business Components off of the Departments and Employees schema and you'll see that due to the db design, you get what you're talking about for free (i.e. the join). Thus, you have the master-detail relationship you're looking for. For a quick tip, here is the relationship between departments and employees in the hr schema via a create script that you can exam with data inserts included:
SET SQLBLANKLINES ON
CREATE TABLE DEPARTMENTS
DEPARTMENT_ID NUMBER(4, 0) NOT NULL
, DEPARTMENT_NAME VARCHAR2(30 BYTE) NOT NULL
, MANAGER_ID NUMBER(6, 0)
, LOCATION_ID NUMBER(4, 0)
, CONSTRAINT DEPT_ID_PK PRIMARY KEY
DEPARTMENT_ID
USING INDEX
CREATE UNIQUE INDEX DEPT_ID_PK ON DEPARTMENTS (DEPARTMENT_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
ENABLE
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 1
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE TABLE EMPLOYEES
EMPLOYEE_ID NUMBER(6, 0) NOT NULL
, FIRST_NAME VARCHAR2(20 BYTE)
, LAST_NAME VARCHAR2(25 BYTE) NOT NULL
, EMAIL VARCHAR2(25 BYTE) NOT NULL
, PHONE_NUMBER VARCHAR2(20 BYTE)
, HIRE_DATE DATE NOT NULL
, JOB_ID VARCHAR2(10 BYTE) NOT NULL
, SALARY NUMBER(8, 2)
, COMMISSION_PCT NUMBER(2, 2)
, MANAGER_ID NUMBER(6, 0)
, DEPARTMENT_ID NUMBER(4, 0)
, CONSTRAINT EMP_EMP_ID_PK PRIMARY KEY
EMPLOYEE_ID
USING INDEX
CREATE UNIQUE INDEX EMP_EMP_ID_PK ON EMPLOYEES (EMPLOYEE_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
ENABLE
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 1
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE INDEX DEPT_LOCATION_IX ON DEPARTMENTS (LOCATION_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE INDEX EMP_DEPARTMENT_IX ON EMPLOYEES (DEPARTMENT_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE INDEX EMP_JOB_IX ON EMPLOYEES (JOB_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE INDEX EMP_MANAGER_IX ON EMPLOYEES (MANAGER_ID ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
CREATE INDEX EMP_NAME_IX ON EMPLOYEES (LAST_NAME ASC, FIRST_NAME ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_EMAIL_UK UNIQUE
EMAIL
USING INDEX
CREATE UNIQUE INDEX EMP_EMAIL_UK ON EMPLOYEES (EMAIL ASC)
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 2
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
ENABLE;
ALTER TABLE DEPARTMENTS
ADD CONSTRAINT DEPT_LOC_FK FOREIGN KEY
LOCATION_ID
REFERENCES LOCATIONS
LOCATION_ID
ENABLE;
ALTER TABLE DEPARTMENTS
ADD CONSTRAINT DEPT_MGR_FK FOREIGN KEY
MANAGER_ID
REFERENCES EMPLOYEES
EMPLOYEE_ID
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_DEPT_FK FOREIGN KEY
DEPARTMENT_ID
REFERENCES DEPARTMENTS
DEPARTMENT_ID
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_JOB_FK FOREIGN KEY
JOB_ID
REFERENCES JOBS
JOB_ID
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_MANAGER_FK FOREIGN KEY
MANAGER_ID
REFERENCES EMPLOYEES
EMPLOYEE_ID
ENABLE;
ALTER TABLE DEPARTMENTS
ADD CONSTRAINT DEPT_NAME_NN CHECK
(DEPARTMENT_NAME IS NOT NULL)
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_EMAIL_NN CHECK
(EMAIL IS NOT NULL)
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_HIRE_DATE_NN CHECK
(HIRE_DATE IS NOT NULL)
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_JOB_NN CHECK
(JOB_ID IS NOT NULL)
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_LAST_NAME_NN CHECK
(LAST_NAME IS NOT NULL)
ENABLE;
ALTER TABLE EMPLOYEES
ADD CONSTRAINT EMP_SALARY_MIN CHECK
(SALARY > 0)
ENABLE;
COMMENT ON TABLE DEPARTMENTS IS 'Departments table that shows details of departments where employees
work. Contains 27 rows; references with locations, employees, and job_history tables.';
COMMENT ON TABLE EMPLOYEES IS 'employees table. Contains 107 rows. References with departments,
jobs, job_history tables. Contains a self reference.';
COMMENT ON COLUMN DEPARTMENTS.DEPARTMENT_ID IS 'Primary key column of departments table.';
COMMENT ON COLUMN DEPARTMENTS.DEPARTMENT_NAME IS 'A not null column that shows name of a department. Administration,
Marketing, Purchasing, Human Resources, Shipping, IT, Executive, Public
Relations, Sales, Finance, and Accounting. ';
COMMENT ON COLUMN DEPARTMENTS.MANAGER_ID IS 'Manager_id of a department. Foreign key to employee_id column of employees table. The manager_id column of the employee table references this column.';
COMMENT ON COLUMN DEPARTMENTS.LOCATION_ID IS 'Location id where a department is located. Foreign key to location_id column of locations table.';
COMMENT ON COLUMN EMPLOYEES.EMPLOYEE_ID IS 'Primary key of employees table.';
COMMENT ON COLUMN EMPLOYEES.FIRST_NAME IS 'First name of the employee. A not null column.';
COMMENT ON COLUMN EMPLOYEES.LAST_NAME IS 'Last name of the employee. A not null column.';
COMMENT ON COLUMN EMPLOYEES.EMAIL IS 'Email id of the employee';
COMMENT ON COLUMN EMPLOYEES.PHONE_NUMBER IS 'Phone number of the employee; includes country code and area code';
COMMENT ON COLUMN EMPLOYEES.HIRE_DATE IS 'Date when the employee started on this job. A not null column.';
COMMENT ON COLUMN EMPLOYEES.JOB_ID IS 'Current job of the employee; foreign key to job_id column of the
jobs table. A not null column.';
COMMENT ON COLUMN EMPLOYEES.SALARY IS 'Monthly salary of the employee. Must be greater
than zero (enforced by constraint emp_salary_min)';
COMMENT ON COLUMN EMPLOYEES.COMMISSION_PCT IS 'Commission percentage of the employee; Only employees in sales
department elgible for commission percentage';
COMMENT ON COLUMN EMPLOYEES.MANAGER_ID IS 'Manager id of the employee; has same domain as manager_id in
departments table. Foreign key to employee_id column of employees table.
(useful for reflexive joins and CONNECT BY query)';
COMMENT ON COLUMN EMPLOYEES.DEPARTMENT_ID IS 'Department id where employee works; foreign key to department_id
column of the departments table';

Similar Messages

  • My photos are  showing on my Apple TV and I don't want them to.  How can I get them off Apple TV and make sure this does not happen again?

    My photos are  showing on my Apple TV (I assume through the iCloud) and I don't want them to.  How can I get them off Apple TV and make sure this does not happen again?

    Welcome to the Apple Community.
    Settings > iCloud > iCloud photo settings, then turn off photostream and photo sharing.

  • How can I copy a double-sided document and make double-sided copies on an officejet 6830?

    how can I copy a double-sided document and make double-sided copies on an HP officejet 6830?

    Hi,The 6830 only provide double sided printing, it does not offer 2 sided copying, a such can only be done manually. You may find the printer specifications below:Scanning options (ADF): Single-sidedhttp://store.hp.com/UKStore/Merch/Product.aspx?id=E3E02A&opt=A80&sel=DEF#merch-tech-specs Regards,Shlomi

  • How can I cancel my apple ID account and make a new one

    How can I cancel my apple ID account and make a new one

    You can't cancel it. Stop using the old one.
    (68864)

  • I am in Brazil traveling tmw to NYC. I accidently turned on voice control and now cannot get back to settings icon to turn this feature off. How can I get back to the plain and simple ? Thks. This is urgent since the internet is very slow. Thks///

    I am currently in Brazil traveling back to NYC tmw. I accidently , .... playing around with my 13 yr old turned on the voice control.voice over (?) and signed in using "portuguese -Brazilian " as the language of choice even though for the past 4 months I had it set to U.S. English. Now it answers only in Music mode, won't move out of it and in a portuguese that sounds more lie martian than any language spoken on earth. How do I re-set the Nano, get out of this config and back to settings. Anyone out there with an answer since I would like to use tmw on the plane ride home  - 9.5 hours. Thks to all ////
    dp   

    How to reset iPod
    iPod Troubleshooting Assistant
    Finding the "Five Rs" of iPod troubleshooting
    iPod troubleshooting basics and service FAQ

  • How can i get adobe off my mac and make preview the default PFD viewer?

    that.

    Trash the adobe app (not necessary, but satisfying),
    trash any adobe pdf plugin in either Home/Library/Internet Plug-Ins/ or HD/Library/Internet Plug-Ins/
    restart any browsers, & you should have built-in pdf support within Safari, just as before adobe reader or acrobat was installed.

  • I forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    i forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    If you don't know your ID, you can try to find it as explained here: http://support.apple.com/kb/HT5625.  Then you can reset the password as explained here: http://support.apple.com/kb/PH2617.  Of course, you can only do this if it's your ID.

  • I have songs both purchased online and downloaded from cd's that itunes is unable to locate. What can I do to get them back and make sure it doesn't happen again as this is the second time this has happened?

    I have songs both purchased online and downloaded from cd's that itunes is unable to locate. What can I do to get them back and make sure it doesn't happen again as this is the second time this has happened?

    Great, that's what I was looking for.  Thanks for the quick response.  I knew that that feature existed in this router, but I couldn't remember what it was called or where to find it.
    The funny thing is, I recall distinctly setting up the DHCP reservation initially, but when I went to check it now, the reserved client list was empty.  I have no idea how it could have become depopulated, thus opening the door for internal IP address reassignment of the Remote Desktop computer which led to the RDP ports no longer being forwarded to the right internal IP address and thus the failure of the Remote Desktop connectivity.

  • How can i use JS files in ADF for language translation.

    Hi,
    I have JS for different languages and dn't want to convert them to property files(resource bundle files). How can i use JS files in ADF for language translation.
    Thanks

    Hi ILya Cyclone,
    Thanks alotfor the reply. Can you tell me where should i include this in the jspx page.
    Step 1)
    I have the js file as js/ifl_messages_US.js and i created a resource file as you mentioned: JS_FILE_PATH=js/ifl_messages_US.js
    Step 2)
    Then added the entry in faces-config.xml for the resource file as follow:
    <resource-bundle>
    <base-name>resource_en.properties</base-name>
    <var>resource</var>
    </resource-bundle>
    <locale-config>
    <supported-locale>en</supported-locale>
    </locale-config>
    Step 3) This is my jspx page. In which a table is dynamically created on page load. Can you help me where should i enter the "#{resource.JS_FILE_PATH}"
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:resource type="javascript" source="/js/pdfFile.js"/>
    <af:form id="f1">
    <input type="hidden" name="checkRadio" id="checkRadio" value=""/>
    <af:panelGroupLayout id="pgl1" halign="left" layout="vertical">
    <af:image source="/images/BRAND_IMAGE.gif" id="i1"/>
    </af:panelGroupLayout>
    <af:spacer width="10" height="10" id="s1"/>
    <af:table varStatus="rowStat" summary="table"
    value="#{backingBeanScope.DummyBean.collectionModel}"
    rows="#{backingBeanScope.DummyBean.collectionModel.rowCount}"
    rowSelection="none" contentDelivery="immediate" var="row"
    rendered="true" id="t1" styleClass="AFStretchWidth"
    binding="#{backingBeanScope.DummyBean.myTableBinding}"
    columnResizing="disabled">
    <af:column id="c2" headerText="Actions">
    <af:activeOutputText value="#{row.Actions}" id="aot2"/>
    <af:goLink text="#{row.Actions}" id="gl1"
    clientComponent="true" visible="false"/>
    <af:selectBooleanRadio text="" id="sbr1"
    valueChangeListener="#{backingBeanScope.DummyBean.checkselectbox}">
    <af:clientListener method="selectCheckBox" type="click"/>
    </af:selectBooleanRadio>
    </af:column>
    <af:forEach items="#{backingBeanScope.DummyBean.columnNames}" end="#{backingBeanScope.DummyBean.columnSize}"
    var="name" begin="1">
    <af:column sortable="false" sortProperty="#{name}"
    rowHeader="unstyled" headerText="#{name}"
    inlineStyle="width:100px;" id="c1">
    <af:activeOutputText value="#{row[name]}" id="aot1" escape="false">
    </af:activeOutputText>
    <!-- <af:outputFormatted value="#{row[name]}" id="of1"/>-->
    <!--<af:goLink text="goLink 1" id="gl1"
    destination="#{row.bindings.url.inputvalue}"/>-->
    </af:column>
    </af:forEach>
    </af:table>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks in advance

  • How can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?

    Hi,
    I would like to know as to how can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?
    Kindly advice.
    Thanks
    Priya

    Special > Hypertext > Command "open document" will do its best to open the target document inside FrameMaker, which may not be much help; Special > Hypertext > Command "message …" will use the application you specify. The user guide for 7.0 says this about absolute links, and I don't think anything has changed since:
    For example, to start PaintBrush and open the Ship.pcx file on drive C you would use the command message system pbrush.exe C:/Ship.pcx
    I've not often used a relative link, and not recently: the same source says
    folder levels are separated by a slash / even in Windows and Mac
    [relative links] FrameMaker searches for a relative pathname beginning in the folder that contains the current document
    [absolute links] FrameMaker searches for an absolute pathname beginning at the top of the file system. In Windows, the absolute pathname begins with the drive specifier, a colon and a slash.

  • How can i upload pictures in these forms to make my descriptions more easy?

    how can i upload pictures in these forms to make my descriptions more easy?
    thanks!

    Hi Ace -
    Images can't be uploaded to this forum, but they can be displayed inside your post (inline) by making them accessible on a website. In that case put the url between two exclamation ('!') points, e.g. \!www.apple.com\!. You'll find more formatting info at [http://discussions.apple.com/thread.jspa?threadID=121950].
    You can see how your post will appear by clicking the Preview tab above the "Post Message: Reply" editor panel. Another trick that might come in handy: If you want to see how someone else formatted their post, just click Reply, then click the double-quote (") icon just below the Preview tab.
    Hope that helps!
    \- Ray
    !http://imgs.xkcd.com/comics/substitute.png!
    !http://4.bp.blogspot.com/_337VLNYe7kY/StxyRZtIBII/AAAAAAAAJxI/4oP1f4qbz14/s400/l auradern.jpg!

  • How can i change the user on FaceTime? im trying to do this on a iMac

    how can i change the user on FaceTime? im trying to do this on a iMac

    I'm using an iMac with OSX 10.6.8.  The proceedure on your system is probably similar.
    Get the Facetime window up, and go to Facetime preferences.  Click on "account,"  you'll see a view account option that will prompt you to sign in with your Apple id and password.  From there you can make the changes that you want.

  • How can i delete movies from my macboook to make space and keep them on icloud?

    How can i delete movies from my macboook to make space and keep them on icloud?

    Since iTunes Match nor iCloud supports storing video content at this time (other than music videos purchased from the iTunes Store) what you want to do is not possible. There may be other cloud storage solutions out there, but none that integrate with iTunes.
    FYI, if any of the movies are purchased from the iTunes Store the service Apple calls iTunes in the Cloud by be a partial solution for you. However it is strongly recommended that keep a local backup of all your purchased media and not depend solely on a third party (Apple) to keep your data safe.

  • How can i transfer my rarely used applications and files so i can make room on my computer harddrive?

    how can i transfer my rarely used applications and files so i can make room on my computer harddrive?

    Well the applications you should leave alone as they install files elsewhere that are needed like preferences etc that won't be on the external drive if you attempt to run it from there.
    Some programs are completely self contained and will run just fine from a external drive, but applicaiton's are usually small.
    Now your user files! That could use some thinning for sure! Especially stuff you don't use that often and Video files which take up a lot of space.
    You can buy a external USB drive at any office / computer supply store and just plug it in and backup files via drag and drop.
    What happens when you plug in a drive is TimeMachine will pop up and ask to make it a TimeMachine drive, this just backups up everything on your computer to restore from in case your OS X or boot drive fails. It's a image of your drive and so whatever is on the boot drive is on the TM drive. So that doesn't server your purpose which is you want to free some space off your main boot drive.
    However you should get another drive and allow TM to do it's thing to that drive, also to make a hold option bootable clone of your boot drive (using yet another external drive) using Carbon Copy Cloner or SuperDuper so in case your boot drive fails you can quickly and easily boot off the clone and have a working machine right away.
    One of the posters here has a excellent instructions what does what, both should be used to backup your data.
    http://web.me.com/pondini/Time_Machine/Clones.html

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

Maybe you are looking for

  • Memory usage gets high and stays high

    I'll use my current project as an example, but I've been noticing this issue ever since I started monitoring my computer's memory usage. If I have an hour long Premiere CC timeline and render it, during rendering my computer's memory will go up to ab

  • Okay. Question for all those IT wirzards (

    Okay. Question for all those IT wirzards (& iTunes) experts out there. Anyone know why a playlist (Purchased) keeps dropping off my playlists in iTunes??l This has happened at least 15-20 times to me in the past couipe of years. Fofrtunately for me,

  • Export layers to files change from index color?

    Hello, can someone tell me how to change it where when I run the Export files to layers script in CS4 my pngs are saved as RGB instead of index color?  My original PSD that I am running the script on is RGB and it's driving me crazy that it's saving

  • Dynamic Credentials and Web Service Data Controls

    I've followed Steve Muench's post on using Dynamic Credentials (14.     Dynamic JDBC Credentials for Model 1 and Model 2 [10.1.3.2] 2006, Upd: 17-MAY-2007), which works fine with the ADF BC part of the project. However, the project also contains Data

  • Where are my pod casts gone

    Since upgrading to iOS 6.1.3 I can no longer find or play podcasts on my iPhone. They still update OK on my MacBook.