-
Notifications
You must be signed in to change notification settings - Fork 57
Spring Data ArangoDB : Save parent and child together #189
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
Comments
public interface AssetContentRepository extends ArangoRepository<AssetContent, String> {
@Query("<your AQL query returning Asset>")
Asset findAsset(AssetContent assetContent);
}
|
Closing for now, please reopen if still relevant. |
So inconvenient to this tool without Transaction support. From the first point of your #189 (comment). When performing two sequential transactions, if the second fails, the developer is responsible for reverting the operation? Other than deleting the first entry because the second failed? Is there is a recommended way to handle such cases with ArangoDB? |
Until support for stream transactions will be implemented, a possible workaround could be saving multiple documents (or edges) from within the same AQL query, e.g. something like: @Query("FOR d IN [@a, @b] INSERT d INTO #collection RETURN NEW")
<T> List<T> saveBoth(@Param("a") T a, @Param("b") T b) |
I am trying to build my Java Spring Boot interpretation of saving ArangoDB nodes. My code looks like below Asset.java
and AssetContent.java as
ChildOf.java to give a relation between Asset and AssetContent
where One Asset has multiple AssetContents. Now I want to achieve 3 things
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?
The text was updated successfully, but these errors were encountered: