Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Add support for marking a repository with @Region rather than the entity - #55

Closed
pidster wants to merge 4 commits into
spring-attic:masterfrom
pidster:master
Closed

Add support for marking a repository with @Region rather than the entity#55
pidster wants to merge 4 commits into
spring-attic:masterfrom
pidster:master

Conversation

@pidster

@pidster pidster commented Mar 4, 2014

Copy link
Copy Markdown
Contributor

An entity marked with @region("regionName") can't be persisted in more than one Region.
This patch permit a repository to be marked with @region as an alternative to the target entity.

@jxblum

jxblum commented Mar 4, 2014

Copy link
Copy Markdown

Undo the @SuppressWarnings cleanup commit.

@pidster

pidster commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

Done.

@jxblum

jxblum commented Mar 4, 2014

Copy link
Copy Markdown

Thank you

jxblum pushed a commit to jxblum/spring-data-gemfire that referenced this pull request Mar 5, 2014
…g an entity to multiple Regions in the GemFire Cache.
@jxblum

jxblum commented Mar 5, 2014

Copy link
Copy Markdown

Review comments sent in email.

@odrotbohm

Copy link
Copy Markdown
Contributor

I think the changes in GemfireRepositoryFactory should be simplified to the following pseudocode:

  • check repository interface for @Region annotation, if available, use that one
  • else fall back to region name provided through GemfirePersistentEntity

As John pointed out in the email, handing a repository interface to the MappingContext is not really using the context as expected.

Another option to consider might be to allow SpEL expressions in the @Region annotation's value attribute to allow people to customize the region something is persisted to on a call by call basis (a thread bound property or the like). MongoDB already supports that, see BasicMongoPersistentEntity for example.

jxblum pushed a commit to jxblum/spring-data-gemfire that referenced this pull request Mar 6, 2014
…g an entity to multiple Regions in the GemFire Cache.
@jxblum

jxblum commented Mar 6, 2014

Copy link
Copy Markdown

Closing this PR (#55) in favor of PR #56.

@jxblum jxblum closed this Mar 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants