Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franz Reischl
tomcat-miniREST
Commits
3a680332
Commit
3a680332
authored
Mar 10, 2019
by
Michael Schimpelsberger
Browse files
1) changed length of VARCHAR attributes in DB
2) added JSON format to GenericExceptionMapper
parent
88d90cb5
Changes
7
Show whitespace changes
Inline
Side-by-side
SQL/SQLSkript.txt
View file @
3a680332
...
...
@@ -4,14 +4,14 @@ DROP TABLE study CASCADE CONSTRAINTS;
DROP TABLE inscription CASCADE CONSTRAINTS;
-- Create Tables
CREATE TABLE student (matrnr INTEGER PRIMARY KEY, firstname VARCHAR2(
20
0), lastname VARCHAR2(
20
0));
CREATE TABLE student (matrnr INTEGER PRIMARY KEY, firstname VARCHAR2(
15
0), lastname VARCHAR2(
15
0));
CREATE TABLE study (studyid INTEGER PRIMARY KEY, name VARCHAR(
4
0));
CREATE TABLE study (studyid INTEGER PRIMARY KEY, name VARCHAR(
15
0));
CREATE TABLE subject (
studyId INTEGER,
subjectid INTEGER,
name VARCHAR2(
4
0),
name VARCHAR2(
15
0),
ects INTEGER,
PRIMARY KEY (studyid, subjectid),
FOREIGN KEY (studyId) REFERENCES study(studyId) ON DELETE CASCADE
...
...
@@ -62,6 +62,7 @@ INSERT INTO subject(studyid, subjectid, name, ects) values(5,2,'Allgemeine Physi
INSERT INTO subject(studyid, subjectid, name, ects) values(6,1,'Trainingslehre',6);
INSERT INTO subject(studyid, subjectid, name, ects) values(6,2,'Bewegungslehre',3);
-- Insert Data inscription
INSERT INTO inscription(matrnr, studyid, ins_date) values (1,1,sysdate);
INSERT INTO inscription(matrnr, studyid, ins_date) values (1,2,sysdate);
INSERT INTO inscription(matrnr, studyid, ins_date) values (1,3,sysdate);
...
...
src/main/java/university/at/jku/ce/dao/h2dao/DaoParam.java
View file @
3a680332
...
...
@@ -25,7 +25,8 @@ public class DaoParam {
e1
.
printStackTrace
();
}
}
//enable for printing Path of DB
System
.
out
.
println
(
Paths
.
get
(
p2
.
toAbsolutePath
().
toString
(),
"Database"
).
toAbsolutePath
().
toString
());
// Return path as absolute path
return
Paths
.
get
(
p2
.
toAbsolutePath
().
toString
(),
"Database"
).
toAbsolutePath
().
toString
();
...
...
src/main/java/university/at/jku/ce/exception/BadRequestExceptionMapper.java
View file @
3a680332
src/main/java/university/at/jku/ce/exception/GenericExceptionMapper.java
View file @
3a680332
package
university.at.jku.ce.exception
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.Response.Status
;
import
javax.ws.rs.ext.ExceptionMapper
;
...
...
@@ -14,6 +15,7 @@ public class GenericExceptionMapper implements ExceptionMapper<RuntimeException>
public
Response
toResponse
(
RuntimeException
exception
)
{
return
Response
.
status
(
Status
.
INTERNAL_SERVER_ERROR
)
.
entity
(
new
Error
(
ExceptionParam
.
SERVER_ERROR
,
500
,
ExceptionParam
.
DOKU
))
.
type
(
MediaType
.
APPLICATION_JSON
)
.
build
();
}
...
...
src/main/java/university/at/jku/ce/exception/MethodNotAllowedExceptionMapper.java
View file @
3a680332
src/main/java/university/at/jku/ce/exception/NotFoundExceptionMapper.java
View file @
3a680332
...
...
@@ -7,6 +7,7 @@ import javax.ws.rs.ext.ExceptionMapper;
import
javax.ws.rs.ext.Provider
;
import
university.at.jku.ce.model.Error
;
import
javax.ws.rs.NotFoundException
;
import
javax.ws.rs.Produces
;
@Provider
public
class
NotFoundExceptionMapper
implements
ExceptionMapper
<
NotFoundException
>
{
...
...
html-minirest
@
3aa4125b
Compare
22841e6e
...
3aa4125b
Subproject commit
22841e6e34e08042ae87f8ee03ffb21bcd874296
Subproject commit
3aa4125b377b8de8a9330f8139ded46155e234c5
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment