Skip to content

Support associations and persistent entities stored in separate Regions with Repositories [DATAGEODE-251] #300

Open
@spring-projects-issues

Description

@spring-projects-issues

Derek Beauregard opened DATAGEODE-251 and commented

This is a frequent customer request and something that is very commonly custom developed by GemFire customers.

This is conceptually similar to the (eager or lazy) loading of foreign key relations in a relational database ORM frameworks. This applies for one-to-one, one-to-many, many-to-one, and many-to-many relationships.

For example, if Object A contains a list of Object B(s). Object A is stored in Region A, and Object B is stored in Region B. When I put/persist Object A I want the ability to persist both object A, in Region A, and also all the referenced Object B(s), in Region B (and not also in Region A). When I read/query for Object A I want the list of Object B(s) to be automatically populated in Object A. This should be configurable to be either eager, lazy, or disabled.

A specific example would be Orders and Products, where each Order contains a list of Products. Orders and Products live in separate regions. When I query for an Order I also want the List of Products to be populated.

Today customers have to write custom, boiler plate, logic to accomplish this. Typically this is accomplished by storing a list of keys to the nested Object in addition to the list of that Object. When saving the Object you have to populate the list of keys, separately persist the nested objects, null out the list of nested objects in the parent, and then persist the parent object. For reading/querying the Object you have to read the parent object, then ready the nested object for each key in the list, populating the nested object list.


Reference URL: https://jira.spring.io/browse/SGF-237

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions