-
Notifications
You must be signed in to change notification settings - Fork 5
feat: check modify index before composite structure apply #228
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
Open
estetsenko
wants to merge
12
commits into
main
Choose a base branch
from
feat/modify-index
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c2f3920
feat: check modify index before composite structure apply
estetsenko 0eff069
feat: check modify index before composite structure apply
estetsenko 16830d8
feat: check modify index before composite structure apply
estetsenko ef4dabb
feat: check modify index before composite structure apply
estetsenko 1fae0a1
Merge branch 'main' into feat/modify-index
estetsenko f9f9b4b
feat: check modify index before composite structure apply
estetsenko 395733a
feat: check modify index before composite structure apply
estetsenko c198672
feat: check modify index before composite structure apply
estetsenko f2b4873
feat: check modify index before composite structure apply
estetsenko 91deead
feat: check modify index before composite structure apply
estetsenko c485779
feat: check modify index before composite structure apply
estetsenko 7539a7f
feat: check modify index before composite structure apply
estetsenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...om/netcracker/cloud/dbaas/dao/jpa/CompositeNamespaceModifyIndexesDbaasRepositoryImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.netcracker.cloud.dbaas.dao.jpa; | ||
|
|
||
| import com.netcracker.cloud.dbaas.entity.pg.composite.CompositeProperties; | ||
| import com.netcracker.cloud.dbaas.repositories.dbaas.CompositeNamespaceModifyIndexesDbaasRepository; | ||
| import com.netcracker.cloud.dbaas.repositories.pg.jpa.CompositeNamespaceModifyIndexesRepository; | ||
| import jakarta.enterprise.context.ApplicationScoped; | ||
| import jakarta.transaction.Transactional; | ||
| import lombok.AllArgsConstructor; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| @AllArgsConstructor | ||
| @ApplicationScoped | ||
| public class CompositeNamespaceModifyIndexesDbaasRepositoryImpl implements CompositeNamespaceModifyIndexesDbaasRepository { | ||
|
|
||
| private CompositeNamespaceModifyIndexesRepository compositeNamespaceModifyIndexesRepository; | ||
|
|
||
| @Override | ||
| public Optional<CompositeProperties> findByBaselineName(String baselineName) { | ||
| return compositeNamespaceModifyIndexesRepository.findByBaseline(baselineName); | ||
| } | ||
|
|
||
| @Transactional | ||
| @Override | ||
| public void save(CompositeProperties compositeNamespacesModifyIndex) { | ||
| compositeNamespaceModifyIndexesRepository.persist(compositeNamespacesModifyIndex); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...tor/src/main/java/com/netcracker/cloud/dbaas/entity/pg/composite/CompositeProperties.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.netcracker.cloud.dbaas.entity.pg.composite; | ||
|
|
||
| import jakarta.persistence.*; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| @Table(name = "composite_properties") | ||
| @Entity(name = "CompositeProperties") | ||
| public class CompositeProperties { | ||
| @Id | ||
| @Column(name = "composite_namespace_id") | ||
| public UUID id; | ||
|
|
||
| @OneToOne(fetch = FetchType.LAZY) | ||
| @MapsId | ||
| @JoinColumn(name = "composite_namespace_id") | ||
| private CompositeNamespace compositeNamespace; | ||
|
|
||
| @Column(name = "modify_index", nullable = false) | ||
| private long modifyIndex; | ||
|
|
||
| public CompositeProperties(CompositeNamespace compositeNamespace, long modifyIndex) { | ||
| this.compositeNamespace = compositeNamespace; | ||
| this.modifyIndex = modifyIndex; | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
...racker/cloud/dbaas/repositories/dbaas/CompositeNamespaceModifyIndexesDbaasRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.netcracker.cloud.dbaas.repositories.dbaas; | ||
|
|
||
| import com.netcracker.cloud.dbaas.entity.pg.composite.CompositeProperties; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| public interface CompositeNamespaceModifyIndexesDbaasRepository { | ||
| Optional<CompositeProperties> findByBaselineName(String baselineName); | ||
|
|
||
| void save(CompositeProperties compositeNamespacesModifyIndex); | ||
|
|
||
| } |
19 changes: 19 additions & 0 deletions
19
...netcracker/cloud/dbaas/repositories/pg/jpa/CompositeNamespaceModifyIndexesRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.netcracker.cloud.dbaas.repositories.pg.jpa; | ||
|
|
||
| import com.netcracker.cloud.dbaas.entity.pg.composite.CompositeProperties; | ||
| import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; | ||
| import jakarta.enterprise.context.ApplicationScoped; | ||
|
|
||
| import java.util.Optional; | ||
| import java.util.UUID; | ||
|
|
||
| @ApplicationScoped | ||
| public class CompositeNamespaceModifyIndexesRepository implements PanacheRepositoryBase<CompositeProperties, UUID> { | ||
|
|
||
| public Optional<CompositeProperties> findByBaseline(String baseline) { | ||
| return find( | ||
| "compositeNamespace.baseline", | ||
| baseline | ||
| ).firstResultOptional(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...src/main/resources/db/migration/postgresql/V1.034__Composite_Namespace_Modify_Indexes.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| create table if not exists composite_properties | ||
| ( | ||
| composite_namespace_id uuid primary key | ||
| references composite_namespace(id) | ||
| on delete cascade, | ||
| modify_index numeric(20) not null check (modify_index >= 0) | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.