[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (OGM-144) Support associations in MongoDB

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Mar 29 12:33:48 EDT 2012


    [ https://hibernate.onjira.com/browse/OGM-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46122#comment-46122 ] 

Emmanuel Bernard edited comment on OGM-144 at 3/29/12 11:33 AM:
----------------------------------------------------------------

h3. Proposal 4: proposal 3 + cleaner separation

{code:javascript}
//example 4: considering that MongoDB collections == tables
// in collection "User_Address"
{ 
    "_id" : ObjectId("4f7486c6318ca0fafa7761d0"), 
    "association" : {
        "addresses_id": "169e2d61-ce39-4bca-8300-185487df7119", 
    }
    "rows" : { 
        "9d2386c6318ca0fafa32867ae" : { 
            "User_id": "f11e01e8-7c2f-4795-81dc-94de7c4ba246",
            "nick": "home"
         } 
    }
}
{code}

      was (Author: emmanuel):
    h3. Proposal 4: proposal 3 + cleaner separation

{code:javascript}
//example 4: considering that MongoDB collections == tables
// in collection "User_Address"
{ 
    "_id" : ObjectId("4f7486c6318ca0fafa7761d0"), 
    "association" : {
        "addresses_id": "169e2d61-ce39-4bca-8300-185487df7119", 
    }
    "rows" : { 
        "9d2386c6318ca0fafa32867ae" : { 
            "User_id": "f11e01e8-7c2f-4795-81dc-94de7c4ba246",
            "nick": "home"
         } 
    }
}
  
> Support associations in MongoDB
> -------------------------------
>
>                 Key: OGM-144
>                 URL: https://hibernate.onjira.com/browse/OGM-144
>             Project: Hibernate OGM
>          Issue Type: New Feature
>          Components: datastore
>            Reporter: Emmanuel Bernard
>
> h3. Proposal 1
> {code:javascript}
> { 
>     "_id" : ObjectId("4f7486c6318ca0fafa7761d0"), 
>     "columnNames" : [ "addresses_id" ], 
>     "columnValues" : [ "169e2d61-ce39-4bca-8300-185487df7119" ], 
>     "rows" : { 
>         "-387062339" : { 
>             "table" : "User_Address", 
>             "columnNames" : [ "User_id", "nick" ], 
>             "columnValues" : [ "f11e01e8-7c2f-4795-81dc-94de7c4ba246", "home" ] 
>          } 
>     }, 
>     "table" : "User_Address" 
> }
> {code}	
> h3. Proposal 2
> {code:javascript}
> //example 2: closer to how entities are stored
> { 
>     "_id" : ObjectId("4f7486c6318ca0fafa7761d0"), 
>     "table" : "User_Address", 
>     "columnNames" : [ "addresses_id" ], 
>     "columnValues" : [ "169e2d61-ce39-4bca-8300-185487df7119" ], 
>     "rows" : { 
>         "9d2386c6318ca0fafa32867ae" : { 
>             "User_id": "f11e01e8-7c2f-4795-81dc-94de7c4ba246",
>             "nick": "home"
>          } 
>     }
> }	
> {code}
> h3. Proposal 3 assuming MongoDB collection == table
> {code:javascript}
> //example 3: considering that MongoDB collections == tables
> // in collection "User_Address"
> { 
>     "_id" : ObjectId("4f7486c6318ca0fafa7761d0"), 
>     "addresses_id": "169e2d61-ce39-4bca-8300-185487df7119", 
>     "rows" : { 
>         "9d2386c6318ca0fafa32867ae" : { 
>             "User_id": "f11e01e8-7c2f-4795-81dc-94de7c4ba246",
>             "nick": "home"
>          } 
>     }
> }	
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list