Issue Type: Improvement Improvement
Assignee: Unassigned
Components: core, datastore
Created: 06/Jul/12 6:36 AM
Description:

With the work done in IN_ENTITY (MongoDB), we now see that we don't really require to store as much data as we are doing today in regular Associations.
Plus the structure is questionable redundancy wise (using MongoDB's example)

{
    "_id" : ObjectId("4ff6c04fa8fa2db9fd76f34b"),
    "columns" : { "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b" },
    "rows" : [ { 
            "table" : "Cloud_SnowFlake", 
            "columns" : { 
                "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b",
                "producedSnowFlakes_id" : "27b678d2-0f17-43bc-801e-2a714f1cca8c"
                },
            "tuple" : { 
                "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b", 
                "producedSnowFlakes_id" : "27b678d2-0f17-43bc-801e-2a714f1cca8c"
                }
           },
           {
            "table" : "Cloud_SnowFlake",
            "columns" : {
                "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b",
                "producedSnowFlakes_id" : "cc80b5db-0db3-47a0-96fb-dbc70793c832"
                },
            "tuple" : {
                "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b",
                "producedSnowFlakes_id" : "cc80b5db-0db3-47a0-96fb-dbc70793c832"
                }
        } ],
    "table" : "Cloud_SnowFlake" 
}

We could rethink that to only store the relevant bits of information and use _id in a similar way as we do now for entities since OGM-174.
The new structure could be

{
    "_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b", 
    // If a composite key, it would be
    // "_id": {  "Cloud_id" : "da3d8f5d-f024-4c6a-b813-81a7a643a08b", "foo_id": 3}

    //table is only present if we are not using GLOBAL_COLLECTION
    "table" : "Cloud_SnowFlake",

    "rows" : [ 
        { 
            "producedSnowFlakes_id" : "27b678d2-0f17-43bc-801e-2a714f1cca8c"
        },
        {
            "producedSnowFlakes_id" : "cc80b5db-0db3-47a0-96fb-dbc70793c832"
        } ]
}
Project: Hibernate OGM
Priority: Major Major
Reporter: Emmanuel Bernard
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira