Events and JPA Events Reposytory
parent
26d383d3f1
commit
0b942ace1b
|
@ -23,10 +23,7 @@ repositories {
|
|||
|
||||
|
||||
dependencies {
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile('org.springframework.boot:spring-boot-starter-data-jpa')
|
||||
compile('org.springframework.boot:spring-boot-starter-jdbc')
|
||||
compile('org.springframework.boot:spring-boot-starter-web')
|
||||
compile('org.springframework.boot:spring-boot-starter-web-services')
|
||||
runtime('mysql:mysql-connector-java')
|
||||
testCompile('org.springframework.boot:spring-boot-starter-test')
|
||||
runtime('com.h2database:h2')
|
||||
}
|
||||
|
|
|
@ -5,14 +5,15 @@ package ba.steleks.repository;
|
|||
|
||||
import ba.steleks.repository.model.Event;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
//@RepositoryRestResource(collectionResourceRel = "events", path = "events")
|
||||
public interface EventsJpaRepository extends PagingAndSortingRepository<Event, Long> {
|
||||
|
||||
Event save(Event event);
|
||||
List<Event> findAll();
|
||||
Event findOne(Long ID);
|
||||
List<Event> findByTitle(String title);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ public class Event {
|
|||
private String createdById;
|
||||
private String eventType;
|
||||
|
||||
protected Event() {}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
server.port = 9000
|
|
@ -1,16 +0,0 @@
|
|||
package ba.steleks;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class EventsApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue