Managing M:M relationship

Hi all,
i am looking for the best way or suggestions about managin an M:M relationship with apex.
Here is my structure:
TABLEA_
ID_A
DESC_A
TABLEB_
ID_B
DESC_B
TABLEMM_*
ID_A*
ID_B*
Wich is the better way to "DML" the TABLE_MM?
Thanks for any kind of help.

User,
What is your name?
This really depends on the underlying data and the application in general. I tend to code screens that deals with one side of the equation but I do it both ways. Say for example I have a CUSTOMERS table and a SERVICE_REPS table but I want to allow for customers to have multiple service reps and service reps to have multiple customers so I create an intersect table CUSTOMER_SERVICE_REPS.
I wouldn't try to maintain the CUSTOMER_SERVICE_REPS table directly in this case, although that's possible. Instead I would first think about my customer maintenance screens and maybe use a shuttle or report to display the various service reps assigned to the customer. This would allow the user to add/remove service reps from one customer at a time.
Then I would do the same for the service reps maintenance screens. I would give the user the ability to add/remove customers from one service rep at a time.
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
http://sourceforge.net/projects/plrecur
You can reward this reply by marking it as either Helpful or Correct ;-)

Similar Messages

  • Management of Beanu00B4s Relationships in Development Components

    Hi,
    I´m developing a project where I need to use DC for reutilization. I have already created two DC, one DC that contain an entity bean call Improvement and other DC that contain an entity bean call LongText that has the Improvement primary key like a foreign key. So, I need to establish an one to many relationships between the entity beans that are in different development components, but I created the LongText public parts and I did add them to the Improvement Used DCs, and I did create the relationship between the two of them in the ejb-jar.xml of the Improvement DC because I need it to be unidirectional, but doesn´t appear for add the relationship in the persistent.xml.
    I´m using the SAP Developer Studio 2.0 SP13.
    If someone know what can be the error, I will we grateful.
    Regards

    Hi Experts,
    Could you please reply any one.
    Thanks in advance.
    Regards,
    Jyothi

  • Container managed persistance: many-many relationship

    Here's the scenario:
    table STUDENTS has columns ID, NAME
    table CLASSES has columns ID, TITLE
    table STUDENT_CLASSES is an intersection table with columns STUDENT, CLASS which are foreign keys to the ID columns in the STUDENTS and CLASSES tables
    How do I specify to OC4J that it should use the STUDENT_CLASSES table to facilitate the container managed many-many relationship?

    Voytek -- I would use the ormap demo (projects to emps relationship) as an example and see what exists from deploying that. I've included the original ejb-jar.xml entry as well as a trimmed down version of the orion-ejb-jar.xml entry. In this case it is the default mapping but what you would need to do is include an orion-ejb-jar.xml with just the parts you want to control.
    <ejb-relation>
    <ejb-relation-name>Emps-Projects</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Projects-have-Emps</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>ProjectBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>employees</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Emps-have-Projects</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>EmpBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>projects</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    <entity-deployment name="ProjectBean" location="ProjectBean" table="ProjectBean" >
    <primkey-mapping>
    <cmp-field-mapping name="projectNo" persistence-name="projectNo" />
    </primkey-mapping>
    <cmp-field-mapping name="projectName" persistence-name="projectName" />
    <cmp-field-mapping name="employees">
    <collection-mapping table="EmpBean_projects_Proje__296v53">
    <primkey-mapping>
    <cmp-field-mapping name="ProjectBean_projectNo">
    <entity-ref home="ProjectBean">
    <cmp-field-mapping name="ProjectBean_projectNo" persistence-name="ProjectBean_projectNo" />
    </entity-ref>
    </cmp-field-mapping>
    </primkey-mapping>
    <value-mapping type="hr.EmpLocal">
    <cmp-field-mapping name="EmpBean_empNo">
    <entity-ref home="EmpBean">
    <cmp-field-mapping name="EmpBean_empNo" persistence-name="EmpBean_empNo" />
    </entity-ref>
    </cmp-field-mapping>
    </value-mapping>
    </collection-mapping>
    </cmp-field-mapping>
    ... finder methods removed ...
    </entity-deployment>
    I hope this helps -- Jeff

  • Creation of relationship instances using Java

    Hi,
    I have the same problem as described in this thread: Creating a Relationship between 2 PublicObjects needs admin privilages
    Because nobody answered the original question, I post mine now:
    I am trying to create a custom relationship between two iFS documents. I follow exactly the procedure described in the developpers guide of Oracle 9iFS (9.0.1). It is nowhere mentioned that administrative rights are needed to instanciate relationships. However this is exacly the compaint iFS is sending back to me: I must switch to administrative mode before creating the relationship between two objects.
    I guess I am not the second people trying to instantiate relationships in iFS. Is it a policy, property or ACL problem ?
    Is there a workaround for this ? Unfortunately, I have no admin session available at the time of the relationships creation.
    Thanks,
    Tristan

    I finally managed to create relationships without switching to administrative mode.
    The clue is in the "<oracle.ifs.beans.PublicObject>.addRelationship" method.
    The code on page 6-52 of the Developer Reference of iFS 9.0.1.1.0 describes how to relate two objects po1 and po2 with a relationship.
    po1 is set as the left object and po2 is set as the right object.
    rdef is an object describing the to be created relationship.
    The last statement is:
    Relationship r =(Relationship) session.createSystemObject(rdef);
    This is what I used in my code and was not working. Now, I am using the method "addRelationship(rdef)" to create relationships (described in the JavaDoc), and that one is working as expected:
    po1.addRelationship(rdef);

  • Hr abap issue find the manager name and mail-id

    hi all,
    my requirement is below this. can any one help me to send code for this requirement.
    1.Logic for Employee status: Check if employee position has any other position reporting to it. Check if a record exists in HRP1001 where OTYPE = u2018Su2019, PLVAR = u201801u2019, RSIGN = u2018Au2019, RELAT = u2018002u2019, ISTAT = u20181u2019, BEGDA <= start date in selection, ENDDA >= end date in selection, SCLAS = u2018Su2019 and SOBID = Position. If yes set Employee Status as u2018Manageru2019. Else set as u2018Non-Manageru2019
    2.Manager name/Email: Identify the reporting position through B002 relationship from HRP1001. For this reporting position identify the Manager by A008 relationship. For this personnel number retrieve Name from IT0001 and Email ID (USRID) from IT0105 SUBTYPE as u20180010u2019.
    thanks & regards
    revathi raj.
    Edited by: revathi raju on Sep 5, 2008 12:06 PM

    thanks

  • Importing relationship data

    Hello,
      Any one could explain me steps for importing relationship data,  pre-requisites, source file structure.
      I am very much confused about field mapping. It always give me error Failed to find the aggregation record from its field values.
    Any one having document related to this plz send at
    abhijeet.more_at_yahoo.co.in

    Hi Mircea,
    It worked fine for me when i import Relationship Data of Type Parent/Child  either using Data Manager or using Import Manager.
    But the Problem is that if i create relationship of Type Sibling say relationship name "Related_Item" then during Import using Import Manager this "Related_Item" relationship is not enabled when i select into Destination Table. So how to enable this as it is enabled for Parent/Child relationship during Import Manager.
    So, i m able to import relationships of Type Parent/Child when created into relationship table of MDM Console. But Relationship of Type Sibling Created in MDM console is not imported using MDM Import Manager but sucessfully exported and imported Relationship of  Type Sibling using MDM Data Manager.
    So, Could you please check and tell how to import this Relationship of Type Sibling when created into Relationship table of MDM Console using MDM Import Manager.
    Thanks,
    Mandeep Saini

  • Does WLS 6.1 sp2 allow (bean managed) entity beans to have transaction mode NOTSUPPORTED?

    Hi,
    I have created two bean managed entity beans, User and Role, abstracting users
    and groups in a ldap base. A User may have more than one Role. This is represented
    by a (bean managed) 1:many relationship directed from User to Role. For some weird
    reasons I get a transaction rollback when reading data, when transactions are
    turned on (REQUIRED).
    While we where running WLS 6.1 sp1 we had no problems with this as we could set
    transaction to NOTSUPPORTED for these two EJBs. Due to other hickups we had to
    upgrade to sp2 and suddenly the error reappears leading me to believe that NOTSUPPORTED
    isn't allowed anymore by the WLS. I know that NOTSUPPORTED isn't required by the
    EJB spec, but containers may support it and obviously WLS used to do just that.
    I have not seen any change in the release notes of sp2 that indicates that this
    behaviour has changed.
    Does anybody know if WLS really doesn't support NOTSUPPORTED for enity beans anymore
    in sp2?
    If anybody are curiuos or have any good ideas, the stacktrace I get is:
    javax.ejb.TransactionRolledbackLocalException: EJB Exception:
    - with nested exception:
    [javax.ejb.EJBException
    - with nested exception:
    [weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=weblogic.ejb20.internal.TxManager$TxListener@1c2906 - with nested exception:
    [java.util.ConcurrentModificationException]]]
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
         javax.ejb.TransactionRolledbackLocalException: EJB Exception:
    - with nested exception:
    [javax.ejb.EJBException
    - with nested exception:
    [weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=weblogic.ejb20.internal.TxManager$TxListener@1c2906 - with nested exception:
    [java.util.ConcurrentModificationException]]]
    java.util.ConcurrentModificationException
         at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:535)
         at java.util.LinkedList$ListItr.next(LinkedList.java:476)
         at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:370)
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:481)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:980)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1504)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:216)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
         at weblogic.ejb20.internal.BaseEJBLocalObject.postInvoke(BaseEJBLocalObject.java:207)
         at com.takecargo.domainentities.role.RoleBean_1ipw6_ELOImpl.getName(RoleBean_1ipw6_ELOImpl.java:86)
         at com.takecargo.domainentities.role.RoleConverter.getVOforRoleLocal(RoleConverter.java:51)
    Any kind of help would be appreciated:)
    Regards,
    Brynjar Glesnes

    WLS support NotSupported on Entity Beans.
    It looks like you've hit a bug in the EJB container where an internal Collection class has been modified while the
    container is running through an iterator on it.
    You should open a case with [email protected]
    -- Rob
    Brynjar Glesnes wrote:
    Hi,
    I have created two bean managed entity beans, User and Role, abstracting users
    and groups in a ldap base. A User may have more than one Role. This is represented
    by a (bean managed) 1:many relationship directed from User to Role. For some weird
    reasons I get a transaction rollback when reading data, when transactions are
    turned on (REQUIRED).
    While we where running WLS 6.1 sp1 we had no problems with this as we could set
    transaction to NOTSUPPORTED for these two EJBs. Due to other hickups we had to
    upgrade to sp2 and suddenly the error reappears leading me to believe that NOTSUPPORTED
    isn't allowed anymore by the WLS. I know that NOTSUPPORTED isn't required by the
    EJB spec, but containers may support it and obviously WLS used to do just that.
    I have not seen any change in the release notes of sp2 that indicates that this
    behaviour has changed.
    Does anybody know if WLS really doesn't support NOTSUPPORTED for enity beans anymore
    in sp2?
    If anybody are curiuos or have any good ideas, the stacktrace I get is:
    javax.ejb.TransactionRolledbackLocalException: EJB Exception:
    - with nested exception:
    [javax.ejb.EJBException
    - with nested exception:
    [weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=weblogic.ejb20.internal.TxManager$TxListener@1c2906 - with nested exception:
    [java.util.ConcurrentModificationException]]]
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    javax.ejb.TransactionRolledbackLocalException: EJB Exception:
    - with nested exception:
    [javax.ejb.EJBException
    - with nested exception:
    [weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion:
    sync=weblogic.ejb20.internal.TxManager$TxListener@1c2906 - with nested exception:
    [java.util.ConcurrentModificationException]]]
    java.util.ConcurrentModificationException
    at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:535)
    at java.util.LinkedList$ListItr.next(LinkedList.java:476)
    at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:370)
    at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:481)
    at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
    at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
    at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:980)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1504)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:216)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
    at weblogic.ejb20.internal.BaseEJBLocalObject.postInvoke(BaseEJBLocalObject.java:207)
    at com.takecargo.domainentities.role.RoleBean_1ipw6_ELOImpl.getName(RoleBean_1ipw6_ELOImpl.java:86)
    at com.takecargo.domainentities.role.RoleConverter.getVOforRoleLocal(RoleConverter.java:51)
    Any kind of help would be appreciated:)
    Regards,
    Brynjar Glesnes

  • Position Holder relationship Time Constraint

    I have received a unique requirement from my client.  They want only one employee to hold one position and on position only to be held by one employee.  This in itself is the easy part. 
    However, for contingent workers (non-employees) that want to be able to tie multiple people to one position.
    Has anyone ever done this?  If so, how?
    Any additional information that anyone can provide would be much appreciated!

    Hi - You stated the following  - see my notes in Bold:
    You can either turn off the '100%' check for all Positions or make it a Warning or Information instead of an Error. This affects all Positions.  - Not an option as this should throw an error for employees.
    Personnel Management > Organizational Management > Basic Settings > Relationship Maintenance > Maintain Relationships
    Click on Holder (008) > click on 'Relationship Characteristics' > W - Warning or I - Information
    You can also Change the time constraint for the Position to Person A008 part of the relationship.  Also, not an option as we want employee positions to error - only for non-employee positions should this be allowed.
    Personnel Management > Organizational Management > Basic Settings > Relationship Maintenance > Maintain Relationships
    Click on Holder (008) > click on 'Time constraints' > Click on 'A008' > Choose '3'
    You can also, set the 'Staffing' Percentage' on the Relationship Infotype - A008 - holder to a blank.

  • Finding all employees who come under the manager

    Hi experts,
    I have created a report which is attahced in MSS. So i want to restrict the manager to view the details of  only the employees who come under this manager.  At present the report is showing the details of all employees. So pls tell me whehter i can use O-S-P relation for finding all direct and indirect employees of the mnagaer by passing the org unit of the manager (or) should i need to find all position holders who report to the manager's position?..  If so, how?
    Finding the list of all employees who come under manager org unit is same as finding the list of position holders who report to the manager position? Pls telll me which is correct and how to find the same?

    hello shanthi,
    mashhour is right, it largely depends on how data is being maintained in your system.
    first, you are generally mixing two concepts together of finding "direct" & "indirect" employees for a manager. In standard implementations, typically the data is maintain in such a way where only 1 method is appropriate to find a manager's employee, and the most common scenario is where the employee has an indirect relationship with their manager. 
    So typically the two are not used together.  In certain circumstances companies will implement both to create matrix like scenarios, but they are better ways to handle this. 
    The indirect method: is called this way, because the manager has a relationship to an org unit as the chief (a012), and his/her employees are in positions, which have relationships to those same org units, hence no direct relationship.
    In the direct method, a relationship is created directly between the manager's position and any subordinates positions using the A/B 002 relationship. 
    Assuming that you are using indirect only, then O-S-P with no depth defined, will all employees belonging to that entire org structure.  this is assuming your program knows the root ID of the manager relationship, which is the a012 to the root org unit. 
    best regards,
    michael

  • Have trouble with CMP and relationships

    Hello and Thank you for your time.
    I'm having a bit of trouble using entity beans and CMP, I'm probably doing some thing wrong. The main problem I am having is with a many to many relationship. Let's say I have the following code:
    ClassA.java
    @Entity
    public class ClassA implements Serializable {
    <other variables>
    private Collection<Class1> class1Collection;
    <other methods>
    @ManyToMany(cascade=CascadeType.ALL, mappedBy = "classACollection")
    public Collection<Class1> getClass1Collection() {
    return class1Collection;
    public void setClass1Collection(Collection<Class1> class1Collection) {
    this.class1Collection = class1Collection;
    Class1.java
    @Entity
    public class Class1 implements Serializable {
    <other variables>
    private Collection<ClassA> classACollection;
    <other methods>
    @ManyToMany
    public Collection<ClassA> getClassACollection() {
    return class1Collection;
    public void setClassACollection(Collection<ClassA> classACollection) {
    this.class1Collection = class1Collection;
    In the 'other variables' each table has a @Id field and setters and getters for the Id.
    This code half works. If I set the collection in ClassA with a Collection of Class1 objects this is populated in to the database and the getClass1Collection method for this also works. If I then try to use the getClassACollection method from a Class1 object the entity manager throws a relationship not complete exception (or some thing to that effect). it is also the case that if I create a list of ClassA objects and place it in to the Class1 objects variable, this does not populate in to the database.
    Some thing similar also happens with OneToMany and ManyToOne relationship (only one side of the relationship seems to be part of the relationship)
    What am I doing wrong?
    Edited by: tehBoris on Mar 26, 2010 1:18 PM

    Yes, that's as it should be, but I think the problem is the default for adding the auto page numbers. The default on the top of the dialog box that appears when you choose Auto Page Numbers from the menu says:
    Show in Document.
    That seems to be the default.  Page numbers in sections won't work with that default. To get it to work, you have to select:
    Show in Current Section.
    I think I'm right on this, but I'm not sure. I'll have to practice some more. Perhaps this is a default that should be changed in the next version, but I don't know.
    Tom

  • Explanation of Knowledge Management, Content Management...

    Hi guys,
    I'd like to get some information about Knowledge Management, Content management and their relationship to the Enterprise Portal.. How it can be used in the EP, whether it can work independently...  Everything about it..
    COuld you send pls some links? I couldn't find any useful ones...
    Thanx in advance!
    Peter
    p.s. Points are guaranteed

    Hi
    These links may be useful
    http://help.sap.com/saphelp_crm30/helpdata/en/4f/21f738121e2d32e10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_ep60sp0/helpdata/en/4a/725b3bad64474ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/4c/9d953fc405330ee10000000a114084/content.htm
    Regards
    Sai
    Message was edited by: Karsten Hohage

  • Create external relationships in OM

    Hi all,
    i need to manage an external relationships in OM, can you give please some informations/links or tips for that ?
    Thanks so much
    Regards

    up

  • Create external relationships

    Hi all,
    i need to manage an external relationships in OM, can you give please some informations/links or tips for that ?
    Thanks so much
    Regards

    up

  • Mss for Professional manager

    In our manager most of the manager that had relationships of chief used MSS.
    There is also a Professional  manager for example a nurses professional  manager that responsibe not direct but Professional on all the nuses in the organization. She had a special realationship  from her position the organization and had authorization to display data of all the nurses un that organization.
    Is there a way to give her permission to see with the same standard iview of mss like "my workers" to see detail of workers and run reports of only nurses and not workers with other job in that organization Or the Mss iview is custom for chief position only?
    Ofer

    You can create your own evaluation path and add this particular relationship to the evaluation
    take for exmple MSSDIREC or SAP_MANG in T778A, these are used in standard if you have to assign it to the
    new path you make using OADP ie Object and Data Provider
    http://help.sap.com/saphelp_erp2005/helpdata/en/ee/63ef41925b2135e10000000a1550b0/frameset.htm

  • How does Ejb maintain relationship

    How does EJB maintain a link between the EJBRemoteObject,EJBHome and
    the EJBClass
    and why does EJBClass implements SessionBean and the rest of the classes extend a paticular classes.
    What is their relation.

    EJBRemoteObject (or EJBObject) and EJBLoclaObject are interfaces that user can use to access an object. If you use remote object user can access the object remotely. Local object can be accessed remotely only via another session bean that locates in the JVM of local bean and implements remote interface.
    The EJBHome and EJBLocalHome are factories of objects. User uses them like:
    UserHome userHome = JNDI.getRootContext().getObject("EJB/UserBean").narrow(UserHome.class);
    User user = userHome.create("Andreas", "Papandreas");
    user.setRole("admin");
    // here UserHome is interface extending EJBHome
    // here User is interface extending EJBObject
    // User looks like EntityBeanEJBClass that implement SessionBean or EntityBean are abstract classes. They will be extended by application server. The application server creates stubs for client JVM as well. These subs marshall data to EJBClass on server. You may override some methods in EJBClass, for example initializing some fields on object creation. Setters and getters (required in entity beans) remain abstract in the EJBClass, they are left for application server implementation.
    I have all this info from good tutorial at IBM's site http://www-106.ibm.com/developerworks/views/java/tutorials.jsp. Tutorial is called "Introduction to container-managed persistence and relationships
    ", Parts 1-4.

Maybe you are looking for

  • Using RFC Look Up in Java Mapping

    Hi All, I need to do an RFC Look Up in a Java Mapping program. The response structure of the Function Module to be called consists of only one node called RESULT. In order to read the value exported by the function module in this export parameter RES

  • Upgrade iPhone 3G to iPhone 4

    Upgraded to iPhone 4, I'm sorry I waited so long, works flawlessly, overall performance and signal quality exceeds the already great iPhone 3G. I have no "death grip" effect that is spoken of although I did take advantage of the Apple bumper program,

  • View images on canvas?

    I sometimes need to resize banner ads created in photoshop. If I open the file and resize the canvas, some layer elements become hidden on far corners of the canvas. Usually I can click around and drag them into the visible area of my file. Sometime

  • "about:config" is a tool for customization, what other "about" tools are there?

    I previously came across an article that said that Firefox had other "ABOUT" commands that could be used in the navigation toolbar. what are they?

  • Multiple printer destinations

    Hi, How can I schedule a report to run on multiple print destinations(i.e. printer1, printer2, printer3) using the BI publisher web service integration? Thank You,