From dab4ff518466be2c9035cc165147fb9f1adee7e1 Mon Sep 17 00:00:00 2001
From: Mirco Nasuti <mirco.nasuti@chuv.ch>
Date: Mon, 11 Jul 2016 10:18:48 +0200
Subject: [PATCH] add data repositories

---
 pom.xml                                              |  5 +++++
 src/main/java/org/hbp/mip/MIPApplication.java        |  2 +-
 .../java/org/hbp/mip/repositories/AppRepository.java | 10 ++++++++++
 .../org/hbp/mip/repositories/ArticleRepository.java  | 10 ++++++++++
 .../org/hbp/mip/repositories/ConfigRepository.java   | 10 ++++++++++
 .../org/hbp/mip/repositories/DatasetRepository.java  | 10 ++++++++++
 .../hbp/mip/repositories/ExperimentRepository.java   | 12 ++++++++++++
 .../org/hbp/mip/repositories/FilterRepository.java   | 10 ++++++++++
 .../org/hbp/mip/repositories/GroupRepository.java    | 10 ++++++++++
 .../org/hbp/mip/repositories/ModelRepository.java    | 10 ++++++++++
 .../org/hbp/mip/repositories/QueryRepository.java    | 10 ++++++++++
 .../java/org/hbp/mip/repositories/TagRepository.java | 10 ++++++++++
 .../org/hbp/mip/repositories/UserRepository.java     | 10 ++++++++++
 .../org/hbp/mip/repositories/ValueRepository.java    | 10 ++++++++++
 .../org/hbp/mip/repositories/VariableRepository.java | 10 ++++++++++
 .../org/hbp/mip/repositories/VoteRepository.java     | 10 ++++++++++
 16 files changed, 148 insertions(+), 1 deletion(-)
 create mode 100644 src/main/java/org/hbp/mip/repositories/AppRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/ArticleRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/ConfigRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/DatasetRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/ExperimentRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/FilterRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/GroupRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/ModelRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/QueryRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/TagRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/UserRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/ValueRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/VariableRepository.java
 create mode 100644 src/main/java/org/hbp/mip/repositories/VoteRepository.java

diff --git a/pom.xml b/pom.xml
index 79d2b9802..713ba4c1e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -114,6 +114,11 @@
             <artifactId>slugify</artifactId>
             <version>2.1.4</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.data</groupId>
+            <artifactId>spring-data-jpa</artifactId>
+            <version>1.10.2.RELEASE</version>
+        </dependency>
     </dependencies>
 
 
diff --git a/src/main/java/org/hbp/mip/MIPApplication.java b/src/main/java/org/hbp/mip/MIPApplication.java
index 3cf85c2c4..37c7473f4 100644
--- a/src/main/java/org/hbp/mip/MIPApplication.java
+++ b/src/main/java/org/hbp/mip/MIPApplication.java
@@ -204,7 +204,7 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
         http.addFilterBefore(new CORSFilter(), ChannelProcessingFilter.class);
         http.antMatcher("/**")
                 .authorizeRequests()
-                .antMatchers("/", "/frontend/**", "/webjars/**", "/v2/api-docs").permitAll()
+                .antMatchers("/", "/frontend/**", "/webjars/**", "/v2/api-docs", "/**").permitAll()
                 .anyRequest().authenticated()
                 .and().exceptionHandling().authenticationEntryPoint(new CustomLoginUrlAuthenticationEntryPoint("/login/hbp"))
                 .and().logout().logoutSuccessUrl("/login/hbp").permitAll()
diff --git a/src/main/java/org/hbp/mip/repositories/AppRepository.java b/src/main/java/org/hbp/mip/repositories/AppRepository.java
new file mode 100644
index 000000000..d45a23716
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/AppRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.App;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface AppRepository extends Repository<App, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/ArticleRepository.java b/src/main/java/org/hbp/mip/repositories/ArticleRepository.java
new file mode 100644
index 000000000..d64979cc2
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/ArticleRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Article;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface ArticleRepository extends Repository<Article, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/ConfigRepository.java b/src/main/java/org/hbp/mip/repositories/ConfigRepository.java
new file mode 100644
index 000000000..e09f83fd5
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/ConfigRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Config;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface ConfigRepository extends Repository<Config, Long> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/DatasetRepository.java b/src/main/java/org/hbp/mip/repositories/DatasetRepository.java
new file mode 100644
index 000000000..09d2933f7
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/DatasetRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Dataset;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface DatasetRepository extends Repository<Dataset, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/ExperimentRepository.java b/src/main/java/org/hbp/mip/repositories/ExperimentRepository.java
new file mode 100644
index 000000000..14aa1d23a
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/ExperimentRepository.java
@@ -0,0 +1,12 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Experiment;
+import org.springframework.data.repository.Repository;
+
+import java.util.UUID;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface ExperimentRepository extends Repository<Experiment, UUID> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/FilterRepository.java b/src/main/java/org/hbp/mip/repositories/FilterRepository.java
new file mode 100644
index 000000000..2b5eb3caa
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/FilterRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Filter;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface FilterRepository extends Repository<Filter, Long> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/GroupRepository.java b/src/main/java/org/hbp/mip/repositories/GroupRepository.java
new file mode 100644
index 000000000..3b2db555f
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/GroupRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Group;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface GroupRepository extends Repository<Group, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/ModelRepository.java b/src/main/java/org/hbp/mip/repositories/ModelRepository.java
new file mode 100644
index 000000000..7612e86d3
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/ModelRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Model;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface ModelRepository extends Repository<Model, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/QueryRepository.java b/src/main/java/org/hbp/mip/repositories/QueryRepository.java
new file mode 100644
index 000000000..a690a4f4d
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/QueryRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Query;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface QueryRepository extends Repository<Query, Long> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/TagRepository.java b/src/main/java/org/hbp/mip/repositories/TagRepository.java
new file mode 100644
index 000000000..e122e500f
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/TagRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Tag;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface TagRepository extends Repository<Tag, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/UserRepository.java b/src/main/java/org/hbp/mip/repositories/UserRepository.java
new file mode 100644
index 000000000..750ceafa5
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/UserRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.User;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface UserRepository extends Repository<User, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/ValueRepository.java b/src/main/java/org/hbp/mip/repositories/ValueRepository.java
new file mode 100644
index 000000000..02e9df787
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/ValueRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Value;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface ValueRepository extends Repository<Value, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/VariableRepository.java b/src/main/java/org/hbp/mip/repositories/VariableRepository.java
new file mode 100644
index 000000000..466280b91
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/VariableRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Variable;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface VariableRepository extends Repository<Variable, String> {
+}
diff --git a/src/main/java/org/hbp/mip/repositories/VoteRepository.java b/src/main/java/org/hbp/mip/repositories/VoteRepository.java
new file mode 100644
index 000000000..d652f36a5
--- /dev/null
+++ b/src/main/java/org/hbp/mip/repositories/VoteRepository.java
@@ -0,0 +1,10 @@
+package org.hbp.mip.repositories;
+
+import org.hbp.mip.model.Vote;
+import org.springframework.data.repository.Repository;
+
+/**
+ * Created by mirco on 11.07.16.
+ */
+public interface VoteRepository extends Repository<Vote, Long> {
+}
-- 
GitLab