Ejb 3.0 and JDeveloper

If I drag and drop tables with One to one mapping in an ejb diagram in JDeveloper (one table have having the foreign key as the primary key). If I create ejb 2.1 beans it makes makes a One To One mapping between the entity beans created and if I drop them as ejb 3.0 it makes a OneToMany mapping. this is what I get for the same tables.
for ejb 2.1
<ejb-relation>
<ejb-relation-name>Envincidents - Incidents</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Envincidents has one Incidents</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Envincidents</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>incidents_incidentsId</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Incidents may have one Envincidents</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Incidents</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
for ejb 3.0
Envincidents
@Id
@ManyToOne(targetEntity="mypackage.Incidents")
@JoinColumn(name="ENVINCIDENTS.INCIDENTS_ID", referencedColumnName="INCIDENTS.ID")
public Incidents getIncidents() {
return incidents;
public void setIncidents(Incidents incidents) {
this.incidents = incidents;
Incidents
@OneToMany(targetEntity="mypackage.Envincidents")
@JoinColumn(name="ENVINCIDENTS.INCIDENTS_ID", referencedColumnName="INCIDENTS.ID")
public Collection<Envincidents> getEnvincidentsCollection() {
return envincidentsCollection;
public void setEnvincidentsCollection(Collection<Envincidents> envincidentsCollection) {
this.envincidentsCollection = envincidentsCollection;
public Envincidents addToEnvincidentsCollection(Envincidents envincidents) {
getEnvincidentsCollection().add( envincidents );
envincidents.setIncidents( this );
return envincidents;
public Envincidents removeFromEnvincidentsCollection(Envincidents envincidents) {
getEnvincidentsCollection().remove( envincidents );
envincidents.setIncidents( null );
return envincidents;
this causes the following problem.
Exception Description: Multiple writable mappings exist for the field [ENVINCIDE
NTS.INCIDENTS_ID]. Only one may be defined as writable, all others must be spec
ified read-only.
which I have already reported.
I know this is a minor inconvenience and I can hand edit the entity beans and make them one to one for ejb 3.0. But would be to good advantage to have a consistent "dropping of tables" for ejb 2.1 and 3.0. So one can have a similar behavior of entity beans created from tables using ejb 2.1 and 3.0.

I guess this could be desirable if migrating from ejb 2.1 to 3.0 if one has already designed the database.
Dev

Similar Messages

  • Problem with "package-info.java" using EJB 3.0 and OC4J

    Hi all.
    I already posted this question on JDeveloper forum, but didn't get any answer,
    so I'll try posting here.
    Anyway, I'm new both to JDeveloper and J2EE,
    so I'm trying out examples for EJB 3.0, and I got stuck at "Use Security Annotations with EJB 3.0"
    (http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb30security/doc/how-to-ejb30-security-ejb.html).
    Example code is working perfectly, if one builds it using Ant, but I'm importing all examples into JDeveloper (or at least I'm trying to :))
    JDeveloper can't build file "package-info.java" containing following code:
    @javax.annotation.security.SecurityRoles(roleNames={"superuser", "user"})
    package oracle.ejb30;I'm getting following output in "Compiler - Log" window:
    Error(2,1): 'class', 'interface', or 'enum' expected.
    Help much appreciated...
    platform used:
    Windows XP SP2
    JDeveloper Studio (Version 10.1.3, Build 3412)
    JDK 1.5_06
    OC4J 10.1.3 developer preview 4 (standalone version)

    Since you're using EJBs, you can use JTA and can skip the getTransaction() calls. If you want to use getTransaction().begin() and commit(), then make sure that your EntityManager is resource-local. The configuration for this is in persistence.xml. Set a transaction-type of RESOURCE_LOCAL rather than JTA.

  • Ejb 3.0 and webservices

    Hello everybody?
    Does everybody know if i can create a web service from an ejb 3.0 stateless session inside jdeveloper 10 g 10.1.3 (using a wizard for example)?
    Thank you

    It's almost too easy to need a wizard - try this:
    Trhough your project properties add the JSR-181 Web Service library
    In your session bean type @Web (at the top of the class or above a method) and you'll be prompted to import javax.jws.WebMethod (using Alt-Enter) then you can select the appropriate tag (@WebService for all methods to be published, @WebMethod at the individual method level, etc.)
    Then deploy your EJB as normal and voila! See the deployed EJB and Web Service
    Rgds
    Susan

  • Soa 11g and jdeveloper 11g user defined extension function

    I have developed a set of extension functions,
    in design time for the previous version, I can put the deployment file (jar file) that contains the extension functions in the %JDEV_HOME%\jdev\lib\ext directory and jdeveloper recognizes the set of extension functions if previously i have defined an xml descriptor with every one of the functions i need to include in the panel.
    Now, with the jdeveloper 11g i have tried the same, and jdev recognizes the functions, but when I am going to test one transformation that includes the extension function, the parser is not founding the jar file; the error (in spanish) is:
    XML-22045: (Error) Error de funcion de extension: No se ha encontrado la clase '
    Falta la clase: aac._shared.extensions.xsl.XmlW3cDomFunctions
    Clase Dependiente: oracle.xml.xpath.XSLExtFunctions
    Cargador: main:11.0
    Origen del Codigo: /C:/.extracted/jdevstudio1111/lib/xmlparserv2.jar
    Configuraci≤n: system property PCLMain.createExtensionManagerLoader()
    Esta carga se ha iniciado en main:11.0 mediante el mΘtodo loadClass().
    La clase que falta no esta disponible desde ningun origen de codigo o cargador del sistema.
    my dude is:
    + at design time, where can I put the jars with extension functions to make one transformation function used in a mediator component can works fine?
    + at runtime, where can I put those libraries? (in the previous version, we can put this libraries in the %APP_SERVER%\j2ee\home\applib, or create one shared library and reference it in the oracle.bpel.common shared library declaration of the server.xml configuration file).

    Hi,
    please post this question to the JDeveloper 11 forum. Please translate the messages into English as well
    JDeveloper and OC4J 11g Technology Preview
    Frank

  • Ejb-jar.xml and orion-ejb-jar.xml configuration issue

    Chris,
    We have an application that uses the Oracle 10g Application Server and WebSphere MQ v5.3 w/ fixpack 9.
    Our application is a J2EE messaging system which essentially consists of Message Driven Beans, the EJB
    realization of the J2EE Java Message Service (JMS) API. Our application has Message Driven Beans which
    listen to queues and send messages to queues -- a simple messaging system. Currently we can listen to queues, but
    cannot send messages to queues in the Oracle 10g Application Server environment.
    Any J2EE application server has its own implementation of Java Naming Directory Interface (JNDI) API that
    deployed J2EE applications utilize to lookup resources such as Data Sources, JMS Destinations (i.e. MQ Queue),
    JMS QueueConnectionFactories (i.e. MQ QManagers).
    Our application uses the 3rd party JMS Provider, WebSphere MQ.
    MQ ships with a JMSAdmin tool which allows one to create JMS administered objects (i.e. objects a java
    application searches for in some JNDI directory) that reside in some JNDI context. We create a JNDI context for
    MQ resources, queues and QManagers. We configure the MQ provided
    JMSAdmin tool with two property name/value pairs:
    PROVIDER_URL=file:/opt/mqm/JNDI-Directory
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    A resultant .bindings file is created in /opt/mqm/JNDI-Directory which represents our JDNI context
    containing our JMS administered objects. A standalone java application that needs to directly access this
    JNDI context can simply conduct a JNDI lookup on the following context: "java:comp/resource/MQSeries/". An
    example of how a standalone application would lookup a JMS administered object named "qNumber1" would be to
    lookup "java:comp/resource/MQSeries/qNumber1". This lookup would result in the standalone java application
    having a JMS reference to an MQ Queue.
    There is a major difference in how an enterprise EJB application deployed into a J2EE Container (Oracle 10g App Server)
    conducts a JNDI lookup on a 3rd party resource such as MQ as a JMS Provider. A typical EJB application deployed
    into a J2EE container as an .ear (enterprise archive) file has implicit access to the application server's own
    JNDI context. This JNDI context is usually "java:comp/env/". Looking up the Application Server's own Data Source or
    it's own JMS Resources is easy. An application that needs references to these Application Server provided resources
    simply conducts a lookup for "java:comp/env/jms/someQ" or "java:comp/env/jdbc/myDataSource".
    The problem we face is mapping our MQ JNDI context to the Oracle App Server's own JNDI context. We believe this is
    accomplished through mappings defined in both the ejb-jar.xml (EJB Descriptor) and the application server specific
    counterpart, orion-ejb-jar.xml. Note that Oracle 10g Application Server uses the popular orion J2EE container for
    hosting J2EE enterpise applications.
    Our Message Driven Beans (MDBs)currently listen to the Queue at the JNDI location "prodQ". Our problem is that we cannot
    get our MDB to send messages to any queues. Note that the MQ implementation of the queues and Queue Managers work
    flawlessly with standalone java applications. It's safe to say that the MQ objects are working.
    We are looking for a solid example of how the ejb-jar.xml and the orion-ejb-jar.xml map 3rd party JMS provider
    JNDI locations to the App Server's JNDI context.
    Below is how we have attempted to configure our own ejb-jar.xml and orion-ejb-jar.xml:
    ejb-jar.xml begin >>>>>>>>>>>>>>><?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>
    <display-name>Production Message Driven Bean</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>prodMdb</display-name>
    <ejb-name>prodMdb</ejb-name>
    <ejb-class>message.handler.AIDMSMessageConsumerBean</ejb-class>
    <transaction-type>Bean</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
         <resource-ref>
    <res-ref-name>prodQCF</res-ref-name>
    <res-type>javax.jms.QueueConnectionFactory</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
         <resource-ref>
    <res-ref-name>prodQ</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
                   <resource-ref>
    <res-ref-name>prodR</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    <<<<<<<< ejb-jar.xml end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    begin orion-ejb-jar.xml >>>>>>>>>>>>>>>>>>>>>>>>>>><orion-ejb-jar>
    <enterprise-beans>
    <message-driven-deployment name="prodMdb" connection-factory-location="java:comp/resource/MQSeries/prodQCF" destination-location="java:comp/resource/MQSeries/prodR">
              <resource-ref-mapping location="prodQ" name="prodQ">     
                   <lookup-context location="java:comp/resource/MQSeries/" >
                        <!-- <context-attribute name="java.naming.factory.initial"
                             value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
                   </lookup-context>
              </resource-ref-mapping>
              <resource-ref-mapping location="prodR" name="prodR">     
                   <lookup-context location="java:comp/resource/MQSeries/" >
                        <!-- <context-attribute name="java.naming.factory.initial"
                             value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
                   </lookup-context>
              </resource-ref-mapping>
         </message-driven-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    <<<<<<<<< end orion-ejb-jar.xml <<<<<<<<<<<<<<<<<<<<<<<<

    If you look at the contents of a deployment plan (Plan.xml) when you have it generated
    <deployment-plan ...>
      <module-override>
        <module-name>ejb.jar</module-name>
        <module-type>ejb</module-type>
        <module-descriptor external="true">
          <root-element>weblogic-ejb-jar</root-element>
          <uri>META-INF/weblogic-ejb-jar.xml</uri>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>ejb-jar</root-element>
          <uri>META-INF/ejb-jar.xml</uri>
        </module-descriptor>
        <module-descriptor external="true">
          <root-element>persistence-configuration</root-element>
          <uri>META-INF/persistence-configuration.xml</uri>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>persistence</root-element>
          <uri>META-INF/persistence.xml</uri>
        </module-descriptor>
      </module-override>
    </deployment-plan>You can see which files can be external and which can be not. The weblogic-ejb-jar.xml can be external
    but in this case you need a deployment plan to point weblogic to the file. The ejb-jar.xml cannot be
    external (see external=false)
    The benefit of storing the weblogic-ejb-jar.xml is that your administrator can fine tune certain
    configurations by using a deployment plan, instead of having to extract the contents from the jar file
    and then repackage it again.
    No need to worry about a clustered environment, you can place the jar and the deployment plan
    on the server where the admin server is located, when you deploy an application you deploy it to
    the cluster and everything is taken care off.
    More information on deployment plans can be found here: http://download.oracle.com/docs/cd/E11035_01/wls100/deployment/config.html

  • Looking up Identical EJB both locally and remotely

    prior to posting this request, i have read and
    attempted multiple solutions to this problem
    suggested in the forums to no avail.
    if i have the same EAR, which contains both
    an EJB Component and a WAR, deployed to multiple
    servers, is it possible to look up an EJB both
    locally and remotely?
    for instance, on the server performing the lookup,
    EJB A is deployed. i successfully look it up
    via the following call:
    InitialContext context = new InitialContext();
    Object ref = context.lookup(name);
    return javax.rmi.PortableRemoteObject.narrow("EJBA", EJBAClass.class);
    subsequently, i try to lookup the same ejb
    on a remote server by performing the following
    calls:
    Properties environment = new Properties();
    environment.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
    environment.put("java.naming.provider.url",
         "ormi://remoteserver:23791/application");
    environment.put( "java.naming.security.principal", "user");
    environment.put( "java.naming.security.credential", "password");
    jndiContext = new InitialContext(environment);
    Object ref = context.lookup(name);
    return javax.rmi.PortableRemoteObject.narrow("EJBA", EJBAClass.class);
    however, i either receive an authentican exception, saying "user"
    doesnt have access to allication "application", or a null pointer
    exception int the RMIInitialContext.
    on my local application, i have defined my ejbs in the web.xml
    as defined by the spec. the ejb component is marked as remote="false"
    in my orion-application.xml as well.
    the version of oc4j is 1.0.2.2.1.
    any directinon on this would be greatly appreciated.
    thanks,
    ted rice

    as a follow up to my own question, using a application
    client, outisde of the web application i can
    successfully look up my ejbs locally and remotely.
    however, from within the web application, i constantly
    receive a ClassCastException.
    if no one can tell me how to resolve this, could someone
    let me know if they have in fact looked up the
    same EJB, both deployed locally and remotely, from the
    same web application.
    thanks,
    ted

  • Difference between ejb 3.0 and hibernate

    Hi, I'm new at ejb 3.0 and I've read a little about Hibernate too, but there's one thing I don't understand. Could you tell me what's the difference between using ejb 3.0 and Hibernate, both of them are for persistence, and What about toplink?

    Hi, I'm new at ejb 3.0 and I've read a little about Hibernate too, but there's one thing I don't understand. Could you tell me what's the difference between using ejb 3.0 and Hibernate, both of them are for persistence, and What about toplink?

  • JDev 1013 BUG? EJB, CMR, DTO and session facade.

    I've created two CMP Entity EJB's, CourseEJB and PupilEJB, and defined a M:N relationship between them. A course has many pupils and vice versa. Each bean has only two attributes, id (Long, part of PK) and name (String) for simplicity.
    1. Generated DTO's for the two beans won't compile
    I get error on:
    public void addcourseEJBLocalDTO(courseEJBLocalDTO courseEJBLocalDTO)
    coursesDTO.add(courseEJBLocalDTO);
    courseEJBLocalDTO.setPupilsDTO(this);
    and:
    public void addPupilEJBLocalDTO(PupilEJBLocalDTO pupilEJBLocalDTO)
    pupilsDTO.add(pupilEJBLocalDTO);
    pupilEJBLocalDTO.setCoursesDTO(this);
    because JDev has created definitions of the setCoursesDTO function like this:
    public void setCoursesDTO(Collection<courseEJBLocalDTO> coursesDTO)
    this.coursesDTO = coursesDTO;
    and ditto for the setPupilsDTO method, taking a Collection as argument too.
    I can fix this code manually, but next step, generating a session Facade with added methods for handling the entity beans isn't exactly any better...
    One M:N relation is pretty basic, am I doing something wrong here?
    Message was edited by:
    jonmarti

    Forgot to add, running on 1013

  • Database Lite and JDeveloper / ADF

    Hello,
    I'm planning to create a small application which will run on mobile PC in an off-line mode, having synchronization with master DB once connected to the proper network.
    The main architecture on the target PC may be :
    - Oracle Lite
    - GlassFish
    - ADF application
    I downloaded JDeveloper 11.1.1.3.0 and the latest version of Oracle Lite (10.3.0.3).
    I'm looking the tutorials but none of them are talking about the JDeveloper 11g version, they all speak about BC4J/OC4J. Since I'm new to Oracle's product I don't know these "products" (framework ?) and in the 11g version this seems to have disappeared.
    Are those versions compatible with each other ?
    Will the tutorial work ?
    Regards
    PS: the same thread is present on the JDeveloper forum

    The main thread will be the one on JDeveloper section :)
    ==> Database Lite and JDeveloper / ADF

  • JMS with weblogic and jdeveloper IDE

    HI,
    I am a newbie to jms..could anyone provide me a sample tutorial to test and deploy a sample jms application using weblogic and jdeveloper IDE.
    Thanks,
    Amy
    Edited by: 838667 on Feb 22, 2011 2:50 AM

    ...I have a strong feeling this is a TIBCO-related issue where you're not doing the lookup the way TIBCO likes.

  • The missing ring between Designer and JDeveloper.

    I'm a user of both Designer and JDeveloper and I found a difficulty in making both updated at once.
    I would like to have something wich can help to map Designer table definitions to ADF entities but I still don't see anything usefull.
    I hoped the integration between Desigern and JDev could help me, but it's based upon Modules and not upot tables and then is useless.
    I looked for Jheadstart but it seems to have similar problems.
    Is there any plan to fill the gap ?
    Is there any viable soluntion already done ?
    Tks
    Tullio

    Repost

  • Hi, im a beginner in ADF and JDeveloper. Can anyone suggest me any video links for learning Oracle ADF?

    Hi, im a beginner in ADF and JDeveloper. Can anyone suggest me any video links for learning Oracle ADF?
    Thanks,
    Vijay

    Refer the below link as a starting point.
    https://blogs.oracle.com/shay/entry/how_do_i_start_learning_oracle_adf_and_jdeveloper
    http://sameh-nassar.blogspot.com.au/2010/04/main-references-to-learn-oracle-adf.html
    Cheers
    AJ

  • OBIEE 11.1.1.7 and JDeveloper integration

    Hi all,
    I am integrating OBIEE 11.1.1.7 with J Developer. I have installed OBIEE 11.1.1.7 and JDeveloper 11.1.2.3.0 on my machine. Can anyone tell me the further steps to move on.
    As per my research, I have to download an extension called Web Center portal in JDeveloper. But it is not getting displayed in the extension list. Is it compatible with this version ? If not, then which versions is it compatible with.
    Apart from this I also came across the extensions called BI ADF task extension Bundle, BI ADF Bundle. Can anyone provide me appropriate links that demonstrate use of these extensions (Any tutorials or so).
    I am just trying to explore the possibilities of OBIEE with J Developer.

    Pl see if MOS Doc 337737.1 (Oracle Clusterware - ASM - Database Version Compatibility) can help
    HTH
    Srini

  • Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.

    Hi,
    I am new to Oracle Coherence. I was looking for examples implementing Oracle Coherence step by step so as to get a basic understanding using JDeveloper but most of the examples available are using Oracle Service Bus and Eclipse.
    Could anyone please help me in providing link with examples using Oracle Coherence with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
    Thanks for the needful.
    Cheers,
    Varun

    Hi Varun,
    Please find the answers to your questions below:
    1) Could you please let me know how to use this system property -Dtangosol.coherence.override in my application so that I can coordinate between the cluster used by my application and the one started for using Coherence Node.
    You need to specify this property in the Java Options of your server or cache node startup script.
    2) I was trying to understand how to use this tangosol-coherence-override.xml but the document is pretty confusing. I am not able to understand that whether I am suppose to use it at server level or at application level.
    I would suggest extract the coherence.jar and you it would be important for you to have a look at the tangosol-coherence.xml and tangosol-coherence-override.xml. This file is used to override any of the properties specified in tangosol-coherence.xml for your cluster configuration for example, clustername, multicast ip and port or WKA for unicast, logging and so on.
    3) Another point is how to coordinate among tangosol-coherence-override.xml, coherence-cache-config.xml and -Dtangosol.coherence.override system property from my application
    Ideally you should specify in the java options of your application startup but you can also sepcify using System.setProperty("property", "value") in you code for specifying the various properties
    4) How to use the cache updating mechanisms from an application?
    I am not clear what do you mean by cache updating mechanisms? If you mean how you can update the cache from application then you can use simple Put, Entry Processor and so on. Refer NamedCache APIs to start with for operations but there many other ways to update the cache from within application or otherwise
    Hope this helps!
    Cheers,
    NJ

  • Can EJB 1.1 and EJB  2.0 Coexists ?

    Can EJB 1.1 and EJB 2.0 Coexists.
    We have an Application in EJB 1.1. We want to shift to EJB2.0.
    Do we need to change all the EJBs in one go or can we change one by one, the 2 versions existing together in the same EAR file ? We are using Weblogic 6.1.

    Migrating from Enterprise JavaBeansTM (EJBTM )1.1 to 2.0
    http://developer.java.sun.com/developer/technicalArticles/ebeans/ejbmigrate/

