You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The element collection is used to store elements of different types. Area, points, segments etc.
So for e.g. Area can have multiple childs including point, segment etc and each child can have its own subchilds
The document will have full element details and selective child details with full hierarchy.
The child will be present in database independently as well with complete details.
Any update/delete/create to the element will require the changes to be propageted to the parent & child elements respectively.
Would we also require mapping annotation usage between parent and child?
ENTITY
@MappedEntity
public class Element{
@Id
@AutoPopulated
private UUID id;
@NotNull
private ElementType elementType;
@NotNull
private String name;
@NotNull
private PointGeoJson pointGeometry;
@Nullable
private Set<Element> associations;
... other attributes ...
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What would be the best approach to implement below use case in MICRONAUT DATA mongoDB
The use case:
https://i.stack.imgur.com/3hnWX.png
One to Many mapping in the same collection
The element collection is used to store elements of different types. Area, points, segments etc.
So for e.g. Area can have multiple childs including point, segment etc and each child can have its own subchilds
The document will have full element details and selective child details with full hierarchy.
The child will be present in database independently as well with complete details.
Any update/delete/create to the element will require the changes to be propageted to the parent & child elements respectively.
Would we also require mapping annotation usage between parent and child?
ENTITY
PARENT
CHILD
Do we also require any annotation usages for mapping between 2 elements or is it not required?
Beta Was this translation helpful? Give feedback.
All reactions