Closed
Description
I am trying to build my Java Spring Boot interpretation of saving ArangoDB nodes. My code looks like below Asset.java
@Data
@Document("assets")
public class Asset {
@Id
String key;
String name;
String description;
String path;
LocalDateTime imported_at;
}
and AssetContent.java as
@Data
@Document("asset_contents")
public class AssetContent {
@Id
String key;
String name;
String extension;
String content;
}
ChildOf.java to give a relation between Asset and AssetContent
@Data
@Edge("edges")
public class ChildOf<T1, T2> {
@Id
private String id;
@From
private T1 child;
@To
private T2 parent;
public ChildOf(final T1 child, final T2 parent) {
super();
this.child = child;
this.parent = parent;
}
}
where One Asset has multiple AssetContents. Now I want to achieve 3 things
- Save an Asset and list of Asset Contents at once (Create a list of AssetContents and store in my Asset.java, then save Asset should also save AssetContents).
- Get the asset using the AssetContent repository.
- Get the list of asset contents using the AssetRepository.
Since I am new to ArangoDB and also because of the limited tutorial. Could someone help me with the changes I have to make in the code?