Urgent :: How to do Cascade delete in OA Framework??

I have built a employeeSearch page. The VO is based on only one EO that is EmployeeEO. This emp_id is referred in 4 other tables.
what i want to do is ---
when i delete the employee from employee Search Page. the corresponding records in other tables must get deleted.
Can i do a Cascade delete over here.
Please help.

Use a pl/sql api to do the cascaded delete and call it from OAF.
--Shiv                                                                                                                                                                                       

Similar Messages

  • How change JhsModel - FK FlexItemDefinition- FlexItem cascade delete?

    JHeadstart 10.1.3.2
    We are using FlexItems in our application.
    The JhsModel implementation, shipped in Jar file jhsadfrt-10.1.3.jar, contains the underlying ADF BC objects for the FlexItem functionality.
    We would like to change the functionality somewhat: when the user removes a flex item definition, we want to allow that and have all flexitems (instances of that definition) removed through a cascade delete. Unfortunately, the Associations/EOs in the JhsModel have not been set up that way.
    1) is there a specific reason why you chose the on delete restricted implementation or why we should not want to change that?
    2) what is a good strategy for making that change? (unzipping the jar, editing the xml files, rejarring?)
    thanks for your help
    Lucas

    Lucas,
    1. No good reason, we will change this for release 11.
    2. I would not recommend to change the jheadstart jar file. ADF Business Components has a mechanism called substitutions that you can use to specify your custom association. ALternatively, you can change the action behind the delete button and have it call an application module method that first deletes the children.
    Steven Davelaar,
    JHeadstart Team.

  • Problem with cascade delete and remove bean

    I am working with two entity beans that map to two tables that have a foreign key relationship. Table B has a foreign key to A and in the database that foreign key is set for cascaded updates and cascaded deletes.
    The problem occurs when the the sytem first tries to remove bean 1 (mapped to table A) and then remove bean 2 (mapped to B) where bean 2 is associated with bean 1 with a foreign key relationship. The first remove works but then when it tries to remove bean 2 it throws a very ugly "CORBA TRANSACTION_ROLLEDBACK 9998" Maybe exception. My guess is that the reason is because bean 2's reocrd in the database was deleted when bean 1 was removed but the 'bean object' was not removed from the container.
    When I go into our Application Server and look at how it see's the tables, it show the wrong relationship. It shows a restrict delete and a restrict update realationship.
    My question is, am I wrong to think that this is a application server problem or a configuration problem? It seems to me that attempting to remove a non-existant record should not cause an error. It won't cause any SQL exceptions. Is this a flawed viewpoint? As a work around I made sure that the dependent records are deleted first but it kind of defeats the point of cascaded deletes.
    We have a limited number of support calls, should I use one or am I at fault here?

    If the database removes the record from the second
    table, why is the system trying to remove it once
    again? You should try to remove an entity from a
    single place, should it be the database or the
    application. Don't try to remove it twice.
    Regards,
    DimitarI could do this but it is a huge pain in my ass. The problem is that you might want to remove the dependent bean without removing it's parent. The object structure is a little questionable, I'll admit that. It is, as they say, the eleventh hour and I can't really change that now.
    The way this work is that the server gets a list of objects marked either as new, modified, or deleted. It then relates those changes back to the database.
    In this case we have two lists(which makes me realize where the class structure sucks.) In order to do what you suggest I would have to get all the deleted parent objects and then search all the deleted child objects for ones that have the parent's key in them.
    It would be prefferable to fix the class structure but again this is not an option.
    Anyone want to answer the question I asked?

  • Cascade delete of products in APO

    Hi,
    I´m wondering if there are predefined ways for deleting a product and all it´s dependencies totally in APO. (Cascading deletion). I.e. setting a flag in the product master and getting rid of all connected PPM:s, location/product split, quota arrangements etc etc... Anybody knows how to do this efficiently?
    BR
    Karl

    Hi,
    I wish SAP has provided something like this.
    UNfortunately there is no one button where in you can delete all the dependencies
    Let me list you the steps to my best knowledge
    (1) Supply Chain Engineer --  TRansaction-- /n/sapapo/SCC07
    You can delete most of what you have asked
    Location, LOcation Product, Product, Resource, Trans Lane, PPM
    (2) Remember before this step, you will have to delete all the orders in all versions for this particular product location.
    Use report: /sapapo/rlcdelete to do this.
    Sometimes not all the orders get deleted and when you try to delete the master data in SCEngineer, it will say that there are dependencies.
    Then you would have to use the " WHERE USED LIST" for each master data and then it will display you the order numbers.
    You would have to manually delete each order number using the RLCDELETE report.
    Hope this helps.
    Regards
    Kumar

  • Cascade delete in many to many association

    Hi All,
        I have a usecase, there is an association with many to many cardinality  between 3 EO's. If i delete  any record in master, the corresponding childs all should delete.
        So appreciate if any alternatives on above usecase. Thanks in advance

    Hi,
    cascade delete is a function of the database. When you enable cascade delete for an entity operation then this only produces the proper SQL code for deleting a data object. If you have a many-to-many relation then this means you have multiple master and child records, which I think makes your "If i delete  any record in master, the corresponding childs all should delete" impossible.
    for what its worth, please read
    Creating a Business Domain Layer Using Entity Objects - 11g Release 2 (11.1.2.3.0)
    to learn how to parse and delete detail records  from an entity object
    http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcentities.htm#CEGJAFCF
    The last document is about posting orders (e.g. create a master record before you create detail records). However, with a few changes you can reverse this to perform a delete operation (just add this code to the entity impl classes of the entities so they delete their child objects
    Frank

  • Cascade delete in hibernate 3

    i am having a problem deleting child object
    here is my code
    my hibernate files are generated with xdoclet
    I want to remove an object AFVALSTOF with all it's childs. the relationship is bi-directional. parent object is AFVALSTOF and as example child is OVERBRENGER. the relationship is obligated (not-null="true")
    By viewing the hibernate logging i can see that the key field of the child is update to null first but this is an obligated field.
    Can anyone help me on how to define my relationship so i can execute the cascade delete?
    This is a part of my parent object (AFVALSTOF) which causes
    problems
    /     private Set overbrenger = new HashSet( );
         * @hibernate.set tablename="overbrenger" lazy="true" inverse="false"
         * cascade="all-delete-orphan"
         * @hibernate.collection-key column="ovbr_afvs_id"
         * @hibernate.collection-one-to-many class="be.milieuinfo.imjv.database.model.afval.Overbrenger"
         * @return Set
         public Set getOverbrenger() {
              return overbrenger;
         * @param overbrenger
         * Overbrenger
         public void setOverbrenger(Set overbrenger) {
              this.overbrenger = overbrenger;
    THIS IS THE CHILD (OVERBRENGER) which has a relationship to the PARENT called AFVALSTOF
    private Afvalstof afvalstof ;
    * @hibernate.many-to-one column="ovbr_afvs_id" class=
         * "be.milieuinfo.imjv.database.model.afval.Afvalstof"
         * not-null="true" inverse="true" cascade="all"
    * @return Afvalstof
    public Afvalstof getAfvalstof() {
         return afvalstof ;
    * @param afvalstof
    public void setAfvalstof(Afvalstof afvalstof) {
         this.afvalstof = afvalstof ;
    thnx
    Stefaan

    <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
      <class name="com.orly_otero.patterns.VO.ArticleVO" table="tblArticles">
        <id name="idArticle" type="long">
          <column name="id_Article" not-null="true"/>
          <generator class="native"/>
        </id>
        <property name="title" type="string">
          <column name="Title" length="200" not-null="true"/>
        </property>
        <property name="abstracT" type="string">
          <column name="Abstract" length="2000" not-null="true"/>
        </property>
        <property name="keywords" type="string">
          <column name="Keywords" length="200" not-null="true"/>
        </property>
        <property name="type" type="string">
          <column name="type" length="1" not-null="true"/>
        </property>
        <property name="position" type="integer">
          <column name="position" not-null="false"/>
        </property>
        <property  name="isBriefContribution" type="boolean">
          <column name="isBriefContribution" not-null="false"/>
        </property>
        <many-to-one name="issueVO" column="id_Issue" class="com.orly_otero.patterns.VO.IssueVO" not-null="true"/>
        <set name="authorsVO" table="tlbArticlesAuthors" lazy="true" cascade="save-update">
          <key column="id_Article"/>
          <many-to-many class="com.orly_otero.patterns.VO.AuthorVO" column="id_Author"/>
        </set>
        <set name="sectionsVO" inverse="true" lazy="true" cascade="all" order-by="position ASC">
          <key column="id_Article" not-null="true"/>
          <one-to-many class="com.orly_otero.patterns.VO.SectionVO"/>
        </set>
      </class>
    </hibernate-mapping>

  • EF database first cascades delete despite cascade is restricted in db and edmx setting End1/2 OnDelete = "None"

    We are developing with Visual Studio 2013, Entity Framework 5, Oracle DB 11 via ODP.NET managed driver.
    The edmx is generated/updated from database (database first). We generate POCO object using standard T4.
    We have 2 tables with a master-detail foreign key relation, one to many. The foreign key in database does _not_ allow cascade deletes, so when you delete master row via SQL, you get error " ... child record found ... ".
    The problem now is:
    In Entity Framework, when i delete a record from the master table, then EF also deletes all corresponding detail records from the detail table! The restriction of the foreign key in database is ignored.
    In edmx diagram, the properies End1 OnDelete / End2 OnDelete are set to "None", so i expect that on delete of a master row, EF should throw an error if detail rows exists.
    How can i disable the cascading of the delete?
    Here is the FK definition in edmx:
            <Association Name="USR_USER_ROLES_ROLES_FK">
              <End Role="USR_ROLES" Type="Self.USR_ROLES" Multiplicity="1" />
              <End Role="USR_USER_ROLES" Type="Self.USR_USER_ROLES" Multiplicity="*" />
              <ReferentialConstraint>
                <Principal Role="USR_ROLES">
                  <PropertyRef Name="GES" />
                  <PropertyRef Name="PROJ" />
                  <PropertyRef Name="ROLE_NAME" />
                </Principal>
                <Dependent Role="USR_USER_ROLES">
                  <PropertyRef Name="GES" />
                  <PropertyRef Name="PROJ" />
                  <PropertyRef Name="ROLE_NAME" />
                </Dependent>
              </ReferentialConstraint>
            </Association> 
     The delete of master row is done by calling:
    ivDbCtx.USR_Roles.Local.Remove(role); // ivDbCtx is the DbContext, USR_Roles is the collection, role is the POCO object to be deleted.
    Thank you very much for your help!
    Udo

    Hello,
    For issues regarding ODP.NET managed driver, I would suggest you posting to oracle entity framework forum:
    https://community.oracle.com/communications
    There are oracle entity framework expects who will help you better.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cascading Delete in BC4J-UIXml application

    Morning all,
    I have a problem with a UIXml application that I was wondering somebody could help me with. Since I am new to this technology, please excuse the simplistic nature of the question.
    I have a BC4J application working through UIX pages. In this application I have a form that deletes a record from the table. However, I am unable to determine how to perform an automatic cascading delete on the record since it has child records in another table.
    Please advise. I shall update this thread after a successful workaround in order to provide a reference for others who may encounter this problem.
    Thanks in advance for reading this post.
    Adeel

    This was resolved in the entity's association properties.

  • Question on Cascade Deletes

    All,
    Facts :
    1) I have 2 tables 150mil rows (table A) and second 125 mils rows (table B).
    2) Table A <-> B is having FK 1:1 relationship and delete on table A is cascade delete on B
    Issue : We are missing 25 mil rows in table B, and trying to delete Table A records with a PK in the where clause, I discovered that the cascade delete tries to Delete records in table B there are no records related to table A and it does a full table scan.
    Question : How to delete the 25 mil rows effectively.
    1) create index on table B same as PK of A and delete records from table.
    2) Drop the FK constraint on table B and delete the records from table A and re-create the constraint.
    Which one would be faster ?
    Thanks,
    SS

    Pransuj,
    You too! do not read the posts.
    Have you heard about the concept of Partition
    Tables.
    Heard about Partition, Used it Extensively. Partitioning is not available at my clients place.
    If I were you and have tables with that many millions
    of rows, I would go for partition tables. If you have
    partitioned tables you would not have run into these
    kinds of problems
    Not good enough Statement or reason to do Partitioning.
    SS

  • On cascade delete

    I have two table profile and salary. salary.id is the foreign key of profile.id. During the creation of table I haven't called on cascade delete.
    Now I want to delete a row from profile.id, which will not delete because primary.id has been used in salary.id. How do I forcefully delete the row from profile.id and leave salary.id row as it is?

    csckid wrote:
    I have two table profile and salary. salary.id is the foreign key of profile.id. During the creation of table I haven't called on cascade delete.
    Now I want to delete a row from profile.id, which will not delete because primary.id has been used in salary.id. How do I forcefully delete the row from profile.id and leave salary.id row as it is?If you have not enabled ON DELETE CASCADE then you must delete the salary table records first and then delete profile table records.

  • Db-cascade-delete for other databases than Oracle?

    I have two entity beans with a one to many relationship. The database designers have implemented a cascading delete between the two tables for the entity beans. How should the deployment descriptors be written for this to work properly? From what I understand I will need to use the <cascade-delete /> tag in ejb-jar.xml and <db-cascade-delete /> in weblogic-cmp-jar.xml. However this document http://e-docs.bea.com/wls/docs81/ejb/entity.html states that <db-cascade-delete /> only works for Oracle, and I'm using DB2. Does this mean that I have to remove the cascading delete in the database and only enable it in ejb-jar.xml, or will <db-cascade-delete /> work for other databases than Oracle?
    /Björn

    To get the certified answer I'd ask a tech support rep. Unofficially, if DB2 supports cascade delete then I would expect that the EJB container will work with that. There are issues surrounding certification of features against specific databases and I'm not up on all of these so I'd check with support.

  • How to add the delete button

    Hello Guru's and Experts.
    I am working on a change request , the change request is as follows
    Once a cost simulation is run for a maintenance item and the data transferred to BI, it cannot be deleted from BI, only overwritten with an updated cost simulation. In the instance where the such items are no longer required to be included in the simulation, it must be made possible to delete the simulation costs in BI.
    The current design in my project significantly increases the effort required to identify unwanted cost simulations and greatly increases the potential for incorrect data to be used in Budgeting and forecasting.
    My question is how to add the delete functionality in the report. is it acheavable through the portal or WAD,
    iam new to SAP BI , if possible can anyone kindly suggest me the steps to do this functionality.
    Appreciate your quick response..
    Thanks
    Ravi.

    Hi Guru
    Thanks for your valuable information.
    We got the requirment changed now from the users , the delete button should display in the report, i mean in protal, Now the user wants to delete with the selection criteria, for example, once the user hits the row in the report, that means if he selects the Main work center, and selects the delete button , he wants all the data related to that main work center to be deleted.  and another senario is what ever row the user selects  the characteristics in the row, for example, if the user select  for any row, i mean it can be any cost center or fiscal year, maintaiance item, cost elements, ..etc.  
    Once the user  selects the row and hit the delete button,  and he wants to hit the save save button in the report to make sure it deleted, the other way around , if the dont want to hit save, then he wants the data to be in the report.
    In the above  scenario's  can  you please suggest me with the steps how can we acheive it.
    Please reply back if you need any other info., Apprieciate your quick response. its very urgent requirment which we have to start...
    sorry to bother u..
    Thanks
    Ravi.

  • Cascade Deletes

    Could anyone please suggest how the following could be done programatically i.e without using database triggers?
    I have a Java form created using InfoSwing components where the Master-Detail relation is nested to several levels ( like Master-Detail-Detail ). When a user deletes a record in the master table by pressing the delete button in the navigation bar, the records the detail tables should also be deleted.
    Thanks.

    Try using the on delete cascade with your foreign key constraint
    and drop the trigger. Mutating table errors are normally caused
    by using row level triggers on constraining tables which change
    as a result of an insert, update, or delete of the master table.
    These triggers can not issue dml against the table that is
    "mutating" (changing), which is the primary table or child table
    if constraint is created using cascade. This is a general rule.
    See specific rules in oracle documentation if you are serious
    about using triggers.
    Tom Niderost (guest) wrote:
    : How do I perform a cascade delete in Oracle? I tried using
    : "Delete on Row" triggers to delete child data, but when the
    child
    : table had a "Delete on Row" trigger, I got a "Mutating Table"
    : error. Help!
    null

  • For some reason, I cannot change my desktop background no matter how many times I delete the "active" folder.  It's as if it's locked.  Any ideas how I can fix it?

    For some reason, I cannot change my desktop background no matter how many times I delete the "active" folder.  It's as if it's locked.  Any ideas how I can fix it?

    Yes it sounds like you have a corrupted preference file.
    The setting you make in individual programs get saved to a Preference file in your Users/Library/Preferences folder.
    All you have to do is drag out the old file to the desktop, reboot and load the program and the preference file gets rebuilt without your preferences which you reset.
    For your case I beleive the preference file is
    com.apple.desktop.plist

  • Weblogic 9.1, EJB 2.0, Oracle 9i: Cascade delete Error

    Hi All,
    I am facing an error with the cascade-delete facility in ejb2.0 with weblogic 9.1
    Assume that I have the following relation:
    <ejb-relation>
    <ejb-relation-name>TeacherEJB-StudentEJB</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>teacher-has-student
    </ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>TeacherEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>teacher</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>student-has-teacher
    </ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <cascade-delete/>
    <relationship-role-source>
    <ejb-name>StudentEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>student</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type><cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    Now when I have to delete one record from the DBSTUDENT table, what i do is the following:
    StudentHomeLocal.remove(studentModel.getStudentId());
    The above statement throws an SQLException staying it can't update TeacherID in DBSTUDENT (PK of DBTEACHER, FK in DBSTUDENT) with NULL.
    The same code is working perfectly well in Weblogic 8.
    I even tried deleting the local directly by the following statement:
    StudentLocal.remove();
    But this too doesn't work.
    I also tried by removing the <cascade-delete/> attribute from the ejb-jar.xml file and updating the 'on-delete cascade' option in the database, but this too did not work.
    There is another option of <db-cascade-delete> in weblogic-cmp-rdbms-jar.xml that I tried but this too did not work.
    In short, I have tried the following cases but to no avail:
    1. Mention cascade delete in ejb-jar.xml and nothing mentioned in weblogic-cmp-rdbms-jar.xml.jar and in the database.
    2. Mention nothing in ejb-jar.xml and nothing mentioned in weblogic-cmp-rdbms-jar.xml.jar but 'on cascade delete' mentioned in the database.
    3. Mention cascade delete in ejb-jar.xml and db-cascade-delete mentioned in weblogic-cmp-rdbms-jar.xml.jar and 'on cascade delete' in the database.
    4. Remove all cascade delete from the ejb-jar.xml,the weblogic-cmp-rdbms-jar.xml and from the database.
    Neither of the above work.
    Kindly help ASAP.
    Thanks in advance,
    Sachidanand.

    Hi All,
    I am facing an error with the cascade-delete facility in ejb2.0 with weblogic 9.1
    Assume that I have the following relation:
    <ejb-relation>
    <ejb-relation-name>TeacherEJB-StudentEJB</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>teacher-has-student
    </ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>TeacherEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>teacher</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>student-has-teacher
    </ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <cascade-delete/>
    <relationship-role-source>
    <ejb-name>StudentEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>student</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type><cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    Now when I have to delete one record from the DBSTUDENT table, what i do is the following:
    StudentHomeLocal.remove(studentModel.getStudentId());
    The above statement throws an SQLException staying it can't update TeacherID in DBSTUDENT (PK of DBTEACHER, FK in DBSTUDENT) with NULL.
    The same code is working perfectly well in Weblogic 8.
    I even tried deleting the local directly by the following statement:
    StudentLocal.remove();
    But this too doesn't work.
    I also tried by removing the <cascade-delete/> attribute from the ejb-jar.xml file and updating the 'on-delete cascade' option in the database, but this too did not work.
    There is another option of <db-cascade-delete> in weblogic-cmp-rdbms-jar.xml that I tried but this too did not work.
    In short, I have tried the following cases but to no avail:
    1. Mention cascade delete in ejb-jar.xml and nothing mentioned in weblogic-cmp-rdbms-jar.xml.jar and in the database.
    2. Mention nothing in ejb-jar.xml and nothing mentioned in weblogic-cmp-rdbms-jar.xml.jar but 'on cascade delete' mentioned in the database.
    3. Mention cascade delete in ejb-jar.xml and db-cascade-delete mentioned in weblogic-cmp-rdbms-jar.xml.jar and 'on cascade delete' in the database.
    4. Remove all cascade delete from the ejb-jar.xml,the weblogic-cmp-rdbms-jar.xml and from the database.
    Neither of the above work.
    Kindly help ASAP.
    Thanks in advance,
    Sachidanand.

Maybe you are looking for

  • User exit to check the consistency of filled fields before saving

    Hi, I am looking for a User Exit which can be executed when a user click on "Save" button. In this User Exit, I would like to implement some controls to check the consistency of filled fields. I have an example to better understand : I work on transa

  • Can I install windows essentials in firefox instead of internet explorer

    recently installed windows essentials on internet explorer in order to use windows live mail, but would like to have it on firefox. Didnt see a firefox option on the download.

  • Find my photos

    I just came back from the Apple store where the Genius deleted everything on my phone (was having trouble with battery life). I was then instructed to go home, sync my phone as a new phone and assured that I would be able to sync photos, contacts, et

  • Photoshop CC - where art thou?

    Hi!I would like to install Photoshop CC on my machine. I don't see it in 'APPS' on my Creative Cloud desktop though. All I see is Photoshop CC 2014 - which I have installed and will not open some of my work files (which were created in Photoshop CC).

  • Cisco asa cold start

    Hello, I have 4 Cisco ASA 5520 devices in our network.  One of them did a cold start a few days ago.  Only 4 people have access to the device including myself.  I dont think any of the 4 people rebooted the ASA.  No one was in the server room on that