Maybe you are looking for

  • 1KEK Transfer payables/receivables does not work

    Hello all, The 1KEK report does not work. Though it says "data was copied from co code" it does not reflect in the PCA reports. Nor does it show any log. No document is created. Are there any config settings to make this happen ? We have new GL but d

  • Number of records in SAP Query

    Hi There, I have created a SAP Query. Instead of rows in the output I would like to display number of rows fetched in my list output. How can I do this? Please advice. Thanks in advance, Rams.

  • Preview app quits unexpectedly after installing lion

    I updated to osx Lion a short while ago, and every time i try to open an image or a document, it quits unexpectantely, and it shows this report : Process:         Preview [14592] Path:            /Applications/Preview.app/Contents/MacOS/Preview Ident

  • Logic Crashes During AU Load/Opening Suddenly

    Most of my projects I've been un-able to open the past week. All updates installed. Tried re-installing Logic back to 9.0.....nothing. It locks and gives a report (see Divshare link below for text file)  at either "compressor" or "EQ". So my guess it

  • Can't burn a cd." message reads Disc recording not found.any help

    I have download all the new installers ran 64 bits but it won't let me burn a cd from the playlist. Message keeps coming up DISC RECORDING NOT FOUND. Any help you could give on this?? This my first time on this site, but I have burned lots of cds in