diff --git a/src/main/java/eu/hbp/mip/model/User.java b/src/main/java/eu/hbp/mip/model/User.java index c0c845876ec7571845f72266347b1b2ce7e2f799..03b402e41053756f84ce33e96eee2b2cfff98451 100644 --- a/src/main/java/eu/hbp/mip/model/User.java +++ b/src/main/java/eu/hbp/mip/model/User.java @@ -83,9 +83,6 @@ public class User { private Boolean agreeNDA = null; - @OneToMany(mappedBy = "user", fetch = FetchType.EAGER) - private Set<Vote> appsVotes = new HashSet<>(); - public User() { /* @@ -331,19 +328,4 @@ public class User { public void setAgreeNDA(Boolean agreeNDA) { this.agreeNDA = agreeNDA; } - - - public Set<Vote> getAppsVotes() { - return appsVotes; - } - - public void setAppsVotes(Set<Vote> appsVotes) { - this.appsVotes = appsVotes; - } - - - public Set<App> getVotedApps() { - - return appsVotes.stream().map(Vote::getApp).collect(Collectors.toCollection(LinkedHashSet::new)); - } } diff --git a/src/main/java/eu/hbp/mip/model/Vote.java b/src/main/java/eu/hbp/mip/model/Vote.java deleted file mode 100644 index fcd52e48597a17377e8d1a05cf47c129793eaa3e..0000000000000000000000000000000000000000 --- a/src/main/java/eu/hbp/mip/model/Vote.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Created by mirco on 24.05.16. - */ - -package eu.hbp.mip.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; - -import javax.persistence.*; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; - -@Entity -@Table(name = "`vote`") -@ApiModel -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Vote { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long id; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - private User user; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - private App app; - - @Min(0) - @Max(5) - private int value; - - - public Vote() { - /* - * Empty constructor is needed by Hibernate - */ - } - - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public App getApp() { - return app; - } - - public void setApp(App app) { - this.app = app; - } - - public int getValue() { - return value; - } - - public void setValue(int value) { - this.value = value; - } -} diff --git a/src/main/java/eu/hbp/mip/repositories/VoteRepository.java b/src/main/java/eu/hbp/mip/repositories/VoteRepository.java deleted file mode 100644 index 30499e5511878169d4f76180afaacef74bdf52f6..0000000000000000000000000000000000000000 --- a/src/main/java/eu/hbp/mip/repositories/VoteRepository.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.hbp.mip.repositories; - -import eu.hbp.mip.model.App; -import eu.hbp.mip.model.User; -import eu.hbp.mip.model.Vote; -import org.springframework.data.repository.CrudRepository; - -/** - * Created by mirco on 11.07.16. - */ - -public interface VoteRepository extends CrudRepository<Vote, Long> { - Iterable<Vote> findByUserAndApp(User user, App app); -}