-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feat/support for networks #309
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #309 +/- ##
============================================
- Coverage 79.71% 79.39% -0.32%
- Complexity 1076 1091 +15
============================================
Files 146 147 +1
Lines 3243 3281 +38
Branches 173 179 +6
============================================
+ Hits 2585 2605 +20
- Misses 543 552 +9
- Partials 115 124 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/main/java/eu/bbmri_eric/negotiator/database/model/Person.java
Outdated
Show resolved
Hide resolved
src/main/java/eu/bbmri_eric/negotiator/database/model/Network.java
Outdated
Show resolved
Hide resolved
src/main/java/eu/bbmri_eric/negotiator/database/model/Network.java
Outdated
Show resolved
Hide resolved
491d74d
to
b497f09
Compare
src/main/java/eu/bbmri_eric/negotiator/database/model/Network.java
Outdated
Show resolved
Hide resolved
src/main/java/eu/bbmri_eric/negotiator/database/model/Network.java
Outdated
Show resolved
Hide resolved
src/main/java/eu/bbmri_eric/negotiator/database/model/Network.java
Outdated
Show resolved
Hide resolved
import jakarta.persistence.NamedEntityGraph; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.persistence.SequenceGenerator; | ||
import jakarta.persistence.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/java/eu/bbmri_eric/negotiator/database/model/Person.java
Outdated
Show resolved
Hide resolved
src/main/java/eu/bbmri_eric/negotiator/database/model/Person.java
Outdated
Show resolved
Hide resolved
src/test/java/eu/bbmri_eric/negotiator/integration/repository/NetworkRepositoryTest.java
Show resolved
Hide resolved
… <> manaher assignment to person
80c505a
to
995b4e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments and fix the imports with *. It violates google java format, see https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html
/** The resources of the network. */ | ||
@ManyToMany( | ||
cascade = {CascadeType.PERSIST, CascadeType.MERGE}, | ||
fetch = FetchType.EAGER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid eager fetching as much as possible since we will have some large objects. Any good reason for including it? A network can have thousands of resources
public void addNetwork(Network network) { | ||
this.networks.add(network); | ||
if (!network.getResources().contains(this)) { | ||
network.addResource(this); | ||
} | ||
} | ||
|
||
public Set<Network> getNetworks() { | ||
if (Objects.isNull(this.networks)) { | ||
return Set.of(); | ||
} | ||
return Collections.unmodifiableSet(this.networks); | ||
} | ||
|
||
public void removeNetwork(Network network) { | ||
this.networks.remove(network); | ||
if (network.getResources().contains(this)) { | ||
network.removeResource(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it makes sense to have this API on both the Resource and the Network. Wouldn't it be better to just have it in one of them?
Negotiator pull request:
Description:
Adds network entities
Checklist:
Make sure you tick all the boxes bellow if they are true or do not apply: