Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] BEFORE INSERT trigger modifies a column --> doesn't refresh in EclipseLink

@ReturnInsert is not supported for reference mappings.
I would refresh the entity instead:
  em.refresh(entity);

On 11/24/2010 4:05 PM, Bálint Kriván wrote:
     @JoinColumn(name = "FONOK_ID", referencedColumnName = "ID")
     @ManyToOne(fetch = FetchType.LAZY)
     @ReturnInsert(returnOnly = true)
     private Szemely fonok;


On Wed, Nov 24, 2010 at 9:27 PM, Andrei Ilitchev
<andrei.ilitchev@xxxxxxxxxx <mailto:andrei.ilitchev@xxxxxxxxxx>> wrote:

    Please post [field fonok] definition with all annotations.


    On 11/24/2010 3:02 PM, Bálint Kriván wrote:

        WARNING: Ignoring the @ReturnInsert on the element [field fonok]. A
        @ReturnInsert is only supported with a basic mapping.

        :(

        So I have to use the Cache#evict()? The annotation was too
        perfect to be
        true.

        On Wed, Nov 24, 2010 at 8:49 PM, Andrei Ilitchev
        <andrei.ilitchev@xxxxxxxxxx <mailto:andrei.ilitchev@xxxxxxxxxx>
        <mailto:andrei.ilitchev@xxxxxxxxxx
        <mailto:andrei.ilitchev@xxxxxxxxxx>>> wrote:

            I meant:
            Set it to TRUE if nothing should be passed to the db in INSERT
            statement.


            On 11/24/2010 2:47 PM, Andrei Ilitchev wrote:

                Set it to false if you insert the value for the property
        in Java
                program: the value is passed to the db in INSERT
        statement, then
                another
                value (produced by the trigger) is returned.

                Set it to false if nothing should be passed to the db in
        INSERT
                statement.

                On 11/24/2010 2:44 PM, Bálint Kriván wrote:

                    Thanks Derek and Andrei!

                    It seems the annotation is absolutely for this
        purpose, I've
                    checked the
                    javadoc:
        http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/annotations/ReturnInsert.html

        <http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/annotations/ReturnInsert.html>But

                    no help for the returnOnly attribute, what does it
        do? What
                    happens if I
                    set it to false? Thanks!

                    On Wed, Nov 24, 2010 at 8:36 PM, Andrei Ilitchev
        <andrei.ilitchev@xxxxxxxxxx <mailto:andrei.ilitchev@xxxxxxxxxx>
        <mailto:andrei.ilitchev@xxxxxxxxxx
        <mailto:andrei.ilitchev@xxxxxxxxxx>>
        <mailto:andrei.ilitchev@xxxxxxxxxx
        <mailto:andrei.ilitchev@xxxxxxxxxx>
        <mailto:andrei.ilitchev@xxxxxxxxxx
        <mailto:andrei.ilitchev@xxxxxxxxxx>>>> wrote:

                    Annotate the property with
                    @ReturnInsert(returnOnly=true)


                    On 11/24/2010 2:24 PM, Bálint Kriván wrote:

                    Hi!

                    I have a column which is managed by a trigger in DB
        (Oracle 9i
                    (production)/10g (dev)). But when I try to use the
        getter
                    method to
                    access this property of the object I'm getting null.
        When I
                    redeploy my
                    application it works, because EclipseLink cache is being
                    purged (My
                    application persisted the object as this property
        would be
                    null, but
                    trigger modified it -- which isn't propagated to
                    EclipseLink). My
                    question is that; is there a way to make this work?
        In the other
                    thread
                    I was advised to use the EntityManager#getRefrence()
        method, but
                    obviously I can't use this in this situation. I'm
        sure that
                    there should
                    be some trick to make this work, because I'm pretty
        sure this is
                    a very
                    frequent use case.

                    --
                    Regards,
                    Bálint Kriván



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

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




                    --
                    Üdv,
                    Kriván Bálint



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

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

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




        --
        Üdv,
        Kriván Bálint



        _______________________________________________
        eclipselink-users mailing list
        eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
        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




--
Üdv,
Kriván Bálint



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


Back to the top