Sevlet - ejb relationship

hi. i have a rather simple question. if a servlet were to instantiate
          and ejb, would there be a way for that ejb to get access to the
          servlet's session context. i know that an ejb can get access to its
          container via SessionContext, but what about a session of a servlet
          which called the ejb? thanks!!!
          

A servlet will do that exactly the same way as a client application.
          except if you are running in the same VM, you can do "new InitialContext()"
          without any parameters.
          Filip
          ~
          Namaste - I bow to the divine in you
          ~
          Filip Hanik
          Software Architect
          [email protected]
          www.filip.net
          "Mikhail Perelman" <[email protected]> wrote in message
          news:[email protected]..
          > hi. i have a rather simple question. if a servlet were to instantiate
          > and ejb, would there be a way for that ejb to get access to the
          > servlet's session context. i know that an ejb can get access to its
          > container via SessionContext, but what about a session of a servlet
          > which called the ejb? thanks!!!
          >
          

Similar Messages

  • NullPointerException at EJB-Relationship

    Hi:
    I'm trying to create a relationship between to CMP 2.0 entites using JDeveloper.
    It's a unidirectional One-to-Many relation between Car-producer and Car-typs.
    The car-type-bean has the producer number as a foreign key.
    I have generated the EJB'S with UML class diagramm.
    There is a Session Bean Interface with a local reference to the Entity Beans.
    If I test my Session Bean with the Oracle9i JDeveloper's Embedded Oracle9iAS J2EE Server there
    is a NullPointerException after deploying the Beans.
    Note: There is no error if I have only Session Bean with one Entity Bean without any relationships.
    the log-File is :
    D:\jdeveloper\jdk\bin\javaw.exe -ojvm -classpath D:\jdeveloper\j2ee\home\oc4j.jar -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true
    com.evermind.server.OC4JServer -config D:\jdeveloper\jdev\system9.0.3.1.1107\oc4j-config\server.xml
    [Starting OC4J using the following ports: HTTP=8992, RMI=23892, JMS=9231.]
    [waiting for the server to complete its initialization...]
    Embedded OC4J startup time: 2464 ms.
    Copying default deployment descriptor from archive at D:\jdeveloper\jdev\mywork\Workspace1\Project1\classes/META-INF/orion-ejb-jar.xml
    to deployment directory D:\jdeveloper\jdev\system9.0.3.1.1107\oc4j-config\application-deployments\current-workspace-app\classes...
    Auto-deploying file:/D:/jdeveloper/jdev/mywork/Workspace1/Project1/classes/ (No previous deployment found)... java.lang.NullPointerException
         void com.evermind.server.ejb.compilation.CMPObjectCompilation.processContainerManagedField(com.evermind.server.ejb.deployment.ContainerManagedField, com.evermind.util.ByteString, boolean)
              CMPObjectCompilation.java:314
         void com.evermind.server.ejb.compilation.CMPObjectCompilation.processFields()
              CMPObjectCompilation.java:235
         void com.evermind.server.ejb.compilation.PersistenceManagerCompilation.compile()
              PersistenceManagerCompilation.java:59
         void com.evermind.server.ejb.compilation.EntityBeanCompilation.compile()
              EntityBeanCompilation.java:332
         void com.evermind.server.ejb.compilation.Compilation.compile()
              Compilation.java:288
         void com.evermind.server.ejb.EJBContainer.postInit(com.evermind.server.ejb.EJBContainerConfig, com.evermind.server.administration.ApplicationInstallation)
              EJBContainer.java:551
         void com.evermind.server.Application.postInit(com.evermind.server.ApplicationConfig, com.evermind.server.administration.ApplicationInstallation)
              Application.java:431
         void com.evermind.server.Application.setConfig(com.evermind.server.ApplicationConfig, com.evermind.server.administration.ApplicationInstallation)
              Application.java:136
         void com.evermind.server.ApplicationServer.addApplication(com.evermind.server.ApplicationConfig, com.evermind.server.Application, com.evermind.server.administration.ApplicationInstallation)
              ApplicationServer.java:1635
         com.evermind.server.Application com.evermind.server.ApplicationServer.getApplication(java.lang.String, com.evermind.util.ErrorHandler)
              ApplicationServer.java:2130
         void com.evermind.server.XMLApplicationServerConfig.initHttp(com.evermind.server.ApplicationServer)
              XMLApplicationServerConfig.java:1550
         void com.evermind.server.ApplicationServerLauncher.run()
              ApplicationServerLauncher.java:97
         void java.lang.Thread.run()
              Thread.java:484
    Please help with any idea.
    Thanks.

    Uta-
    It looks like you're running JDev 9.0.3.1. If it's not too much trouble, can you try this again with 9.0.3.2? There have been a number of codegen fixes since 9.0.3.1, so it would be best to rule them out first.
    If that doesn't fix things, or if that's not convenient, can you include the details of your car-producer and car-types schema objects? This will give me some more info to go on.
    Thanks,
    Jon

  • Setting not null EJB relationships

    I have a table with a one to one relation to another table through a foreign key. The foreign key is a not null column. OC4J won't let me set the relationship in ejbCreate, but because the field is not null I can't set it in ejbPostCreate. Do I have any options besides making the column accept null values?

    You have two options.
    Option: 1
    Declare the not null constraint as deferrable; the constraint are checked only when the data is committed
    Option 2:
    In the Entity Bean, you have to add an addition cmp-field ( customerid) for the FK in addition to the existing CMR ( altered ejb-jar.xml & orion-ejb-jar).
    You have to set the customerid in the ejbCreate segment & set up the relationship in the ejbPostCreate section.
    regards
    Debu

  • EJB relationship no working -- The collection is obtained by another transa

    Hi guys,
    I have two entity beans, and defined 1:n relationship following the proper procedure. However when I call the getter, I got following execption:
    com.sap.engine.services.ejb.exceptions.BaseIllegalStateException: The collection is obtained by another transaction.
    My code is following:
    try {
        TimeStatusPK pk = new TimeStatusPK();
        pk.employeeID = employeeID;
        TimeStatusEntityLocal ts = tsHome.findByPrimaryKey(pk);
        Collection distribution = ts.getDistributionByStatus();
        Iterator it = distribution.iterator();
    } catch (Exception e) {
        throw new TES_Exception(e);
    exception occurs when calling distribution.iterator();  Looks like the return collection ( from the 1:n relationship) can not be touched because it's used by other object. I have no idea why this happens, searched in sdn, didn't find hte right answer. Please give me hints.
    Thanks
    Jayson

    Jayson, mark your bean`s transaction type as "Bean":
    <session>
    <transaction-type>Bean</transaction-type>
    </session>
    and modify code like this:
    try {
    _context.getUserTransaction().begin();
    TimeStatusPK pk = new TimeStatusPK();
    pk.employeeID = employeeID;
    TimeStatusEntityLocal ts = tsHome.findByPrimaryKey(pk);
    Collection distribution = ts.getDistributionByStatus();
    Iterator it = distribution.iterator();
    _context.getUserTransaction().commit(); //SessionContext _context . set it in setSessionContext method
    } catch (Exception e) {
    try{
    _context.getUserTransaction().rollback();
    }catch(Exception e)
    throw new TES_Exception(e);

  • Entity EJB Relationships Architectural Question

    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I define
    the relationships (EJB 2.0)? If it is not, how would you build it?
    Thanks for helping me out,
    Thomas A. Valletta

    Thanks Slava,
    You deserve more than a free trip to a conference for the time and effort
    that you put into this board. I think you should be able to write this off
    as a charitable contribution on your taxes. If you need someone to sign the
    receipt, just let me know.
    Anyway, back to my hierarchy issue(s). I found some information that
    weblogic will set-up this kind of many-to-many relationship for you if you
    set it up correctly in the weblogic-cmp-rdbms-jar.xml and the ejb-jar.xml.
    So I went through the DTDs, but despite the examples the help is extremely
    vague. Has anyone done this? Could anyone recommend where I could find
    something more on the topic (books, magazine articles, online documentation,
    code, etc)?
    Thanks again,
    Thomas A. Valletta
    "Slava Imeshev" <[email protected]> wrote in message
    news:3ec552f9$[email protected]..
    Hi Thomas,
    "Thomas A. Valletta" <[email protected]> wrote in message
    news:[email protected]..
    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I
    define
    the relationships (EJB 2.0)? If it is not, how would you build it?The best approach is the one that works for you. If the
    combination of two beans works, leave it as is and
    go ahead with next tasks.
    Regards,
    Slava Imeshev

  • EJB Relationships

    I am trying to set up a 1:N relationship between two ejb's. I have them both
    in separate directories using separate Deployment Descriptors. I am trying to
    define a relationship in the EJB that manages the relationship to the other ejb's.
    When I try to compile, I get an error saying the other ejb could not be found.
    Do both ejb's have to be defined in one ejb-jar.xml? Or can they be in separate
    directories, each with its own ejb-jar.xml?
    Either way, how do I set it up so I can establish a relationship between
    two esisting ejb's?

    The 2 ejbs need to be in the same jar (and thus in the same Deployment Descriptor)

  • EJB Relationship FUBAR

    In evaluating the latest release of JDeveloper (9.0.3), I have noticed that the CMP EJB wizard does not produce compilable code when generating default relationships. It appears that the set methods for the PrimaryKey and ID values are not generated properly. I guess I have to create those methods manually.
    Is this the way JDev is supposed to work ?
    I have not found any information in the JDeveloper docs that cover this issue. Any help would be appreciated.
    TIA.
    Steve Guilford...>>>

    Steve-
    Can you describe what is wrong with the CMR setters? Are you working with basic (single column) or compound (multi-column) primary/foreign keys?
    There may be some issues lurking when using multi-column PK's, particularly if the PK includes a foreign key (if represented by a CMR field), but in some cases these are caused by an invalid CMR condition (such as a non-deferred NOT NULL constraint on a FK column -- the EJB spec implicitly prevents this condition).
    If you can send me your schema or codegen details, I'll be happy to take a look.
    Jon

  • Problems with EJB Relationships

    Hi,
    I'm having a problems using relationships in EJB. There are two entities: User and Profile. The User entity is a simple entity, with some String fields and two Integer fields (the primary key and the foreign key - coming from Profile). The Profile entity has some String fields and an Integer field (the primary key).
    There is no problem when executing the ejbCreate() method on the Profile entity. Everything goes fine. But, when executing the ejbCreate() on the User entity, the following message appears:
    javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-06550: line 1, column 83:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    The relationship between the two entities is like that:
    "UserBean"
    * Returns the profileId
    * @return the profileId
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="PROFILE_ID"
    * sql-type="NUMBER"
    * @ejb.interface-method
    * @ejb.relation
    * name="profile-user"
    * role-name="user-has-profile"
    * target-ejb="Profile"
    * target-multiple="no"
    * target-role-name="profile-is-in-user"
    * @jboss.relation
    * fk-column="profile_id"
    * related-pk-field="profileId"
    public abstract java.lang.Integer getProfileId();
    * Sets the profileId
    * @param java.lang.Integer the new profileId value
    * @ejb.interface-method
    public abstract void setProfileId(java.lang.Integer profileId);
    "ProfileBean"
    * Returns a Collection of Usuario
    * @return a Collection of Usuario
    * @ejb.interface-method
    * view-type="both"
    * @ejb.relation
    * name="perfil-usuario"
    * role-name="perfil-tem-usuario"
    public abstract java.util.Collection getUsuario();
    public abstract void setUsuario(java.util.Collection usuario);
    I'm using JBOSS 3.2 application server.
    Have anyone seen this??
    Thank you,
    Wilson

    I've already discovered what happened. The column-name attribute in the @ejb.persistence tag should always be in lower-case.

  • Ejb relationships using cmp field

    I have defined a cmp relationship using cmr field. Als defined getter/setter for that field.
    When I call the getter method container returns all the records for relation.
    getter/setter is implemented by container.
    My question is can we define in which order relationships record should be retrieved. I mean can we specify Order By caluse for that.

    if you want to do this you just have to use Map on collection side of your relationship like this:
    @OneToMany(cascade={CascadeType.ALL})
        @JoinColumn(name="CUSTOMER_ID")
    @MapKey(name="number")
    @OrderBy
    ("number ASC")
        public Map<String, Phone> getPhoneNumbers

  • EJB relationship

    Hi there! I have a few questions related to this topic, wish you guys could help me:
    1st - I can't remember, do the entities used in a relation must lie in the same jar? Or could they be distributed in diffent jars in a unique ear?
    2nd - In a relationship, when adding a parent and a child, don't the CMP engine adds the child automatic for me? Do I need to transverse the Collection and call childhome.create() for each child of a given parent?
    3rd - kinda related to the question above. I know that deletes can be "cascaded" what about updates? Do I need to transverse the Collection either or in this case it's a different scenario?
    Thanks all
    Vinicius Carvalho

    1- it doesnt matter where u deploy them - as long as their home interfaces(remote/local) are well configured to correct JNDI name.
    2- im not sure i understand your question - the good practice is like
    _ cmp - category
    session bean
    _cmp -item
    if you want to add a child :
    (session bean): Item = ItemHome.create();
    (session bean): CategoryRemote.addItem(Item)
    (categoryBean): public addItem(Item item){
    Collection items = getItems();
    items.add(item)}
    and thats it! hope it helps,
    3-depends on Application server each AS has diffrent way to configure relations
    you have to remeber one thing with persistence:
    every action you make is made of 2 actions
    a.store changes in DB
    b.store object's state
    last tip - dont use entity beans!!!!! - www.hibernate.org - check it out its like magic........

  • Problems with EJB relationship mapping (annotations)

    So, I'm part of a group working on a web-based project management system, and we're having some trouble with the relationship mapping between the entity beans.
    I've been mainly working on a class called WorkPackage. So the mappings I've got:
    Within the WorkPackage class
    (A work package is one "module" of work within a project)
            @Entity
            @Table(name="WorkPackage")
            @IdClass(WorkPackagePK.class)
            public class WorkPackage implements java.io.Serializable
            @Id
            @Column(name="wpID")
            public String getWpID() { return wpID; }
         public void setWpID(String id) { this.wpID = id; }
         @Id
            @Column(name="projID")
            public String getProjId() { return projId; }
         public void setProjId(String projId) { this.projId = projId; }
            @ManyToOne // bidirectional - owner side
         @JoinColumn(name="projID")
         public Project getProject() { return project; }
         public void setProject(Project project) { this.project = project; }      And on the Project side
            @Entity
            @Table(name="Project")
            public class Project implements java.io.Serializable
            @Id
            @Column(name="projID")
            public String getId() { return id; }
         public void setId(String id) { this.id = id; }
           @OneToMany(mappedBy="project") // biderctional - target side
         public Set<WorkPackage> getWorkPackages() { return workPackages; }
         public void setWorkPackages(Set<WorkPackage> workPackages) { this.workPackages = workPackages; } The problem here is that its apparently seeing 'projID' as attempting to be mapped to 2 columns within the 'workpackage' table in the database instead of using the @Id one as the id, and the other as the foreign key to the 'project' table.
    So, when I try to add a workpackage to the database via a JSF page, it gives me the error 'java.sql.BatchUpdateException: Column 'projID' specified twice'.
    Maybe its something to do with variable in the project class being called 'id' even though its mapped to the database column 'projID'
    Edited by: wormdundee on Mar 1, 2008 2:26 PM

    I think the trouble is that you overrode the column names for the projID and project properties to the same value. Try
    @Entity
            @Table(name="WorkPackage")
            @IdClass(WorkPackagePK.class)
            public class WorkPackage implements java.io.Serializable
            @Id
            @Column(name="WP_WP_ID")
            public String getWpID() { return wpID; }
         public void setWpID(String id) { this.wpID = id; }
         @Id
            @Column(name="WP_PROJ_ID")
            public String getProjId() { return projId; }
         public void setProjId(String projId) { this.projId = projId; }
            @ManyToOne // bidirectional - owner side
         @JoinColumn(name="WP_PROJECT_PROJ_ID")
         public Project getProject() { return project; }
         public void setProject(Project project) { this.project = project; }

  • Defining a many-to-many relationship with CMP EJBs  : does it work for you

    Curious to know whether someone has been able to set up a many to many relationship between two entity beans.
    I have been struggling with this for days now and I can't get it to work.
    In my test project I have two entity beans, resp. Consultant and Solution.
    Consultant has a cmr field called 'solutions', which is a collection object from the opposite side (Solution).
    This is the source of the ejb-jar.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
         <description>EJB JAR description</description>
         <display-name>EJB JAR</display-name>
         <enterprise-beans>
              <session>
                   <ejb-name>ProfilerBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbses.profiling.Profiler</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                        <ejb-ref-name>EJBTesting/Solution</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
                        <local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
                        <ejb-link>SolutionBean</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>EJBTesting/Consultant</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
                        <local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
                        <ejb-link>ConsultantBean</ejb-link>
                   </ejb-local-ref>
              </session>
              <entity>
                   <ejb-name>ConsultantBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Consultant</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Consultant</abstract-schema-name>
                   <cmp-field>
                        <field-name>firstname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>lastname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>country</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <query-method>
                             <method-name>findBySolution</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT Object(c) FROM Consultant AS c,
                        IN(c.solutions) s WHERE s.id = ?1 </ejb-ql>
                   </query>
              </entity>
              <entity>
                   <ejb-name>SolutionBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Solution</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Solution</abstract-schema-name>
                   <cmp-field>
                        <field-name>description</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>parent</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <query-method>
                             <method-name>findChildSolutions</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT Object(s) FROM Solution AS s WHERE
                        s.parent = ?1</ejb-ql>
                   </query>
                   <query>
                        <query-method>
                             <method-name>findTopLevelSolutions</method-name>
                             <method-params/>
                        </query-method>
                        <ejb-ql>Select Object(s) FROM Solution AS s WHERE
                        (s.parent = &apos;none&apos;)</ejb-ql>
                   </query>
              </entity>
         </enterprise-beans>
         <relationships>
              <ejb-relation>
                   <description>A consultant may have one or more areas of expertise</description>
                   <ejb-relation-name>Consultant_Solutions</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>ConsultantBean</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>solutions</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>SolutionBean</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
         </relationships>
         <assembly-descriptor>
              <container-transaction>
                   <description>container-transaction</description>
                   <method>
                        <ejb-name>SolutionBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>ProfilerBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>ConsultantBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    I created a stateless session bean as a business facade for the two entity beans. I then created a webservice to test the beans.
    What works :
    - create a consultant
    - get a consultant
    - create a solution
    - get a solution
    (basically everything that doesn't involve the relationship field.
    However, what doesn't work is the method call assignSolution:
    - assign solution : this is implemented as follows
    Business Method.
         public void assignSolution(String consultantID, String solutionID)
              throws ProfilingException {
              // TODO : Implement
              ConsultantLocal cons = null;
              SolutionLocal sol = null;
              try {
                   cons = consHome.findByPrimaryKey(consultantID);
                   sol = solHome.findByPrimaryKey(solutionID);
                   Collection solutions = cons.getSolutions();
                   solutions.add(sol);
                   //sol.getConsultants().add(cons);
              } catch (FinderException ex) {
                   ex.printStackTrace();
                   throw new ProfilingException("failed to retrieve data from DB", ex);
    As you can see I am trying to use the CM Relationship in this methhod. Adding the solution to a consultant should be as simple as adding a solution object to the collection retrieved with the getSolutions accessor. The Container is expected to persist the information in my MAXDB database.
    However this doesn't happen.
    The ORM details as defined in the persistent.xml follows :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
    <persistent-ejb-map>
         <locking
              type="Table"/>
         <db-properties>
              <data-source-name>TCC_PORTAL_PROFILER</data-source-name>
              <database-vendor
                   name="SAPDB"/>
         </db-properties>
         <entity-beans>
              <entity-bean>
                   <ejb-name>ConsultantBean</ejb-name>
                   <table-name>PFL_CONSULTANTS</table-name>
                   <field-map
                        key-type="NoKey">
                        <field-name>firstname</field-name>
                        <column>
                             <column-name>FIRSTNAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>lastname</field-name>
                        <column>
                             <column-name>LASTNAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>country</field-name>
                        <column>
                             <column-name>COUNTRY</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="PrimaryKey">
                        <field-name>id</field-name>
                        <column>
                             <column-name>ID</column-name>
                        </column>
                   </field-map>
                   <finder-descriptor>
                        <method-name>findBySolution</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
              </entity-bean>
              <entity-bean>
                   <ejb-name>SolutionBean</ejb-name>
                   <table-name>PFL_SAPSOLUTIONS</table-name>
                   <field-map
                        key-type="NoKey">
                        <field-name>description</field-name>
                        <column>
                             <column-name>DESCRIPTION</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>name</field-name>
                        <column>
                             <column-name>NAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>parent</field-name>
                        <column>
                             <column-name>PARENTID</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="PrimaryKey">
                        <field-name>id</field-name>
                        <column>
                             <column-name>ID</column-name>
                        </column>
                   </field-map>
                   <finder-descriptor>
                        <method-name>findChildSolutions</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
                   <finder-descriptor>
                        <method-name>findTopLevelSolutions</method-name>
                        <method-params/>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
              </entity-bean>
         </entity-beans>
         <relationships>
              <table-relation>
                   <help-table>PFL_CONS_SOL_MAP</help-table>
                   <table-relationship-role
                        key-type="PrimaryKey">
                        <ejb-name>ConsultantBean</ejb-name>
                        <cmr-field>solutions</cmr-field>
                        <fk-column>
                             <column-name>CONSULTANTID</column-name>
                             <pk-field-name>id</pk-field-name>
                        </fk-column>
                   </table-relationship-role>
                   <table-relationship-role
                        key-type="PrimaryKey">
                        <ejb-name>SolutionBean</ejb-name>
                        <fk-column>
                             <column-name>SOLUTIONID</column-name>
                             <pk-field-name>id</pk-field-name>
                        </fk-column>
                   </table-relationship-role>
              </table-relation>
         </relationships>
    </persistent-ejb-map>
    The error in the default trace file when calling the method states, there is an "inconsistency in the number of primary keys". Details follow.
    #1.5#000F1F188E5C004400000000000010480003E76C80EFD57A#1098880364327#com.sap.engine.services.ejb#com.atosorigin.tcc/EJBCMPProfilingTest#com.sap.engine.services.ejb#Guest#2####4d2b2370281411d9a40d000f1f188e5c#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method assignSolution.
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:822)
         at com.atosorigin.tcc.testing.ejbses.profiling.Profiler_Stub.assignSolution(Profiler_Stub.java:533)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy73.assignSolution(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:146)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:68)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:339)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:317)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:810)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:238)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.applocking.exception.SAPAppLockingIllegalArgumentException: Inconsistency in number of primary keys
         at com.sap.engine.services.applocking.TableLockingImpl.getArgument(TableLockingImpl.java:385)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:128)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         at com.sap.engine.services.ejb.entity.pm.PersistentM2M.create(PersistentM2M.java:172)
         at com.sap.engine.services.ejb.entity.pm.PersistentCacheM2M.add(PersistentCacheM2M.java:197)
         at com.sap.engine.services.ejb.entity.pm.multiple.CollectionM2M.add(CollectionM2M.java:57)
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean.assignSolution(ProfilerBean.java:201)
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:771)
         ... 32 more
    I can't figure out what the problem is with the ORM mapping defined.
    On the database level I have three tables. Consultant maps to PFL_CONSULTANT, Solution to PFL_SAPSOLUTIONS. The third table PFL_CONS_SOL_MAP is the help table used for the relationship (having two fields, which are in fact foreign keys from the other two tables to express the assignment of solutions to consultants (where a consultant can have one or more solutions).
    ps. : I am running Netweaver Developer Workplace (Netweaver 2004, at stack level 5)
    Message was edited by: Theo Paesen

    Hm, after disabling 'automatic locking' it works.

  • Help: IllegalExpressionException vs. EJB 2.1 many-to-many relationship

    Using Oracle WebLogic 11g (10.3.4). The appc tool is generating a warning regarding an illegal EJB QL expression for a many-to-may relationship in an EJB 2 Bean.
    Details:
    * Entity Bean "MSProduktKonfiguration"
    * Entity Bean "MSAngebot"
    * n-m relationship betwenn these two Entites, from MSProduktKonfiguration to MSAngebot by cmr field angebotLocal, from MSAngebot to MSProduktKonfiguration by cmr field produktKonfigurationenLocal
    * Join table "MS_PRODUKT.ANGEBOT_POSITION"
    Warnings from appc:
    [java] Warning: [EJB:013094]The SELECT clause of this query contains an identifier 'bean.angebotLocal' that ends in a cmr-field. The EJB 2.1 specification section 11.2.7.1 requires that any related null objects belonging to the set corresponding to this cmr-field must be returned by this query however the database that will be used to execute this query does not sufficiently support SQL outer joins, therefore this query will not return any null objects that might otherwise be returned.
    [java] Warning: [EJB:013094]The SELECT clause of this query contains an identifier 'bean.produktKonfigurationenLocal' that ends in a cmr-field. The EJB 2.1 specification section 11.2.7.1 requires that any related null objects belonging to the set corresponding to this cmr-field must be returned by this query however the database that will be used to execute this query does not sufficiently support SQL outer joins, therefore this query will not return any null objects that might otherwise be returned.
    I have no clue what's going on there. Maybe someone can help me out.
    Snippet from the ejb-jar.xml Deployment Descriptor:
    <ejb-relation id="EJBRelation_9">
    <ejb-relation-name>Angebot-ProduktKonfiguration</ejb-relation-name>
    <ejb-relationship-role id="EJBRelationshipRole_17">
    <ejb-relationship-role-name>ProduktKonfigurationen-Have-Angebote</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source id="RoleSource_17">
    <ejb-name>MSProduktKonfiguration</ejb-name>
    </relationship-role-source>
    <cmr-field id="CMRField_9">
    <cmr-field-name>angebotLocal</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role id="EJBRelationshipRole_18">
    <ejb-relationship-role-name>Angebote-Have-ProduktKonfigurationen</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source id="RoleSource_18">
    <ejb-name>MSAngebot</ejb-name>
    </relationship-role-source>
    <cmr-field id="CMRField_10">
    <cmr-field-name>produktKonfigurationenLocal</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    Snippet from the weblogic-cmp-rdbms-jar.xml Deployment Descriptor:
    <weblogic-rdbms-relation>
    <relation-name>Angebot-ProduktKonfiguration</relation-name>
    <table-name>MS_PRODUKT.ANGEBOT_POSITION</table-name>
    <weblogic-relationship-role>
    <relationship-role-name>Angebote-Have-ProduktKonfigurationen</relationship-role-name>
    <relationship-role-map>
    <column-map>
    <foreign-key-column>angebot_id</foreign-key-column>
    <key-column>angebot_id</key-column>
    </column-map>
    </relationship-role-map>
    </weblogic-relationship-role>
    <weblogic-relationship-role>
    <relationship-role-name>ProduktKonfigurationen-Have-Angebote</relationship-role-name>
    <relationship-role-map>
    <column-map>
    <foreign-key-column>produkt_konfiguration_id</foreign-key-column>
    <key-column>produkt_konfiguration_id</key-column>
    </column-map>
    </relationship-role-map>
    </weblogic-relationship-role>
    </weblogic-rdbms-relation>

    Hi,
    There are many differences between EJB 1.1 and 2.0. Most of these are
    regarding CMP entity EJBs. I would say you should go with 2.0 if you have
    entity EJBs.
    Also EJB 2.0 has local interfaces and message-driven beans (JMS listeners).
    Emmanuel
    "Brian" <[email protected]> wrote in message
    news:3cf3b4eb$[email protected]..
    >
    Our standard development tool here is WebGain Visual Cafe 4.5.1. I am toldthat this
    tool does not support EJB 2.0. We are generating EJB's through the wizardbased interface
    of Visual Cafe.
    Is there a compelling reason to use EJB 2.0 instead of 1.1, even thoughthe tool
    doesn't support it? Is the time saved by automatic generation of EJB 1.1beans outweighed
    by improvements in EJB 2.0?
    Thanks for you help!

  • EJB representing optional relationship

    Hi,
    I was wondering how does EJB 2.0 deployment descriptor handles the 1 to 1/0 relationship between 2 entites. For example, 1 course can have 0 or 1 textbook. In this case, textbook is optional and might be represented as null in the database.
    The following represents 1-to-many relationship, how can I define 1-to-1/0 relationship? Please help. Thanks.
    <relationships>
       <ejb-relation>
          <ejb-relation-name>Textbook-Course</ejb-relation-name>
          <ejb-relationship-role>
             <ejb-relationship-role-name>Textbook-has-Course</ejb-relationship-role-name>
             <multiplicity>many</multiplicity>
             <relationship-role-source>
                <ejb-name>TextbookBean</ejb-name>
             </relationship-role-source>
             <cmr-field>
                <cmr-field-name>course</cmr-field-name>
             </cmr-field>
          </ejb-relationship-role>
          <ejb-relationship-role>
             <ejb-relationship-role-name>Course-has-Textbook</ejb-relationship-role-name>
             <multiplicity>one</multiplicity>
             <relationship-role-source>
                <ejb-name>CourseBean</ejb-name>
             </relationship-role-source>
             <cmr-field>
                <cmr-field-name>textbooks</cmr-field-name>
                <cmr-field-type>java.util.Collection</cmr-field-type>
             </cmr-field>
          </ejb-relationship-role>
       </ejb-relation>
    </relationships>

    hi,
    I think you can use 1-1 relation for your case. It will also take care of 1-0.
    You just need to update the Textbook-Course multiplicity tag.
    Set multiplicityto one
    If there is no textbook in a course the Collection will be empty. if you strictly want to model 1 -1/0 , then no need to using Collection in following tag. Just use the type of TextBookbean's remote interface.
    <cmr-field>
        <cmr-field-name>textbooks</cmr-field-name>           
        <cmr-field-type>java.util.Collection</cmr-field-type>        
    </cmr-field>I am using the same technique in our application . We take help of model 1-1 for 1-0 type of relation.
    regards,
    Amit

  • JDeveloper Unilateral relationship ejb-jar.xml verifying error

    I am huge difficulty with tables that have relationships mapping in one direction (unilateral).
    If I give you a really basic scenario of table Emp which has Employee information and a Dept_no foreign key. I also have a table Dept which has department info and includes it's primary key of Dept_no.
    When dragging and dropping tables from the Oracle Database onto the UML Diagram (OC4J container), the relationships automatically configure as bilateral. The ejb-jar.xml builds and the verifying Enterprise Beans verifies OK. If I select the relationship on the diagram and change it to be unilateral from Employee -> Department, it will still compile the EJB related source, but the ejb-jar.xml file will no longer verify the Enterprise Beans.
    Now there have been a million ways that I have tried to get this simple example to work.
    Here's my ejb-jar.xml and the orion-ejb-jar.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Dept</display-name>
    <ejb-name>Dept</ejb-name>
    <local-home>nz.co.fal.DeptLocalHome</local-home>
    <local>nz.co.fal.DeptLocal</local>
    <ejb-class>nz.co.fal.impl.DeptBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Dept</abstract-schema-name>
    <cmp-field>
    <field-name>deptno</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>dname</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>loc</field-name>
    </cmp-field>
    <primkey-field>deptno</primkey-field>
    </entity>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Emp</display-name>
    <ejb-name>Emp</ejb-name>
    <local-home>nz.co.fal.EmpLocalHome</local-home>
    <local>nz.co.fal.EmpLocal</local>
    <ejb-class>nz.co.fal.impl.EmpBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Emp</abstract-schema-name>
    <cmp-field>
    <field-name>empno</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>ename</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>job</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>mgr</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>hiredate</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>sal</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>comm</field-name>
    </cmp-field>
    <primkey-field>empno</primkey-field>
    </entity>
    </enterprise-beans>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>Emp - Dept</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Dept may have one Emp</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Dept</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Emp may have one Dept</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Emp</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>dept_deptno</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    </ejb-jar>
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="Dept" data-source="jdbc/Connection1DS" table="DEPT">
    <primkey-mapping>
    <cmp-field-mapping name="deptno" persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    </primkey-mapping>
    <cmp-field-mapping name="deptno" persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    <cmp-field-mapping name="dname" persistence-name="DNAME" persistence-type="VARCHAR2(14)"/>
    <cmp-field-mapping name="loc" persistence-name="LOC" persistence-type="VARCHAR2(13)"/>
    </entity-deployment>
    <entity-deployment name="Emp" data-source="jdbc/Connection1DS" table="EMP">
    <primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(4)"/>
    </primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(4)"/>
    <cmp-field-mapping name="ename" persistence-name="ENAME" persistence-type="VARCHAR2(10)"/>
    <cmp-field-mapping name="job" persistence-name="JOB" persistence-type="VARCHAR2(9)"/>
    <cmp-field-mapping name="mgr" persistence-name="MGR" persistence-type="NUMBER(4)"/>
    <cmp-field-mapping name="hiredate" persistence-name="HIREDATE" persistence-type="DATE"/>
    <cmp-field-mapping name="sal" persistence-name="SAL" persistence-type="NUMBER(7,2)"/>
    <cmp-field-mapping name="comm" persistence-name="COMM" persistence-type="NUMBER(7,2)"/>
    <cmp-field-mapping name="dept_deptno">
    <entity-ref home="Dept">
    <cmp-field-mapping persistence-name="DEPTNO" persistence-type="NUMBER(2)"/>
    </entity-ref>
    </cmp-field-mapping>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping impliesAll="true" name="<default-ejb-caller-role>"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    DeptBean.java (Department ejb Bean class)
    package nz.co.fal.impl;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import java.util.Collection;
    import nz.co.fal.EmpLocal;
    public abstract class DeptBean implements EntityBean {
    private EntityContext context;
    public Long ejbCreate() {
    return null;
    public void ejbPostCreate() {
    public Long ejbCreate(Long deptno) {
    setDeptno(deptno);
    return deptno;
    public void ejbPostCreate(Long deptno) {
    public void ejbActivate() {
    public void ejbLoad() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void ejbStore() {
    public void setEntityContext(EntityContext ctx) {
    this.context = ctx;
    public void unsetEntityContext() {
    this.context = null;
    public abstract Long getDeptno();
    public abstract void setDeptno(Long newDeptno);
    public abstract String getDname();
    public abstract void setDname(String newDname);
    public abstract String getLoc();
    public abstract void setLoc(String newLoc);
    DeptLocal.java
    package nz.co.fal;
    import javax.ejb.EJBLocalObject;
    import java.util.Collection;
    public interface DeptLocal extends EJBLocalObject {
    Long getDeptno();
    void setDeptno(Long newDeptno);
    String getDname();
    void setDname(String newDname);
    String getLoc();
    void setLoc(String newLoc);
    DeptLocalHome.java
    package nz.co.fal;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import java.util.Collection;
    public interface DeptLocalHome extends EJBLocalHome {
    DeptLocal create() throws CreateException;
    DeptLocal findByPrimaryKey(Long primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    DeptLocal create(Long deptno) throws CreateException;
    EmpBean.java (ejb Bean class for Emp)
    public abstract class EmpBean implements EntityBean {
    private EntityContext context;
    public Long ejbCreate() {
    return null;
    public void ejbPostCreate() {
    public Long ejbCreate(Long empno) {
    setEmpno(empno);
    return empno;
    public void ejbPostCreate(Long empno) {
    public void ejbActivate() {
    public void ejbLoad() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void ejbStore() {
    public void setEntityContext(EntityContext ctx) {
    this.context = ctx;
    public void unsetEntityContext() {
    this.context = null;
    public abstract Long getEmpno();
    public abstract void setEmpno(Long newEmpno);
    public abstract String getEname();
    public abstract void setEname(String newEname);
    public abstract String getJob();
    public abstract void setJob(String newJob);
    public abstract Long getMgr();
    public abstract void setMgr(Long newMgr);
    public abstract Timestamp getHiredate();
    public abstract void setHiredate(Timestamp newHiredate);
    public abstract Long getSal();
    public abstract void setSal(Long newSal);
    public abstract Long getComm();
    public abstract void setComm(Long newComm);
    public abstract DeptLocal getDept_deptno();
    public abstract void setDept_deptno(DeptLocal newDept_deptno);
    EmpLocal.java (ejb local interface for Emp)
    package nz.co.fal;
    import javax.ejb.EJBLocalObject;
    import java.sql.Timestamp;
    public interface EmpLocal extends EJBLocalObject {
    Long getEmpno();
    void setEmpno(Long newEmpno);
    String getEname();
    void setEname(String newEname);
    String getJob();
    void setJob(String newJob);
    Long getMgr();
    void setMgr(Long newMgr);
    Timestamp getHiredate();
    void setHiredate(Timestamp newHiredate);
    Long getSal();
    void setSal(Long newSal);
    Long getComm();
    void setComm(Long newComm);
    DeptLocal getDept_deptno();
    void setDept_deptno(DeptLocal newDept_deptno);
    EmpLocalHome.java (ejb local home for Emp)
    package nz.co.fal;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import java.util.Collection;
    public interface EmpLocalHome extends EJBLocalHome {
    EmpLocal create() throws CreateException;
    EmpLocal findByPrimaryKey(Long primaryKey) throws FinderException;
    Collection findAll() throws FinderException;
    EmpLocal create(Long empno) throws CreateException;
    that's probably all the relevant information.
    As I said if I can't map relationships unilaterally from Oracle tables, then that is a huge issue for our project.
    Any Help, would be fantastic - THANKYOU.
    Geoff

    Geoff,
    please repost your question in the JDeveloper forum
    JDeveloper and ADF
    the JDeveloper product management team monitors their forum and you will receive a faster response.
    thanks - OTN

Maybe you are looking for

  • Stock transfer from WH to WH

    hello Experts, here is the scenario. we have one plant with two WH located at different geographical locations.  we are planning transfer of stocks using consumption based planning taking SLoc as MRP area. When stock comes done at WH , automatically

  • New Iphone 4s - Old Macbook OS 10.4 and 2 GHz Intel Core Duo.

    iPhone 4s won't sync with my Macbook. OS X10.4 is too old. OS upgrade advised but not possible with the processor I have. OS upgrade minimum Spec specifies Core 2 Duo. What are my options, from all the way up to a new laptop (maybe due?) to the less

  • Can't connect to Access Point that is connected to the Internet (Snow Leopard 10.6.8)

    Hi all, I am normally not someone who posts on support forums since most of the problems can be solved be searching through piles of other questions, but this things has really got me pulling out my hair and I hope that maybe someone can help me with

  • Flash Pro CS6, JSFL, and SpriteSheetExporter.exportSpriteSheet()

    Hi, I've been trying to use SpriteSheetExporter.exportSpriteSheet() but it just reports the following error:  "Argument number 1 is invalid" The documentation says to pass a (file) path for the first argument.  I've tried to pass both a platform path

  • Can I change gridline properties (in the regular tabular display)?

    I would like to change the thickness of some of the gridlines in the regular tabular display in Discoverer (not in the graphing component). I have exausted regular sources of info (the manuals, online help, metalink, technet, etc.) and hence my appea