Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for annotations within nested objects #60

Closed
i-telligence-af opened this issue Oct 20, 2020 · 2 comments
Closed

Support for annotations within nested objects #60

i-telligence-af opened this issue Oct 20, 2020 · 2 comments

Comments

@i-telligence-af
Copy link

I have a scenario where an object has an embedded object (field) which itself is persisted as part of the outer @document but annotated fields within the embedded object should be scanned for @OnetoOne and @OneToMany annotations.

Example:

ArticleDTO {

  @Id
  private Long id;

  @OneToOne(...)
  @JoinProperty(...)
  private OtherDTO other;

  private MetaDTO meta;

}

MetaDTO {

  @Id
  private Long id;

  @OneToOne(...)
  @JoinProperty(...)
  private FooDTO foo;

}

Currently, the annotations on the FooDTO field in MetaDTO would never be read.

How about a @nested annotation, which would then perform the same functionality on the MetaDTO field?

@kaiso
Copy link
Owner

kaiso commented Oct 20, 2020

Hello @i-telligence-af thank you for your interest in RelMongo, currently this problem can be adressed by minimal change in the entity by putting the foo property outside. So I do not see and enhancement in that, I will close this issue and may be reconsider the use case if many people have this need.

Thank you and do not forget to star RelMongo ;)

@kaiso kaiso closed this as completed Oct 20, 2020
@i-telligence-af
Copy link
Author

Hi @kaiso unfortunately modifying the structure of my entities is not an option currently (I don't have control), so I will keep using my fork for now. I'll try to keep it inline with your updates, so that if you ever want to include this enhancement it should be easy.

Thanks for the great work.... starred ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants