Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] About Oracle User defined types

How would you access the fields of the object if you were using JDBC?

-Tom

On 20/01/2012 9:58 AM, Luis Dominguez wrote:



The Stored Procedures is in an oracle database. The procedure returns a
sys_refcursor, where the cursor has the following fields:

ID: it's a number field type.
Prices List: It's a list of Price type. An oracle user defined type with te
following structure:
      * Id of price item: Number field
      * priceAmount: amount. It's a NUMBER(12, 5) field.

If i used DataReadQuery with a StoredProcedureCall, the result list when the
query is executed has a list of DatabaseRecord, where the records has an object
array for the prices list.

I need to obtain the prices values, but using DataReadQuery the prices list is
returned as an Object array, with Object type elements, and no possibilities to
cast to the desired object.

Help.


    2012/1/20 Tom Ware <tom.ware@xxxxxxxxxx <mailto:tom.ware@xxxxxxxxxx>>

        Can you explain a little more about what this custom type is?  We
        provide a number of ways you can deal with special types and your choice
        will depend on how it is derived.

        At the simplest level, you can specify a Converter on the object that
        maps to the special type.  That will allow you do do some operations.

        http://wiki.eclipse.org/Using___EclipseLink_JPA_Extensions_%__28ELUG%29#Using_EclipseLink___JPA_Converters
        <http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#Using_EclipseLink_JPA_Converters>

        Alternately, we have an event mechanism that will allow you to access
        the data at various points in the query.

        http://www.eclipse.org/__eclipselink/api/2.3/index.html
        <http://www.eclipse.org/eclipselink/api/2.3/index.html>

        If the data structure is, in fact, a Struct, you may be able to make use
        of our StructConverter to operate on it as it enters and leaves the
        database.

        http://wiki.eclipse.org/Using___EclipseLink_JPA_Extensions_(__ELUG)#How_to_Use_the_.__40StructConverter_Annotation
        <http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Use_the_.40StructConverter_Annotation>

        -Tom



        On 19/01/2012 4:08 PM, Luis Dominguez wrote:

            Hi everybody.

            I'm using eclipselink with JPA. Actually, i'm using eclipselink for
            a stored
            procedure call. The results of the stored procedure have a "column",
            with a
            custom type object value. The sentence

            List<DatabaseRecord> queryResultList = (List) ((JpaEntityManager)
            main.em.getDelegate()).__getActiveSession().__executeQuery(query,
            queryArgs);

            recovers a list of DatabaseRecord, with a field as
            [Ljava.lang.Object;@10010ec
            object. When i'm trying to iterate this array, only have a
            [Ljava.lang.Object;,
            with no possibilities of see the data.

            How i can do that?





            _________________________________________________
            eclipselink-users mailing list
            eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
            https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
            <https://dev.eclipse.org/mailman/listinfo/eclipselink-users>

        _________________________________________________
        eclipselink-users mailing list
        eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
        <https://dev.eclipse.org/mailman/listinfo/eclipselink-users>





_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top