11g TP2 and NamedStoredProcedureQuery

OK, this has me baffled.
Documentation on stored procedures and JPA is often unclear, missing, or less relevant (ie., lots of examples for Hibernate XML mapping files, but nothing re: annotations). However TP2 of TopLink now appears to provide some support for stored procedures.
First, several simple questions...
1) Is it possible to represent a stored procedure as one would a table, using annotations?
2) If yes, can these annotations be used to create an object (DAO, interface, etc.) as one would with a table? Basically, an object that represents the returned rows and includes the annotated knowledge to execute the stored procedure?
Assuming the answer to both questions is yes, then...
Clearly, for stored procedures we're not generally talking about something that needs to be persisted.
Here's what I have...
A legacy database containing a number of tables and two stored procedures. I'm tasked with creating a "library" for java apps (and servlets) that need access to this data. In many cases, calling one of the two SPs will suffice. As it stands, Spring is a big player for several existing tools that talk to the DB, with each using its own access methods.
I'm done with the tables and have created interfaces, dao, class, etc.
I'm stuck trying to decide how to handle the stored procedures. I could write POJOs to handle them, but then I lose some of the built-in convenience features of JPA/Hibernate/Spring/etc. I would prefer that developers using the library be able to access everything in a similar manner, whether table or SP.
Let's assume the following (simple) stored procedure, and, for the sake of simplicity, all input and output columns are INT....
CREATE PROCEDURE withParams (item INT)
BEGIN
  SELECT distinct column1,column2
    FROM results
    WHERE column1=item
END
GO Should something along the following "work" for the withParams procedure?
import javax.persistence.Entity;
import oracle.toplink.annotations.NamedStoredProcedureQuery;
@Entity
@NamedStoredProcedureQuery(name="getInfoUsingInput", procedureName="withParams",
         resultClass=Test.class,
         procedureParameters={@StoredProcedureParameter(queryParameter="item")}
public class Test implements java.io.Serializable {
}-David
Message was edited by:
user610697

David,
The @NamedStoredProcedureQuery is intended to be a natural extension to JPA's @NamedQuery where the query returns a result which could either be raw data values or a mapped entity. These are basically intended to allow you to optimize the access to an entity mapped to a table.
TopLink does support mapping onto a virtual table through the use of stored procedures provided you have stored procedures to represent all aspects of the CRUD operations for the entity. This requires you to provide custom queries used StoredProcedureCall for all necessary operations. Your entity will continue to be mapped as if the table exists but at runtime TopLink will use your stored procedures mapping the non existent table's columns onto the IN/OUT parameters of your query.
Does this sound like what you want or is this just a single stored procedures you want to execute and get a mapped read-only entity back?
Doug

Similar Messages

  • MyFaces Tobago and Jdev 11g TP2 [BUG??]

    Hi I was trying Jdev 11g TP2 and wanted to test the components from MyFaces Tobago, but when I added the Tobago JAR's the design view stop showing the preview of the standard jsf components and show them like unrecognized tags; and I haven't add any tobago component. what am I doing wrong? is it a BUG?
    EDIT:
    The thing same happens with the MyFaces Tomahawk Components. Is there any problems with MyFaces Compnents?

    Hi,
    make sure you use JSF 1.2 versions of the component set because JDeveloper 11 uses JSF 1.2. Beside of this chances are likely that this is an issue in teh current JDev 11 build. There is a TP3 planned for December, Can you verify if the issue reproduces then ?
    Frank

  • 11g TP2 ADF Task Flows and Transaction Management

    I'm wondering how ADF Task Flow Transaction Management works vis-a-vis database sessions and using stored procedure calls in an environment with connection pooling. I haven't written the code yet but am looking for a better understanding of how it works before I try.
    Example:
    I create a bounded adf task flow. I set the "transaction" property to "new-transaction" and the "data control scope" to "isolated".
    As the task flow is running, the user clicks buttons that navigate from page to page in the flow. Each button click posts the page back to the app server. On the app server a backing bean method in each page calls a stored procedure in a database package to modify some values in one or more tables in the database. The procedure does not commit these changes.
    Each time a backing bean makes a stored procedure call will it be in the same database session? Or will connection pooling possibly return a different database connection and therefore a different database session?
    If the transaction management feature of the adf task flows guarantees me that I will always be in the same database session then I don't have to write any extra code to make this work. Will it do that or not?

    I don't know if it is documented in the adf documentation currently available for 11g TP2 but what you ask for is a normal transaction management with connection pooling and i can't imagine it is not implemented in ADF BC layer like it is in JPA or other persistence layer.
    A transaction will always be executed in the same session. Normally your web session will stay in the same session even you start more than one transaction. You don't have to write any code to manage the session pooling. It is a good practices to customize it at the persistence layer during installation depending on your infrastructure.
    Take a look into Fusion Developer Guide ... i'm sure you will find some better explanations about this.

  • ADF BC project migration errors from 10.1.3.3 - 11g TP2

    Hi all,
    I have a current 10.1.3.3 project using ADF BC and Faces that I have been testing to migrate to 11g TP2. My question is specifically about the BC project. Although the migration wizard completes without error or warning, I end up with some issues in the migrated project. There is one that I have not been able to rectify (short of re-creating my BC objects) where attempting to use the Application Module gives weird errors about view links not being specified properly. I have tried migrating the project several times and receive the same issue each time.
    My question: should I just wait for TP3 and re-attempt the migration to see if the issue goes away, or should I provide the application to someone at Oracle to have a look at? I can provide a checkout only password for our Subversion repository if that would help as well.
    Best regards,
    John

    If you open the project in the 11g preview it will automatically update the metadata and generate the deployment XML in the new format. Alternatively you should be able to open the 10.1.3.3 metadata in the 11g preview's runtime.
    The biggest issue you may encounter in the upgrade besides replacing the libraries and ensuring you are using JDK5 is the removal of the code deprecated in previous releases.
    Doug

  • How to Deploy 11g Forms and EBS Applications?

    Dear All,
    Just need to know some technical information regarding EBS.
    Previously I have worked with Oracle forms and reports 6i and we used to deploy the application developed in this tool to publish using Application Server 9i/10g. I also have hands on experience on that.
    Now after 4 years I am again trying to do some hands-on on later versions.
    Just want to know that for Developer Suite 10g, If i developer the application it will be published using Application Server 10g? so that the user can access this application?
    How EBS application is host and published?
    Will really appreciate your kind help.
    Thanks, Imran

    How to Deploy 11g Forms and EBS Applications? Forms 11g is not certified with EBS 11i/R12
    Just need to know some technical information regarding EBS.
    Previously I have worked with Oracle forms and reports 6i and we used to deploy the application developed in this tool to publish using Application Server 9i/10g. I also have hands on experience on that.
    Now after 4 years I am again trying to do some hands-on on later versions.
    Just want to know that for Developer Suite 10g, If i developer the application it will be published using Application Server 10g? so that the user can access this application?
    How EBS application is host and published?
    Will really appreciate your kind help.Oracle Developer 10g comes as part of Oracle EBS installation, so no Oracle AS installation is required. You need need to install Developer 10g on your client to build forms/reports.
    Using the OracleAS 10.1.2 Forms and Reports Builders with Oracle Applications Release 12 [ID 444248.1]
    How To Bring Up 10G Forms Builder In R12 Environment? [ID 579318.1]
    Thanks,
    Hussein

  • 11g CRS and ASM, 10.2.0.4 database, how to set up RMAN

    Hi all, I am fairly green when it comes to RAC so please bear with me. I have a Linux 2 node RAC environment. The servers are lux148 and lux149. The 2 node cluster is running 11g CRS and ASM. The database is 10.2.0.4. It had to be set up this way in order for IBM DataStage to work. The database name is fictrp0. The instances are fictrp01 (lux148) and fictrp02 (lux149). I am trying to register the database with an RMAN catalog. I am under the impression that I need to register the database (fictrp0) not the instances (fictrp01 and fictrp02) with the RMAN catalog. Is this correct? So I log into lux148 and set my environment so the ORACLE_SID=FICTRP0. From the command line I issue the following:
    fictrp0:/u01/app/oracle> rman target / catalog rman102/[email protected]
    The command returns the following:
    Recovery Manager: Release 10.2.0.4.0 - Production on Wed Oct 29 14:05:50 2008
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    connected to target database (not started)
    connected to recovery catalog database
    Is this normal "connected to target database (not started)"? I was expecting to see a DBID=FICTRP0 for the target. If this is typical, how will RMAN know the ID of the database? Should I be trying to register an instance perhaps such as FICTRP01? If so do I need to register both instances (FICTRP01 and FICTRP02)?
    Bottom line I am very confused on how RAC and RMAN work together. Any help would be greatly appreciated.

    You no need to register the instance,You need to register only the database and database only will have DBID

  • Oracle BAM 11g - Deployments and development questions

    Hi!
    I have few questions related to Oracle BAM 11g developement and deployment processes. We are going to use that together with Oracle SOA Suite 11g ( BPEL / BPM processes), and now my questions are related to development phase:
    1. If we have two or more Oracle BAM developers with their own Oracle BAM server instances, and we would like to share our development work, should/can we you same database repository to share the reports, data objects?
    2. How we can copy Oracle BAM Data Objects, Reports etc from one environment (dev) to other environments (test, accept test, integration test, production) ? In software deployment projects (like Spring or Grails web-projects) we have used version control system and CI to build packages to different environments etc. How is the Oracle BAM deployment process actually "planned to be" since it uses its database repository to store objects and reports ?
    3. The Oracle BAM itself has nice reports etc (Oracle BAM Client) that can be used using IE browser. How if we have to show/include those reports from Oracle WebCenter Spaces ? Is it possible and how?

    Hi,
    Were you able to find the answer to your questions? Especially the one, showing BAM reports in Webcenter Spaces?

  • Password reset option difference b/w Oracle 11g R1 and R2

    Hi,
    I came to know that the password reset option is different comparing 11g R1 and R2. My understanding is as below.
    For R1, you need to do a password reset for the user id separately and for the account access which that particular user id has access will be different.
    For R2, if you reset the password for user id which will reset the password for user id and as well as the all the accounts which that user has.
    Here is my Ques.
    1) Let me know if my both above statements are correct.
    2) Because When i click on home button in Identity self Service, i do see an password reset option as "account" and value as "Oracle Identity manager". i could see the same option even though if i integrate an application which is database related.
    Also the doc for R2 says you have two options to do the password reset. Pls check 6.2) Changing Password and option 2. Let me know what is correct and what is wrong here.
    http://docs.oracle.com/cd/E27559_01/user.1112/e27151/my_profile.htm
    Thanks in Advance,
    Satheesh.

    Please find my answer with respect to OIM 11gR2
    Suppose you are selecting AD from the drop down and resetting the password then 'Password Updated' task will be inserted into the process definition of AD
    and propogated to the target system. It simply means you are changing UD_ADUSER_PASSWORD field in process form.
    Even after doing this change you will be able to login with your old password
    When you select value as "Oracle Identity Manager" then it is changing the user password at this instance. So the new password you are giving comes into effect for that user and you will be able to login next time with this new password only.Also 'Change User Password' task is inserted in all process definitions where this task with same name is present.
    This is the real password change and the previous option you did is to change the value in process form for that particular account and propogate it to the target.
    Hope this helps

  • Oracle Rac 11g R2 and Openfiler

    hi all.
    i am using Oracle Linux Enterprise 5.5 Openfiler 2.9 ,Grid 11g R2 and oracle Database 11g R2.
    i created 3 disks ,Disk1,Disk2 and Disk3 but i gave the size to DISK2 and DISK3 40GB
    and DISK 5GB plz can anyone guide me by using OPENFILER how much SIZE(GB) i can use for each DISK?

    hi all.
    is there any other way to work like openfiler i want to create voting disks for my rac,i used openfiler for that,
    plz can anyone tell me is there any good way to create large disks for rac datas?

  • HTTP server on Oracle 11g R1 and apex listener

    I have installed APEX 4.0.1 on Oracle 11g R1 and things went well until the installation of the APEX listener.
    - I followed the installation guide and I opted for the basic connection type but I found the following message:
    the network adapter could not establish the connection
    I then checked my services and i noted that i had only four services which are:
    - OracleDBConsoleORCL
    - OracleJobSchedulerORCL
    - OracleOraDb11g_home1TNSListener
    - OracleServiceORCL
    And there is no oracle HTTP server as I had for oracle 9.2 on another machine.
    Can Anybody help on this ?
    thanks in advance for your help,
    Pierre

    Hi Pierre,
    as Tony posted, you usually chose the APEX Listener to access your APEX instance by using a J2EE container (like OAS/OC4J, Oracle WebLogic, Sun Glassfish) rather than using OHS+mod_plsql. So you'd need to search for the service that comprises the J2EE container to which you deployed the war-File for the APEX Listener.
    So as it seems you did not deploy to an existing J2EE container (you would not the proper URL...) you probably want to use the embedded web container of the APEX Listener. This container does not register any service and is started on demand.
    If you deployed to an existing J2EE container, use its access scheme ( PROTOCOL://HOST:PORT/CONTEXT ) to access the APEX Listener, where CONTEXT is defaulted to apex if you stick to the installation manual. Remember to configure the APEX Listener after deployment via PROTOCOL://HOST:PORT/CONTEXT/listenerConfigure , as described in the installation manual.
    Please follow the installation manual for the APEX Listener thoroughly to configure that instance and get the right port to access the service on the machine on which you started that embedded container, probably your localhost.
    -Udo

  • Oracle 11G,10g and DB2 replication?

    Oracle 11G,10g and DB2 replication?
    =======================================
    We are using Oracle 11gR2. We have a table in Oracle filled with partial data (over 200K+, it may grow to 1M). The rest need to be obtained from DB2. It is not from one DB2 table.
    The DB2 is configured to run Oracle 10g within it. We have given http interface, where we need to supply(Push) the partial data using HTTP_UTIL package for each row, then DB2/Oracle 10g return the result as XML.
    It is a network heavy, slow and not reliable.
    Are we able to replicate tables between Oracle 11g and DB2/oracle 10g?
    We like to leverage the features on 11gR2 effectively.
    I find some interesting folks in this forum.
    Did anyone face such situation?
    I like to know the best approach with good performance options.
    Any idea?
    Thanks in helping.

    qwe16235 wrote:
    The DB2 is configured to run Oracle 10g within it. We have given http interface, where we need to supply(Push) the partial data using HTTP_UTIL package for each row, then DB2/Oracle 10g return the result as XML.
    Any idea?http://en.wikipedia.org/wiki/Rube_Goldberg_machine
    why is DB2 required to produce XML?

  • What are all difference between 11g Mediator and 10g Oracle service bus.

    hi all ,
    Apart from SCA concept , storing location
    is thr any other difference between 11g Mediator and 10g Oracle service bus ?
    thx in advance..

    11g introduces the SCA architecture for building the service infrastructure.
    SOA 11g uses:-
    1. Uses the weblogic Server and BEA Aqualogic Service Bus (ALSB) for the Oracle Service Bus.
    2. BPEL uses scalable DOM with reduced memory usage.
    3. New adapters and leverage for Java 2 Connector Architecture (J2CA)
    4. BAM finally ported from .Net to J2EE and is part of the service infrastructure
    5. Oracle Web Services Management built into SOA 11g service infrastructure
    6. New adapters and leverage for Java 2 Connector Architecture (J2CA). Tighter integration with E-Business Suite & large payload support.
    7. Business Rules in SOA 10g business rules are managed using the Rules Author & in SOA 11g business rules are managed using JDeveloper and SOA composer

  • Can we run 11g RAC and 12c RAC in the same server?

    There is a requirement to run 11g RAC and 12C RAC in the same server for a year or so and then remove 11g RAC?
    Current setup:
    HP-unix 3 node RAC on 11g R2
    4CPU
    64 GB RAM
    3 TB SAN storage
    no ASM
    Upgrade setup:
    HP-unix 3 node RAC on 12C RAC
    8CPU
    128 GB RAM
    6+ TB SAN storage
    ASM
    We are asked to use the same server and upgrade Hardware to install and run 12C RAC. What are the implications of running RAC in the same server/nodes?
    Thank you for your time!

    Hi,
    The following table shows you the compatibility between various versions:
    Clusterware
    ASM
    DB
    Certified
    12.1
    12.1
    12.1
    Y
    12.1
    12.1
    11.2(a)
    Y
    12.1
    12.1
    11.1(a)
    Y
    12.1
    12.1
    10.2(a)
    Y
    11.2
    11.2(b)
    11.2
    Y
    11.2
    11.2(b)
    11.1
    Y
    11.2
    11.2(b)
    10.2
    Y
    11.1
    11.1
    11.1(c)
    Y
    11.1
    11.1
    10.2
    Y
    11.1
    11.1
    10.1
    Y
    11.1
    10.2
    11.1
    Y
    11.1
    10.2
    10.2
    Y
    11.1
    10.2
    10.1
    Y
    11.1
    10.1(d)
    11.1
    Y
    11.1
    10.1(d)
    10.2
    Y
    11.1
    10.1
    10.1
    Y
    10.2
    10.2
    10.2
    Y
    10.2
    10.2
    10.1
    Y
    10.2
    10.1(d)
    10.2
    Y
    10.2
    10.1
    10.1
    Y
    10.1
    10.1
    10.1
    Y
    (a) Pre-12.1 database instances require an ASM instance resident on the same node as the database instance. Pre-12.1 database instances cannot leverage the implicit HA of Flex ASM.
    Oracle Clusterware (CRS/GI) - ASM - Database Version Compatibility (Doc ID 337737.1)

  • Discoverer 11g installation and webcache

    Discoverer 11g installation and webcache
    I just finshed doing a standalone install of discoverer 11.1.1.6. I just dint realise that we require webcache and had unchecked that option.
    Is there a way for me to fix this?
    Thank you

    When I try to rerun the installer. It (11.1.1.2) tries to create a new oracle home. Can I uninstall Discoverer 11.1.1.2 without uninstalling weblogic and reinstall it again?
    Thank you

  • Error while install oracle 11G forms and reports  -creating Reports  Server components error

    Hello,
    while install oracle 11G forms and report i face below issue on below step ( configuration step)
      >> creating Reports  Server components error
    [2014-10-15T09:26:26.328+03:00] [as] [TRACE:16] [] [oracle.as.config] [tid: 45] [ecid: 0000K^EnlatDg^WFLzfP8A1KFHkM00000^,0] [SRC_CLASS: oracle.as.config.utl.FileUtil] [SRC_METHOD: isWebsphereEnabled] Java property  is not defined. isWebsphereEnabled=false
    [2014-10-15T09:26:26.328+03:00] [as] [TRACE:16] [] [oracle.as.config] [tid: 45] [ecid: 0000K^EnlatDg^WFLzfP8A1KFHkM00000^,0] [SRC_CLASS: oracle.as.config.utl.FileUtil] [SRC_METHOD: isWebsphereEnabled] Java property  is not defined. isWebsphereEnabled=false
    [2014-10-15T09:26:26.449+03:00] [as] [TRACE:16] [] [oracle.as.config] [tid: 45] [ecid: 0000K^EnlatDg^WFLzfP8A1KFHkM00000^,0] [SRC_CLASS: oracle.as.config.utl.FileUtil] [SRC_METHOD: isWebsphereEnabled] Java property  is not defined. isWebsphereEnabled=false
    [2014-10-15T09:26:26.458+03:00] [as] [TRACE:16] [] [oracle.as.config] [tid: 45] [ecid: 0000K^EnlatDg^WFLzfP8A1KFHkM00000^,0] [SRC_CLASS: oracle.as.config.impl.OracleASInstanceProvisioner] [SRC_METHOD: directoryIsPopulated] directoryIsPopulated found unexcluded file/dir: /u01/app/oracle/product/fmw11g/asinst_1/tmp
    [2014-10-15T09:26:26.459+03:00] [as] [TRACE:32] [] [oracle.as.config] [tid: 45] [ecid: 0000K^EnlatDg^WFLzfP8A1KFHkM00000^,0] [SRC_CLASS: oracle.as.config.impl.OracleASInstanceProvisioner] [SRC_METHOD: calcDirectoryStatus] Oracle Instance directory status: INSTANCE

    Ram,
    You didn't read the response in your other thread.
    WLS 10.3.5 isn't the right version of WLS to use with Forms 11.1.1.3
    John

Maybe you are looking for

  • Allow to create a purchase order with purchase requisiton item deleted

    Dear all, I have a question about creation purchase order process. Firstly, I have a purchase requisition with 2 items, first of them is deleted. If I try to create a purchase order thru transaction ME57N with the previous purchase requisition, I can

  • Question on file import.

    Hi, Adobe.  My LR5.2, 64-bit, has stopped creating a new file when I import images.  I can see the images and edit them in the Develop module but don't know how to access them after that.  I'm running Win 7 Home Premium. Thanks.

  • I need help in class method

    hello java lovers, i'm new here and the reson i joined is to learn some java :) well my problem is that i ws given as assignment but i can't do it :( i'm having a tones of errors :( the question is: Write an object-oriented program to fulfill the fol

  • Need Billing doc. number based on header Output type and also billing docum

    Hi I have header Output type and also billing document type. will you please help me to get the billing document no. based on above combination, any SAP table, i was aware about the same. but i forgot the table name. Thanks Vanraj

  • Videospuren verschwinden seit letzen Premiere Update

    Hallo, seit dem letzten Update von Premiere CC verhält sich mein Schnittfenster Fehlerhaft. Ich hab zwei Sequenzen offen und wenn ich von der einen in die andere Springe verschwinden alle Videospuren bzw. sie werden mir nicht mehr angezeigt. Einzig d