Bug 488821 - EclipseLink @Struct Fields Order and mapping them to Entity Class not working, if entity class doesn't maintain the same order
Summary: EclipseLink @Struct Fields Order and mapping them to Entity Class not working...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
Depends on:
Blocks:
 
Reported: 2016-03-02 03:12 EST by Srikanth Narisetty CLA
Modified: 2022-06-09 10:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Narisetty CLA 2016-03-02 03:12:18 EST
I am using EclipseLink product and passing Oracle Objects as IN and OUT parameters to Stored procedure. As you aware, we have @Struct annotations available in Eclipselink for representing Oracle Object, I used it and it is working perfectly. I used fields property in Struct annotation to declare order of Oracle Object columns. Thinking order of variables in Entity class doesn't matter I declared them in my own order. I have used @Column to map field and variable in Java entity class. But, this mapping doesn't work. Its always mapping from top to bottom in the fields (@Struct) order.

I have posted in couple of forums including stack overflow. But, no response from anyone. Thinking it may be a bug, raising it here.

My Source code look like this:

@Struct(name = "REC_OBJECT",
            fields = {"TRANS_ID", "PROJECT_ID", "LANGUAGE_CODE", "DESCRIPTION"})
    @Embeddable
    public class Master {

        @Column(name = "PROJECT_ID")
        private String projectId;

        @JsonIgnore
        @Column(name = "TRANS_ID")
        private String transactionId;

        @Column(name = "LANGUAGE_CODE")
        private String languageCode;

        @Column(name = "DESCRIPTION")
        private String description;

}

Eventhough I annotated projectId with PROJECT_ID column, TRANS_ID value is mapped to projectId.

Thanks
Srikanth
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:33:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink