Howto call custom Oracel Data Type with TopLink?

Hello,
in our DB we have a custom Oracle type and a PL/SQL method which uses it.
I would like to call the Oracle data type with TopLink. How can I do this?
I could not find any documentation on this.
I know JPublisher can do this but I don't want to use it!
Please see code below
cheers,
Pete
**************Datatype********************************
CREATE TYPE My_Sub_Object AS OBJECT (Sub_Object_ID Number,
Sub_Object_Txt VARCHAR2(200));
CREATE TYPE My_Sub_Objects AS VARRAY (20) OF My_Sub_Object;
CREATE TYPE My_object AS OBJECT (Object_id Number,
Object_txt VARCHAR2(200),
Sub_Objects My_Sub_Objects);
************PL/SQL-Method*****************************
CREATE OR REPLACE PROCEDURE My_object_pro
(Item_Object out My_Object) is
Item_Sub_Object My_Sub_Object;
Item_Sub_Objects My_Sub_Objects;
Begin
Item_Sub_Object := My_Sub_Object(10, 'Sub Object 10');
Item_Sub_Objects := My_Sub_Objects(Item_Sub_Object);
Item_Sub_Objects.Extend;
Item_Sub_Object := My_Sub_Object(11, 'Sub Object 11');
Item_Sub_Objects(2) := Item_Sub_Object;
Item_Object := My_Object(1, 'Object', Item_Sub_Objects);
End;
/

Object types and Varrays can be used from TopLink stored procedure calls. There was some support for this in 10.1.3, but the support in 11g (preview) is much better. You can also access the JDBC connection from TopLink or your DataSource and use JDBC directly.
In TopLink 11g you can use an ObjectRelationalDescriptor to map the Object type to a Java class, and use this class as the argument type in your StoredProcedureCall.
PL/SQL types are more difficult as they are not supported by JDBC, but your example only includes object types. If you had PL/SQL types you would need to wrap the types in object types, or use a PL/SQL block to convert them. TopLink 11g (preview 3) should have support for these as well.

Similar Messages

  • Problem with central build of Simple Date Type with Enumeration

    Dear gurus,
    I hope I'm posting this in the correct forum. Please advise if I'm in the wrong forum.
    I have a Web Dynpro DC in which I've created a simple data type with enumeration.  It is used for binding to a radio box. The data type is called DownloadType; the enumeration contains two vales: current and archive. To allow me to access the enumeration values, I turn on the "Generate a class representation of the enumeration" in the data type builder.
    I then reference the enumeration values with code like:
    if (downloadType.equals (DownloadType._CURRENT))
        yada yada yada
    This works fine when building locally and deploying directly. But when the DC is built by CBS (or doing a "Development Component->Build..." in NW Dev Studio), the build fails, stating that the DownloadType._CURRENT symbol cannot be resolved.
    For example:
    C:yadayadayada.java:227: cannot resolve symbol
    symbol  : variable _CURRENT
    location: class yadayadayada.DownloadType
                    equals(DownloadType._CURRENT))  {
    Apparently the central builder is not smart enough to handle the "Generate a class representation" flag.
    Is this a known problem? Are there any workarounds?
    Thanks in advance for any help you can provide.
    -Kelly
    P.S. Environment: 2004s

    Hi Kelly,
    works for me using SP10, what SP are you on?
    There's a line in the DC log that says:
         [ddgen] [Info]    Generating datatypes/com/x/x/x/MyEnum.java
    and the java compiler includes the matching path for compilation:
          [echo]   source paths:
          [echo]     ...\_comp\src\packages
          [echo]     ..\t\ABF37B5AFB3B2E8A76FFD29E7862EA48\gen_ddic\datatypes
    Regards,
    Marc

  • Which Data Type with 255 cars +

    Hi,
    I have a flat structure table with 15-20 fields, and I need for one of the field a data type with more than 255 cars
    I cant put a STRING without having the flat structure error ...
    Which one should I use ? How should I proceed ?
    Thanks !
    Kr,
    BA

    Hi Benjamin,
    use SE80, click repository info system, click dictionary - data elemets. Chose length > 1024. F8 to execute.
    Check where-used-list of what you like to use to make sure it is so frequently used that SAP will not change it.
    Or better create your own Z data element with required length
    Regards
    Clemens

  • Jdev11g: How to use a Ord.image data type with ADF Faces 11g

    Where to find an example about Ord.image data type with ADF Faces 11g preview3

    Hi,
    such a sample doesn't yet exist.
    Frank
    Btw.: The Jdeveloper 11 forum is JDeveloper and OC4J 11g Technology Preview

  • IT0041 : Same date type with different values in the same infotype

    Hi,
    Is it possible to store in the 0041 infotype, the same type date but with a diffentent date.
    Example :
    IT0041
    employee 1000:
    date type : xx 01.05.10
    date type : xx 02.05.10.....
    Thanks

    Hi there,
    My two cents.
    I don't think it can be done in standard. Also copying IT 0041 would limit you to enter only 12 dates.
    My suggestion:
    Create a custom infotype with subtype field and a date field like IT 0015.
    On the screen you will only be seeing subtype and date. And assign time constraint 3 to it.
    In this way with the same subtype you can record several dates.
    cheers
    Ajay

  • Custom/Complex data types in web services

    Hi,
    I've read in several articles here on otn that JDev 9.0.3 would have better support for
    creating web services with complex datatypes (like java.util.LinkedList), but still (in the 9.0.3 Preview)
    theese methods are greyed out on the web service wizard. Am I missing something?
    Until now I've worked with Custom Serializers, but they are time consuming and hard to work with.
    /Mattias

    Here are the two articles that will help:
    JavaBeans as Web services parameter types:
    http://otn.oracle.com/tech/webservices/htdocs/samples/customtype/content.html
    Registering Web services custom serializers:
    http://otn.oracle.com/tech/webservices/htdocs/samples/serialize/content.html
    The new support in JDev 9.0.3 is that JavaBean parameters are now recognized by the JDev publishing wizards whereas in JDev 9.0.2 there was the workaround pointed to by the first article. In 9.0.2 the publishing support was only for primitive data types.
    The upside of the custom serializers, is you can re-use your existing serializers if they happen to have been written to Apache SOAP.
    Mike.

  • Data type with large size in a table and updating it

    Hi guys,
    i am working on a requirement in which i need to create 4 tables. Here, 2 tables will be updated by the user and a program will update this content to the other 2 table.
    2 days before i posted a query on this, Previously i stucked on a part where, table need to entries with size char 400 and char 9000. As from the reply, i changed it to STRING with which table was sucessfully created and i was able to update data through a report program.
    Now we ned to provide an sm30 option to users, so they can insert new contents and update the status of old contents. But when i tried this table maintanance generator, i got an error that table contains string, so maintanance generator cannot be done ! i changed the data type to rawstring also. Now maintanance generator got saved, but when i open the table in sm30, i am getting dump saying tht table is using string/char etc.
    can anyone tell me what data type to use in this scenario with which we can enter data through sm30 ?

    Hi Kithu,
    you can use STRING (or XSTRING) fields. Then there is no limit on the field size. As long as it is not (fully) filled with data, no space is wasted.
    The disadvantage is that STRING type data are treated as 'deep' structures. That leads to some trouble in the definition of interfaces. Give it a try!
    Regards,
    Clemens

  • Project Site custom list data reporting with Odata connection, BI reports in Project online 2013.

    Hi,
    Can we create an excel report with Odata feed connection which includes project site custom list data?
    Example: My Project is "ProjectTest" and it has a project site in which i created a custom list "ProjectNotes" with some new columns. I want to include these columns in my report.
    sandeep

    Hello,
    when using the SharePoint ODATA or REST APIs each list and site would have a different endpoint URL. Some example URLs are below:
    REST API:
    https://test.sharepoint.com/sites/pwa/Project01Test/_api/Web/Lists/getByTitle('ProjectNotes')/Items
    https://test.sharepoint.com/sites/pwa/Project01Test/_api/Web/Lists/getByTitle('Risks')/Items
    ODATA SVC:
    https://test.sharepoint.com/sites/pwa/Project01Test/_vti_bin/listdata.svc/Issues
    https://test.sharepoint.com/sites/pwa/Project01Test/_vti_bin/listdata.svc/ChangeRequests
    The down site is that in Excel you cant dynamically update the connection URL so would have to add all of these in manually and create the data models - I guess this is ok if you don't have many projects and don't create many new projects. In code such as
    JavaScript it is easy and you can build up the URL dynamically using variables like below:
    projSiteUrl + "/_api/Web/Lists/getByTitle('ProjectNotes')/Items"
     The options to explore to see if you have make this dynamic and get the data you want are:
    Potentially look at the search API and use that in Excel:
    http://sharepoint.stackexchange.com/questions/98159/retrieving-list-items-from-multiple-sites-via-odata-with-excel
    http://social.technet.microsoft.com/Forums/windows/en-US/727c1893-6b42-478b-afca-b32fb259a53d/retrieve-custom-lists-from-all-projects-for-excel-reports-by-using-odata?forum=sharepointgeneral
    Power Query:
    http://blog.oraylis.de/2013/05/using-dynamic-parameter-values-in-power-query-queries/
    JavaScript (put the data on a page), example:
    http://gallery.technet.microsoft.com/scriptcenter/Server-Risks-and-Issues-on-65dcbe0e
    Or bring the data down to a custom SQL database table and report of that data:
    http://nearbaseline.com/blog/2014/04/project-site-custom-list-reporting-using-ssis-odata-connector/
    Hope that helps
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Data Type with reference and view maintenance

    Dear all,
    There are two questions that I want to ask.
    1.     Error when referencing a table with data type = u2018STRINGu2019.
    I have a Z table with some fields = u2018stringu2019, when I use this as a reference, an error prompted.
    "ZTBL_ABC" must be a flat structure. You cannot use internal
    tables, strings, references, or structures as components.-
    2.     Error in generating the View maintenance for field length > 255.
    Actually, I want to create fields with
    1.     data type = char(255),
    2.     data type = text
    3.     data type = char(3000)
    It is okay if I create the field with the selected size, however, when I generate the View maintenance (which can be access through SM30); it does not allow me to do so. It still not working if I change it into string. How can I create such table and use the table maintenance, as well as using that as the reference type of an internal table for another program?
    Regards,
    Mandy Au

    Hello,
    1st of all a table which has a field of type string can be converted in to table maintenance because TM does not support string type as it becomes a very big field to be displayed on screen ... so u need to change that.
    and then about the CHAR of length 3000 is too big ... to have a max limit of 255.
    If you change this both u will be able to generate TM.
    Incase after changing the field length it it gives error in activatin your table then go to SE14 put your table name EDIT and then Adjust n activate it....
    hope this was helpful
    --- Close the post once you get the solution

  • Generate Serializable data types with WSDLC

    Hello everyone,
    I'll was pretending to send a through a JMS ObjectMessage a type generated from WSDL with the wsdlc ant task. Unfortunately the generated types are not serializable and so I'm unable to send the message. It's really ackward to manualy change all of them so I would like to know if it's possible to instruct wsdlc to generate serializable data types. I'm using Weblogic 11gR1PS1. If it's not possible what do you recommend ?
    Currently the tasks are configured like this:
    <taskdef name="wsdlc" classpathref="weblogic.classpath" classname="weblogic.wsee.tools.anttasks.WsdlcTask" />
    <wsdlc srcWsdl="ejbModule/META-INF/wsdl/DataCatalog.wsdl" destJwsDir="gen" destImplDir="gen" packageName="br.com.allwayx.schema" type="JAXWS">
    Obs: I noticed that If I use a binding element inside the task passing any xjb file the wsdlc task generates a pair of Entity interface - EntityImpl implementation class. It stays like this:
    <wsdlc srcWsdl="ejbModule/META-INF/wsdl/DataCatalog.wsdl" destJwsDir="gen" destImplDir="gen" packageName="br.com.allwayx.schema" type="JAXWS">
                   <binding dir="${binding.declaration.dir}" includes="${binding.declaration.file}" />
    </wsdlc>
    Still I would like to keep the old way, without the binding element which generates just a concrete class for each element. Maybe this is a bug?
    Thank you !
    Edited by: Lupan on 28/04/2010 13:13

    Hi Lupan,
    Currently I believe there is no way to instruct WSDLC task to generate the Serializable data types.
    There was already a BUG opened with BEA for WLS -9.0 following are the BUG details:
    http://download.oracle.com/docs/cd/E13222_01/wls/docs100/issues/known_resolved.html
    CR228385
    Description:
    The Web Service Description Language (WSDL) compiler does not generate serializable data types, so data cannot be passed to remote EJBs or stored in a JMS destination.
    You should contact the Oracle Weblogic Support to get the current status of the BUG.
    Thanks,
    Sandeep

  • Decimal data type with negative sign

    Hi Gurus,
    I wanted to created a z table with a filed of type decimal with sign.  What I did is I created a field in predifined type with dec type, but -ve sign is not taking at the time of entering the data in SM30. Its saying only +ve values are allowed. Please let me know how can I achieve this. My data will be like -4.1242.
    Thanks,
    David.

    Hi..
    Try using another field as an indicator for negative fields so that you can consider those signs in your program.
    Regards,
    Karthik

  • Creating Custom fields (data type QUAN) using EEWB

    Hi all
    I tried to create two customised fields using EEWB for CRM Opportunity:
    1. Projected Volume (data type 'QUAN', length 13, 3 decimal places)
    2. Projected Unit (data type 'UNIT')
    In the SAP-generated tables, I have set the reference table field for 'Projected Volume' to point to 'Projected Unit'. However, I encountered errors that is related to Table Buffering and Restricted Transport for the Projected Volume field.
    If I were to change the data type to 'NUMC', field generation is ok. Does anyone know to resolve this issue? I need the Projected Volume field to be of data type 'QUAN' since decimal place is required.
    Thanks for your advice!

    SAP Note 746227 has addressed this issue. I will close this question.

  • How to call user define data type as data type for concurrent parameter

    Hi All,
    i find some difficulty while creating the concurrent program.
    i.e.
    i have one of the parameter of table type i.e. user define data type at PLSql program
    now i need to register same PLSQL program into oracle applications as concurrent program
    but while i am creating Parameters for concurrent program
    How could i define that user define data type at database level in oracle applications using 'Value set' ?
    any one save me from this Problem
    thanks and Regards,
    sai krishna@cavaya.

    Don't think this can be done..
    One way I can think of is to wrap your PL/SQL program under another procedure/package that can accept "normal" parameter,and use/register this wrapper instead of your original pl/sql program.
    HTH

  • Problem with custom validated data types using domain on 11g

    Hi,
    I ' m on a migration process from 10 to 11 and I notice that a custom domain didn't work correctly anymore
    to be more specific every time that I was submiting a page a was getting an error cannot convert from myclass to oracle.jbo.domain.String
    I search the forum and I saw a similar problem
    Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob
    at which Frank says that it is a known bug and suggests a work around.
    I use the workaround and it worked but some more issues came up:
    1. If the validation fails I get the error that I throw at the validate method not in a popup with just my message
    but in the whole window with the whole error stack, meaning that my custom validation is not handled like native ADF validation errors by
    the framework (at 10.1.3.4 worked OK)
    2 If i dont give a value at the attribute in the validation phase mdata variable is not null but is length is zero (at 10.1.3.4 its value was null)
    public class AFM implements DomainInterface, Serializable {
    public AFM(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    mData==null // returns false
    mData.length()==0 // returns true
    3. Can i force validation only for new or updated values? I saw that the validation process is taking place every time a row is fetched.
    This is not only a performance issue, the bigger problem is that if a fetched from the DB value fails the validation an error is return but the
    user cannot change the value to correct it.
    TIA
    Tilemahos

    since i don't get any answer I wonder if i should have use a more provocative title like
    "custom domains in 11g don't work"
    is it true?
    Tilemahos

  • 'Payload not Serializable' with custom WSDL data types in message-style web service

    I'm implementing a message-style web service which publishes to a JMS Queue.
    I had the web service built and deployed, but noticed that the "sendRequest" message's
    part was of type "xsd:anyType." This is not specific enough for our interface,
    since it is externally facing and needs to describe the object we're expecting
    on the back end.
    So I replaced xsd:anyType with mynamespace:MyType, which is defined as a complex
    type in the same WSDL document.
    My problem is that when I test the web service with the new WSDL (using the client.jar),
    I get a server-side exception from the DestinationSendAdapter.doPost() method.
    The exception reads:
    javax.servlet.ServletException: Payload not Serializable
    at weblogic.soap.server.servlet.DestinationSendAdapter.doPost(DestinationSendAdapter.java:129)
    The domain object ('classic' JavaBean) that it should map to on the server side
    extends a class that implements Serializable, so it should inherit the trait.
    So my questions are:
    1) Did I properly go about trying to restrict the object type that gets sent to
    my Destination?
    2) If no, what is the correct way? If yes, why am I receiving the Payload not
    Serializable error if the domain object implements Serializable?
    Thanks in advance.

    Resolved:
    Apparently this is the right approach, as it boiled down to a classpath issue
    on the client-side. Thanks anyway.

Maybe you are looking for