Removed SQLite. Removed adding DAOs to Jersey register.
This commit is contained in:
parent
3dc5ebb774
commit
6a45056363
@ -1,9 +1,9 @@
|
||||
database:
|
||||
# the name of your JDBC driver
|
||||
driverClass: org.sqlite.JDBC
|
||||
driverClass: org.h2.Driver
|
||||
|
||||
# the JDBC URL
|
||||
url: jdbc:sqlite:sampledatabase.db
|
||||
url: jdbc:h2:./sampledatabase.db
|
||||
|
||||
# any properties specific to your JDBC driver:
|
||||
properties:
|
||||
|
@ -62,11 +62,6 @@
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.23.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -48,9 +48,6 @@ public class ObservationsApplication extends Application<ObservationsConfigurati
|
||||
TutorDao tutorDao = new TutorDao(hibernate.getSessionFactory());
|
||||
SiteDao siteDao = new SiteDao(hibernate.getSessionFactory());
|
||||
ObservationDao observationDao = new ObservationDao(hibernate.getSessionFactory());
|
||||
jersey.register(tutorDao);
|
||||
jersey.register(siteDao);
|
||||
jersey.register(observationDao);
|
||||
final TutorResource tutorResource = new TutorResource(tutorDao);
|
||||
jersey.register(tutorResource);
|
||||
final ObservationResource observationResource = new ObservationResource(observationDao, tutorDao, siteDao);
|
||||
|
@ -8,6 +8,7 @@ import uk.co.neviyn.Observations.dao.SiteDao;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
@ -31,7 +32,7 @@ public class SiteResource {
|
||||
@Path("/{id}/tutors")
|
||||
@GET
|
||||
@UnitOfWork
|
||||
public Set<Tutor> getSiteTutors(long id){
|
||||
public Set<Tutor> getSiteTutors(@PathParam("id") long id){
|
||||
return dao.get(id).getTutors();
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class ObservationDaoTest {
|
||||
);
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
dao = new ObservationDao(testRule.getSessionFactory());
|
||||
siteDao = new SiteDao(testRule.getSessionFactory());
|
||||
testRule.inTransaction(() -> siteDao.persist(site));
|
||||
|
Loading…
Reference in New Issue
Block a user