diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..89a8c06
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/.project b/.project
new file mode 100644
index 0000000..3bf2a26
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+
+
+ bayer-ubiquitous-rating-platform
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..abdea9a
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding/=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..714351a
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..b7942a5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,57 @@
+
+ 4.0.0
+ com.bayer
+ burp
+ 0.0.1-SNAPSHOT
+
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.2.4.RELEASE
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-rest
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ com.h2database
+ h2
+
+
+
+
+ 1.8
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+
+ spring-milestone
+ https://repo.spring.io/libs-release
+
+
+
+
+
+ spring-milestone
+ https://repo.spring.io/libs-release
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/bayer/burp/Application.java b/src/main/java/com/bayer/burp/Application.java
new file mode 100644
index 0000000..07a8e60
--- /dev/null
+++ b/src/main/java/com/bayer/burp/Application.java
@@ -0,0 +1,13 @@
+package com.bayer.burp;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class);
+ }
+
+}
diff --git a/src/main/java/com/bayer/burp/domain/Burp.java b/src/main/java/com/bayer/burp/domain/Burp.java
new file mode 100644
index 0000000..f72815a
--- /dev/null
+++ b/src/main/java/com/bayer/burp/domain/Burp.java
@@ -0,0 +1,69 @@
+package com.bayer.burp.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class Burp {
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ private String text;
+
+ private Date timestamp;
+
+ @ManyToOne
+ private User user;
+
+ @ManyToMany
+ @JoinTable(name = "burp_tag", joinColumns = @JoinColumn(name = "burp_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id"))
+ private List tags;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+}
diff --git a/src/main/java/com/bayer/burp/domain/Tag.java b/src/main/java/com/bayer/burp/domain/Tag.java
new file mode 100644
index 0000000..df38f8f
--- /dev/null
+++ b/src/main/java/com/bayer/burp/domain/Tag.java
@@ -0,0 +1,41 @@
+package com.bayer.burp.domain;
+
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+
+@Entity
+public class Tag {
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ private String name;
+
+ @ManyToMany
+ @JoinTable(name = "burp_tag", joinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "burp_id", referencedColumnName = "id"))
+ private List burps;
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getBurps() {
+ return burps;
+ }
+
+}
diff --git a/src/main/java/com/bayer/burp/domain/User.java b/src/main/java/com/bayer/burp/domain/User.java
new file mode 100644
index 0000000..0ce964e
--- /dev/null
+++ b/src/main/java/com/bayer/burp/domain/User.java
@@ -0,0 +1,39 @@
+package com.bayer.burp.domain;
+
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+
+@Entity
+public class User {
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ private String name;
+
+ @OneToMany
+ private List burps;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getBurps() {
+ return burps;
+ }
+
+}
diff --git a/src/main/java/com/bayer/burp/repository/BurpRepository.java b/src/main/java/com/bayer/burp/repository/BurpRepository.java
new file mode 100644
index 0000000..030c54e
--- /dev/null
+++ b/src/main/java/com/bayer/burp/repository/BurpRepository.java
@@ -0,0 +1,33 @@
+package com.bayer.burp.repository;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.data.repository.query.Param;
+import org.springframework.data.rest.core.annotation.RestResource;
+
+import com.bayer.burp.domain.Burp;
+
+public interface BurpRepository extends PagingAndSortingRepository {
+
+ // http://localhost:8080/burps/search/findByUserName?username=Adam
+ List findByUserName(@Param("username") String username);
+
+ // http://localhost:8080/burps/search/findByUserNameIn?usernames=Adam,Ben
+ List findByUserNameIn(Collection usernames);
+
+ // http://localhost:8080/burps/search/searchBurpsStartingWith?prefix=Best
+ @Query("select b from Burp b where b.text like :prefix%")
+ List searchBurpsStartingWith(@Param("prefix") String prefix);
+
+ // http://localhost:8080/burps/search/findFirst3ByOrderByTimestampDesc
+ List findFirst3ByOrderByTimestampDesc();
+
+// @RestResource(exported = false)
+// Page findAll(Pageable pageable);
+
+}
diff --git a/src/main/java/com/bayer/burp/repository/TagRepository.java b/src/main/java/com/bayer/burp/repository/TagRepository.java
new file mode 100644
index 0000000..aa2587b
--- /dev/null
+++ b/src/main/java/com/bayer/burp/repository/TagRepository.java
@@ -0,0 +1,8 @@
+package com.bayer.burp.repository;
+
+import org.springframework.data.repository.PagingAndSortingRepository;
+
+import com.bayer.burp.domain.Tag;
+
+public interface TagRepository extends PagingAndSortingRepository {
+}
diff --git a/src/main/java/com/bayer/burp/repository/UserRepository.java b/src/main/java/com/bayer/burp/repository/UserRepository.java
new file mode 100644
index 0000000..ed47540
--- /dev/null
+++ b/src/main/java/com/bayer/burp/repository/UserRepository.java
@@ -0,0 +1,8 @@
+package com.bayer.burp.repository;
+
+import org.springframework.data.repository.PagingAndSortingRepository;
+
+import com.bayer.burp.domain.User;
+
+public interface UserRepository extends PagingAndSortingRepository {
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644
index 0000000..e186b4e
--- /dev/null
+++ b/src/main/resources/application.properties
@@ -0,0 +1,5 @@
+spring.datasource.platform=h2
+security.user.name=sa
+security.user.password=
+
+server.port=8081
diff --git a/src/main/resources/data-h2.sql b/src/main/resources/data-h2.sql
new file mode 100644
index 0000000..baebfc1
--- /dev/null
+++ b/src/main/resources/data-h2.sql
@@ -0,0 +1,16 @@
+INSERT INTO User (id, name) VALUES (1, 'Adam'), (2, 'Betty'), (3, 'Curtis');
+INSERT INTO Tag (id, name) VALUES (1, 'left'), (2, 'right'), (3, 'vital');
+
+INSERT INTO Burp (id, text, timestamp, user_id) VALUES
+ (NULL, 'Waiting at the entrance', CONCAT(CURRENT_DATE(),' ','11:41:00.000'), 1),
+ (NULL, 'Did anybody check the menu? The screen''s not working.', CONCAT(CURRENT_DATE(),' ','11:42:00.000'), 2),
+ (NULL, 'Still not open. I''m huuuuungry!', CONCAT(CURRENT_DATE(),' ','11:45:00.001'), 3),
+ (NULL, 'Stay away from the #right side today!', DATEADD('SECOND', -650, CURRENT_TIMESTAMP()), 2),
+ (NULL, 'Katina #vital is delicious ♥', DATEADD('SECOND', -620, CURRENT_TIMESTAMP()), 1),
+ (NULL, 'The schnitzel on both sides is quite OK #left #right', DATEADD('SECOND', -463, CURRENT_TIMESTAMP()), 3),
+ (NULL, 'I''m all for the healthy kantina vital, but does it always have to have this oriental touch? #vital', DATEADD('SECOND', -318, CURRENT_TIMESTAMP()), 1),
+ (NULL, 'If nothing else works, there''s still the potato gratin #left and #right', DATEADD('SECOND', -10, CURRENT_TIMESTAMP()), 2),
+ (NULL, '...but then again, what''s the side dish? #left #right', CURRENT_TIMESTAMP(), 2);
+
+INSERT INTO Burp_Tag (burp_id, tag_id) VALUES (4, 2), (5, 3), (6, 1), (6, 2), (7, 3), (8, 1), (8, 2), (9, 1), (9, 2);
+
\ No newline at end of file