From f5d461157eb28b47651f59e9eb8bb72d81538736 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 24 Jan 2019 15:50:01 +0100 Subject: [PATCH] refactoring -> generalization of REST API and controller --- .../seb/sebserver/gbl/model/APIMessage.java | 2 + .../seb/sebserver/gbl/model/Activatable.java | 3 + .../ethz/seb/sebserver/gbl/model/Domain.java | 3 +- .../ethz/seb/sebserver/gbl/model/Entity.java | 5 + .../seb/sebserver/gbl/model/EntityType.java | 2 +- .../seb/sebserver/gbl/model/ModelIdAware.java | 3 + .../ch/ethz/seb/sebserver/gbl/model/Page.java | 6 +- .../seb/sebserver/gbl/model/exam/Exam.java | 1 + .../sebserver/gbl/model/exam/Indicator.java | 31 +- .../gbl/model/institution/Institution.java | 3 - .../gbl/model/institution/LmsSetup.java | 1 - .../gbl/model/user/UserActivityLog.java | 4 +- .../sebserver/gbl/model/user/UserFilter.java | 76 ----- .../sebserver/gbl/model/user/UserInfo.java | 9 +- .../seb/sebserver/gbl/model/user/UserMod.java | 19 +- .../ch/ethz/seb/sebserver/gbl/util/Utils.java | 16 +- .../sebserver/webservice/WebServiceInit.java | 3 - .../datalayer/batis/JodaTimeTypeResolver.java | 41 +-- ...ientConnectionRecordDynamicSqlSupport.java | 20 +- .../mapper/ClientConnectionRecordMapper.java | 36 +-- .../ClientEventRecordDynamicSqlSupport.java | 18 +- .../batis/mapper/ClientEventRecordMapper.java | 36 +-- ...ationAttributeRecordDynamicSqlSupport.java | 20 +- .../ConfigurationAttributeRecordMapper.java | 36 +-- ...figurationNodeRecordDynamicSqlSupport.java | 20 +- .../mapper/ConfigurationNodeRecordMapper.java | 36 +-- .../ConfigurationRecordDynamicSqlSupport.java | 14 +- .../mapper/ConfigurationRecordMapper.java | 36 +-- ...igurationValueRecordDynamicSqlSupport.java | 16 +- .../ConfigurationValueRecordMapper.java | 36 +-- ...nfigurationMapRecordDynamicSqlSupport.java | 12 +- .../ExamConfigurationMapRecordMapper.java | 36 +-- .../mapper/ExamRecordDynamicSqlSupport.java | 22 +- .../batis/mapper/ExamRecordMapper.java | 36 +-- .../IndicatorRecordDynamicSqlSupport.java | 14 +- .../batis/mapper/IndicatorRecordMapper.java | 36 +-- .../InstitutionRecordDynamicSqlSupport.java | 14 +- .../batis/mapper/InstitutionRecordMapper.java | 36 +-- .../LmsSetupRecordDynamicSqlSupport.java | 26 +- .../batis/mapper/LmsSetupRecordMapper.java | 36 +-- .../OrientationRecordDynamicSqlSupport.java | 22 +- .../batis/mapper/OrientationRecordMapper.java | 36 +-- .../mapper/RoleRecordDynamicSqlSupport.java | 10 +- .../batis/mapper/RoleRecordMapper.java | 36 +-- .../ThresholdRecordDynamicSqlSupport.java | 12 +- .../batis/mapper/ThresholdRecordMapper.java | 36 +-- ...serActivityLogRecordDynamicSqlSupport.java | 18 +- .../mapper/UserActivityLogRecordMapper.java | 36 +-- .../mapper/UserRecordDynamicSqlSupport.java | 24 +- .../batis/mapper/UserRecordMapper.java | 36 +-- .../batis/model/ClientConnectionRecord.java | 40 +-- .../batis/model/ClientEventRecord.java | 36 +-- .../model/ConfigurationAttributeRecord.java | 40 +-- .../batis/model/ConfigurationNodeRecord.java | 40 +-- .../batis/model/ConfigurationRecord.java | 28 +- .../batis/model/ConfigurationValueRecord.java | 32 +- .../model/ExamConfigurationMapRecord.java | 24 +- .../datalayer/batis/model/ExamRecord.java | 44 +-- .../batis/model/IndicatorRecord.java | 28 +- .../batis/model/InstitutionRecord.java | 28 +- .../datalayer/batis/model/LmsSetupRecord.java | 52 ++-- .../batis/model/OrientationRecord.java | 44 +-- .../datalayer/batis/model/RoleRecord.java | 20 +- .../batis/model/ThresholdRecord.java | 24 +- .../batis/model/UserActivityLogRecord.java | 36 +-- .../datalayer/batis/model/UserRecord.java | 48 +-- .../servicelayer/PaginationService.java | 38 ++- .../authorization/GrantEntity.java | 4 + .../dao/ActivatableEntityDAO.java | 28 +- .../servicelayer/dao/EntityDAO.java | 43 +-- .../webservice/servicelayer/dao/ExamDAO.java | 22 +- .../servicelayer/dao/FilterMap.java | 153 +++++++++ .../servicelayer/dao/InstitutionDAO.java | 5 - .../servicelayer/dao/LmsSetupDAO.java | 13 - .../servicelayer/dao/UserActivityLogDAO.java | 5 +- .../webservice/servicelayer/dao/UserDAO.java | 15 +- .../servicelayer/dao/impl/ExamDAOImpl.java | 169 +++++----- .../dao/impl/IndicatorDAOImpl.java | 44 ++- .../dao/impl/InstitutionDAOImpl.java | 13 +- .../dao/impl/LmsSetupDAOImpl.java | 19 +- .../dao/impl/UserActivityLogDAOImpl.java | 50 ++- .../servicelayer/dao/impl/UserDaoImpl.java | 36 ++- .../validation/BeanValidationException.java | 42 +++ .../validation/BeanValidationService.java | 79 +++++ .../weblayer/api/APIExceptionHandler.java | 30 +- .../webservice/weblayer/api/APIParamsMap.java | 75 +++++ .../api/ActivatableEntityController.java | 52 ++-- .../weblayer/api/EntityController.java | 241 +++++++++++---- .../api/ExamAdministrationController.java | 274 +++++++---------- .../api/IllegalAPIArgumentException.java | 27 ++ .../weblayer/api/InstitutionController.java | 45 ++- .../weblayer/api/LmsSetupController.java | 49 ++- .../weblayer/api/QuizImportController.java | 74 ++--- .../weblayer/api/UserAccountController.java | 128 ++------ .../api/UserActivityLogController.java | 147 +++------ .../batis/JodaTimeTypeResolverTest.java | 10 + .../{ => admin}/AdminAPITestController.java | 2 +- .../AdministrationAPIIntegrationTester.java} | 38 ++- .../api/{ => admin}/GeneralAdminAPITest.java | 4 +- .../api/admin/InstitutionAPITest.java | 191 ++++++++++++ .../api/{ => admin}/UserAPITest.java | 291 +++++++++++------- .../{ => admin}/UserActivityLogAPITest.java | 92 +++--- .../ExamAPIIntegrationTester.java} | 4 +- .../api/{ => exam}/ExamAPITestController.java | 2 +- .../api/{ => exam}/GeneralExamAPITest.java | 4 +- src/test/resources/data-test.sql | 3 +- 106 files changed, 2404 insertions(+), 1807 deletions(-) delete mode 100644 src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserFilter.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationException.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationService.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIParamsMap.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IllegalAPIArgumentException.java rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => admin}/AdminAPITestController.java (90%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{AdministrationAPIIntegrationTest.java => admin/AdministrationAPIIntegrationTester.java} (84%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => admin}/GeneralAdminAPITest.java (93%) create mode 100644 src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/InstitutionAPITest.java rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => admin}/UserAPITest.java (79%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => admin}/UserActivityLogAPITest.java (77%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ExamAPIIntegrationTest.java => exam/ExamAPIIntegrationTester.java} (94%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => exam}/ExamAPITestController.java (92%) rename src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/{ => exam}/GeneralExamAPITest.java (91%) diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/APIMessage.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/APIMessage.java index ad2cd0fe..be0762e8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/APIMessage.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/APIMessage.java @@ -27,8 +27,10 @@ public class APIMessage implements Serializable { private static final long serialVersionUID = -6858683658311637361L; public enum ErrorMessage { + GENERIC("0", HttpStatus.INTERNAL_SERVER_ERROR, "Generic error message"), UNAUTHORIZED("1000", HttpStatus.UNAUTHORIZED, "UNAUTHORIZED"), FORBIDDEN("1001", HttpStatus.FORBIDDEN, "FORBIDDEN"), + ILLEGAL_API_ARGUMENT("1010", HttpStatus.BAD_REQUEST, "Illegal API request argument"), UNEXPECTED("1100", HttpStatus.INTERNAL_SERVER_ERROR, "Unexpected intenral server-side error"), FIELD_VALIDATION("1200", HttpStatus.BAD_REQUEST, "Field validation error"), PASSWORD_MISSMATCH("1300", HttpStatus.BAD_REQUEST, "new password do not match retyped password") diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Activatable.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Activatable.java index 2eb27d91..7efea6f2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Activatable.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Activatable.java @@ -8,8 +8,11 @@ package ch.ethz.seb.sebserver.gbl.model; +import com.fasterxml.jackson.annotation.JsonIgnore; + public interface Activatable { + @JsonIgnore boolean isActive(); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Domain.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Domain.java index 7ca14c36..f971bb86 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Domain.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Domain.java @@ -5,9 +5,10 @@ import javax.annotation.Generated; /** Defines the global names of the domain model and domain model fields. * This shall be used as a static overall domain model names reference within SEB Server Web-Service as well as within the integrated GUI * This file is generated by the org.eth.demo.sebserver.gen.DomainModelNameReferencePlugin and must not be edited manually.**/ -@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2019-01-21T16:09:16.912+01:00") +@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2019-01-24T13:19:09.365+01:00") public interface Domain { String ATTR_ID = "id"; + String ATTR_INSTITUTION_ID = "institutionId"; interface CONFIGURATION_ATTRIBUTE { String TYPE_NAME = "ConfigurationAttribute"; diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Entity.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Entity.java index be964066..d96aa5b3 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Entity.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Entity.java @@ -8,13 +8,18 @@ package ch.ethz.seb.sebserver.gbl.model; +import com.fasterxml.jackson.annotation.JsonIgnore; + public interface Entity extends ModelIdAware { public static final String FILTER_ATTR_INSTITUTION = "institution"; public static final String FILTER_ATTR_ACTIVE = "active"; + public static final String FILTER_ATTR_NAME = "name"; + @JsonIgnore EntityType entityType(); + @JsonIgnore String getName(); public static EntityKeyAndName toName(final Entity entity) { diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityType.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityType.java index 5e309266..65440188 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityType.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityType.java @@ -2,7 +2,7 @@ package ch.ethz.seb.sebserver.gbl.model; import javax.annotation.Generated; -@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2019-01-21T16:09:16.974+01:00") +@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2019-01-24T13:19:09.428+01:00") public enum EntityType { CONFIGURATION_ATTRIBUTE, CONFIGURATION_VALUE, diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/ModelIdAware.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/ModelIdAware.java index 2c0b5168..59d9a61e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/ModelIdAware.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/ModelIdAware.java @@ -8,8 +8,11 @@ package ch.ethz.seb.sebserver.gbl.model; +import com.fasterxml.jackson.annotation.JsonIgnore; + public interface ModelIdAware { + @JsonIgnore String getModelId(); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Page.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Page.java index 3ec090f3..bc00ac46 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/Page.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/Page.java @@ -9,6 +9,7 @@ package ch.ethz.seb.sebserver.gbl.model; import java.util.Collection; +import java.util.List; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -22,6 +23,7 @@ public final class Page { DESCENDING } + public static final String ATTR_NAMES_ONLY = "names_only"; public static final String ATTR_NUMBER_OF_PAGES = "number_of_pages"; public static final String ATTR_PAGE_NUMBER = "page_number"; public static final String ATTR_PAGE_SIZE = "page_size"; @@ -41,7 +43,7 @@ public final class Page { public final SortOrder sortOrder; @JsonProperty(ATTR_CONTENT) - public final Collection content; + public final List content; @JsonCreator public Page( @@ -53,7 +55,7 @@ public final class Page { this.numberOfPages = numberOfPages; this.pageNumber = pageNumber; - this.content = Utils.immutableCollectionOf(content); + this.content = Utils.immutableListOf(content); this.pageSize = content.size(); this.sortBy = sortBy; this.sortOrder = sortOrder; diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java index 0990f95c..5cf887e6 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java @@ -32,6 +32,7 @@ public final class Exam implements GrantEntity, Activatable { public static final String FILTER_ATTR_TYPE = "type"; public static final String FILTER_ATTR_FROM = "from"; public static final String FILTER_ATTR_OWNER = "owner"; + public static final String FILTER_ATTR_QUIZ_ID = "quiz"; public enum ExamStatus { ON_CREATION, diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java index 9db740c0..266d7423 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java @@ -16,13 +16,16 @@ import javax.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import ch.ethz.seb.sebserver.gbl.model.Domain.EXAM; import ch.ethz.seb.sebserver.gbl.model.Domain.INDICATOR; import ch.ethz.seb.sebserver.gbl.model.Domain.THRESHOLD; -import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.util.Utils; +import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantEntity; -public final class Indicator implements Entity { +public final class Indicator implements GrantEntity { + + public static final String FILTER_ATTR_EXAM = "exam"; public enum IndicatorType { UNDEFINED, @@ -33,6 +36,13 @@ public final class Indicator implements Entity { @JsonProperty(INDICATOR.ATTR_ID) public final Long id; + @JsonProperty(EXAM.ATTR_INSTITUTION_ID) + @NotNull + public final Long institutionId; + + @JsonProperty(EXAM.ATTR_OWNER) + public final String owner; + @JsonProperty(INDICATOR.ATTR_EXAM_ID) @NotNull public final Long examId; @@ -55,6 +65,8 @@ public final class Indicator implements Entity { @JsonCreator public Indicator( @JsonProperty(INDICATOR.ATTR_ID) final Long id, + @JsonProperty(EXAM.ATTR_INSTITUTION_ID) final Long institutionId, + @JsonProperty(EXAM.ATTR_OWNER) final String owner, @JsonProperty(INDICATOR.ATTR_EXAM_ID) final Long examId, @JsonProperty(INDICATOR.ATTR_NAME) final String name, @JsonProperty(INDICATOR.ATTR_TYPE) final IndicatorType type, @@ -62,6 +74,8 @@ public final class Indicator implements Entity { @JsonProperty(THRESHOLD.REFERENCE_NAME) final Collection thresholds) { this.id = id; + this.institutionId = institutionId; + this.owner = owner; this.examId = examId; this.name = name; this.type = type; @@ -88,6 +102,19 @@ public final class Indicator implements Entity { return this.id; } + @Override + + public Long getInstitutionId() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getOwnerId() { + // TODO Auto-generated method stub + return null; + } + public Long getExamId() { return this.examId; } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/Institution.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/Institution.java index 66a9da56..c55d28b2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/Institution.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/Institution.java @@ -11,7 +11,6 @@ package ch.ethz.seb.sebserver.gbl.model.institution; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import ch.ethz.seb.sebserver.gbl.model.Activatable; @@ -55,7 +54,6 @@ public final class Institution implements GrantEntity, Activatable { } @Override - @JsonIgnore public EntityType entityType() { return EntityType.INSTITUTION; } @@ -68,7 +66,6 @@ public final class Institution implements GrantEntity, Activatable { } @Override - @JsonIgnore public boolean isActive() { return this.active; } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/LmsSetup.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/LmsSetup.java index 230f930b..e251e80b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/LmsSetup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/institution/LmsSetup.java @@ -25,7 +25,6 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantEntity; public final class LmsSetup implements GrantEntity, Activatable { - public static final String FILTER_ATTR_NAME = "name"; public static final String FILTER_ATTR_LMS_TYPE = "lms_type"; public enum LmsType { diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserActivityLog.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserActivityLog.java index baf26ccf..e968c2d5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserActivityLog.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserActivityLog.java @@ -19,6 +19,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.Acti public class UserActivityLog implements Entity { + public static final String FILTER_ATTR_USER = "user"; public static final String FILTER_ATTR_FROM = "from"; public static final String FILTER_ATTR_TO = "to"; public static final String FILTER_ATTR_ACTIVITY_TYPES = "activity_types"; @@ -76,13 +77,11 @@ public class UserActivityLog implements Entity { } @Override - @JsonIgnore public EntityType entityType() { return EntityType.USER_ACTIVITY_LOG; } @Override - @JsonIgnore public String getModelId() { return (this.id != null) ? String.valueOf(this.id) @@ -90,7 +89,6 @@ public class UserActivityLog implements Entity { } @Override - @JsonIgnore public String getName() { return getModelId(); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserFilter.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserFilter.java deleted file mode 100644 index 7e78b6b5..00000000 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserFilter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2018 ETH Zürich, Educational Development and Technology (LET) - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -package ch.ethz.seb.sebserver.gbl.model.user; - -import ch.ethz.seb.sebserver.gbl.model.Entity; - -public final class UserFilter { - - public static final String FILTER_ATTR_ACTIVE = Entity.FILTER_ATTR_ACTIVE; - public static final String FILTER_ATTR_NAME = "name"; - public static final String FILTER_ATTR_USER_NAME = "username"; - public static final String FILTER_ATTR_EMAIL = "email"; - public static final String FILTER_ATTR_LOCALE = "locale"; - public static final String FILTER_ATTR_INSTITUTION = Entity.FILTER_ATTR_INSTITUTION; - - public final Boolean active; - public final Long institutionId; - public final String name; - public final String username; - public final String email; - public final String locale; - - public UserFilter( - final Long institutionId, - final String name, - final String username, - final String email, - final Boolean active, - final String locale) { - - this.institutionId = institutionId; - this.name = name; - this.username = username; - this.email = email; - this.active = active; //(active != null) ? active : true; - this.locale = locale; - } - - public Long getInstitutionId() { - return this.institutionId; - } - - public String getName() { - return this.name; - } - - public String getUsername() { - return this.username; - } - - public String getEmail() { - return this.email; - } - - public Boolean getActive() { - return this.active; - } - - public String getLocale() { - return this.locale; - } - - @Override - public String toString() { - return "UserFilter [active=" + this.active + ", institutionId=" + this.institutionId + ", name=" + this.name - + ", username=" - + this.username + ", email=" + this.email + ", locale=" + this.locale + "]"; - } - -} diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserInfo.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserInfo.java index 4f12795c..1fa3fbb6 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserInfo.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserInfo.java @@ -16,7 +16,6 @@ import org.apache.commons.lang3.BooleanUtils; import org.joda.time.DateTimeZone; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import ch.ethz.seb.sebserver.gbl.model.Activatable; @@ -36,6 +35,10 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable { private static final long serialVersionUID = 2526446136264377808L; + public static final String FILTER_ATTR_USER_NAME = "username"; + public static final String FILTER_ATTR_EMAIL = "email"; + public static final String FILTER_ATTR_LOCALE = "locale"; + /** The user's UUID */ @JsonProperty(USER.ATTR_UUID) public final String uuid; @@ -96,12 +99,10 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable { } @Override - @JsonIgnore public EntityType entityType() { return EntityType.USER; } - @JsonIgnore @Override public String getModelId() { return this.uuid; @@ -116,7 +117,6 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable { return this.institutionId; } - @JsonIgnore @Override public String getOwnerId() { return this.uuid; @@ -139,7 +139,6 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable { return this.active; } - @JsonIgnore @Override public boolean isActive() { return this.active; diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserMod.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserMod.java index 8efbea3d..d3f51fa5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserMod.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/user/UserMod.java @@ -13,14 +13,13 @@ import java.util.Locale; import java.util.Set; import javax.validation.constraints.Email; -import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.joda.time.DateTimeZone; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import ch.ethz.seb.sebserver.gbl.model.Domain.USER; @@ -47,7 +46,6 @@ public final class UserMod implements GrantEntity { public final String name; /** The internal user name */ - @NotNull @Size(min = 3, max = 255, message = "user:username:size:{min}:{max}:${validatedValue}") @JsonProperty(USER.ATTR_USERNAME) public final String username; @@ -58,18 +56,14 @@ public final class UserMod implements GrantEntity { public final String email; /** The users locale */ - @NotNull @JsonProperty(USER.ATTR_LOCALE) public final Locale locale; /** The users time zone */ - @NotNull @JsonProperty(USER.ATTR_TIMEZONE) public final DateTimeZone timeZone; - /** The users roles in a unmodifiable set. Is never null */ - @NotNull - @NotEmpty(message = "user:roles:notEmpty:_:_:_") + /** The users roles in a unmodifiable set */ @JsonProperty(USER_ROLE.REFERENCE_NAME) public final Set roles; @@ -81,6 +75,7 @@ public final class UserMod implements GrantEntity { private final String retypedNewPassword; @JsonCreator + @JsonIgnoreProperties(ignoreUnknown = true) public UserMod( @JsonProperty(USER.ATTR_UUID) final String uuid, @JsonProperty(USER.ATTR_INSTITUTION_ID) final Long institutionId, @@ -101,8 +96,8 @@ public final class UserMod implements GrantEntity { this.name = name; this.username = username; this.email = email; - this.locale = locale; - this.timeZone = timeZone; + this.locale = (locale != null) ? locale : Locale.ROOT; + this.timeZone = (timeZone != null) ? timeZone : DateTimeZone.UTC; this.roles = (roles != null) ? Collections.unmodifiableSet(roles) : Collections.emptySet(); @@ -122,25 +117,21 @@ public final class UserMod implements GrantEntity { } @Override - @JsonIgnore public String getModelId() { return this.uuid; } @Override - @JsonIgnore public EntityType entityType() { return EntityType.USER; } @Override - @JsonIgnore public Long getInstitutionId() { return this.institutionId; } @Override - @JsonIgnore public String getOwnerId() { return this.uuid; } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java index b59ab242..54cd9935 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java @@ -26,6 +26,12 @@ import ch.ethz.seb.sebserver.gbl.Constants; public final class Utils { + public static List immutableListOf(final Collection collection) { + return (collection != null) + ? Collections.unmodifiableList(new ArrayList<>(collection)) + : Collections.emptyList(); + } + public static Collection immutableCollectionOf(final Collection collection) { return (collection != null) ? Collections.unmodifiableCollection(collection) @@ -72,6 +78,12 @@ public final class Utils { : Collections.emptyList(); } + public static Map immutableMapOf(final Map params) { + return (params != null) + ? Collections.unmodifiableMap(params) + : Collections.emptyMap(); + } + public static > Collection> createSelectionResource(final Class enumClass) { return Collections.unmodifiableCollection(Arrays.asList( enumClass.getEnumConstants()) @@ -80,10 +92,6 @@ public final class Utils { .collect(Collectors.toList())); } - public static String toSQLWildcard(final String text) { - return (text == null) ? null : "%" + text + "%"; - } - public static Result dateTimeStringToTimestamp(final String startTime) { return Result.tryCatch(() -> { return DateTime.parse(startTime, Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS).getMillis(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/WebServiceInit.java b/src/main/java/ch/ethz/seb/sebserver/webservice/WebServiceInit.java index 049f66df..3af04b58 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/WebServiceInit.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/WebServiceInit.java @@ -12,11 +12,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; -@Component @WebServiceProfile public class WebServiceInit implements ApplicationListener { @@ -29,5 +27,4 @@ public class WebServiceInit implements ApplicationListener { } private DateTime getDateTime(final SupplierSQLExceptionAware supplier) throws SQLException { - String dateFormattedString = supplier.get(); - + final String dateFormattedString = supplier.get(); try { - // cutting milliseconds if there are some. This is needed to be able to use a general pattern - // independently from the different data-base-drivers format the date-time values - if (dateFormattedString.contains(".")) { - dateFormattedString = dateFormattedString.substring( - 0, - dateFormattedString.indexOf(".")); - } - - // NOTE: This create a DateTime in UTC time.zone with no time-zone-offset. - final LocalDateTime localDateTime = LocalDateTime.parse( - dateFormattedString, - Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS); - final DateTime dateTime = localDateTime.toDateTime(DateTimeZone.UTC); - - return dateTime; + return getDateTime(supplier.get()); } catch (final Exception e) { log.error("while trying to parse LocalDateTime; value: " + dateFormattedString + " format: " + Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS, e); @@ -88,8 +73,28 @@ public class JodaTimeTypeResolver extends BaseTypeHandler { } } + public static final DateTime getDateTime(final String stringValue) { + String dateFormattedString = stringValue; + + // cutting milliseconds if there are some. This is needed to be able to use a general pattern + // independently from the different data-base-drivers format the date-time values + if (dateFormattedString.contains(".")) { + dateFormattedString = dateFormattedString.substring( + 0, + dateFormattedString.indexOf(".")); + } + + // NOTE: This create a DateTime in UTC time.zone with no time-zone-offset. + final LocalDateTime localDateTime = LocalDateTime.parse( + dateFormattedString, + Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS); + final DateTime dateTime = localDateTime.toDateTime(DateTimeZone.UTC); + + return dateTime; + } + @FunctionalInterface - private interface SupplierSQLExceptionAware { + public interface SupplierSQLExceptionAware { T get() throws SQLException; } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java index 3ef3cf0f..434ed128 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java @@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ClientConnectionRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") public static final ClientConnectionRecord clientConnectionRecord = new ClientConnectionRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.id") public static final SqlColumn id = clientConnectionRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.exam_id") public static final SqlColumn examId = clientConnectionRecord.examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.status") public static final SqlColumn status = clientConnectionRecord.status; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.connection_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.connection_token") public static final SqlColumn connectionToken = clientConnectionRecord.connectionToken; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.user_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.user_name") public static final SqlColumn userName = clientConnectionRecord.userName; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.vdi") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.vdi") public static final SqlColumn vdi = clientConnectionRecord.vdi; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.client_address") public static final SqlColumn clientAddress = clientConnectionRecord.clientAddress; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.virtual_client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.virtual_client_address") public static final SqlColumn virtualClientAddress = clientConnectionRecord.virtualClientAddress; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") public static final class ClientConnectionRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordMapper.java index 41759812..491aa1fc 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientConnectionRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ClientConnectionRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -59,7 +59,7 @@ public interface ClientConnectionRecordMapper { }) ClientConnectionRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -73,22 +73,22 @@ public interface ClientConnectionRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(clientConnectionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord) .where(id, isEqualTo(id_)) @@ -96,7 +96,7 @@ public interface ClientConnectionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default int insert(ClientConnectionRecord record) { return insert(SqlBuilder.insert(record) .into(clientConnectionRecord) @@ -111,7 +111,7 @@ public interface ClientConnectionRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default int insertSelective(ClientConnectionRecord record) { return insert(SqlBuilder.insert(record) .into(clientConnectionRecord) @@ -126,19 +126,19 @@ public interface ClientConnectionRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) .from(clientConnectionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) .from(clientConnectionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default ClientConnectionRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) .from(clientConnectionRecord) @@ -147,7 +147,7 @@ public interface ClientConnectionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default UpdateDSL> updateByExample(ClientConnectionRecord record) { return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) .set(examId).equalTo(record::getExamId) @@ -159,7 +159,7 @@ public interface ClientConnectionRecordMapper { .set(virtualClientAddress).equalTo(record::getVirtualClientAddress); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default UpdateDSL> updateByExampleSelective(ClientConnectionRecord record) { return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) .set(examId).equalToWhenPresent(record::getExamId) @@ -171,7 +171,7 @@ public interface ClientConnectionRecordMapper { .set(virtualClientAddress).equalToWhenPresent(record::getVirtualClientAddress); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default int updateByPrimaryKey(ClientConnectionRecord record) { return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) .set(examId).equalTo(record::getExamId) @@ -186,7 +186,7 @@ public interface ClientConnectionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_connection") default int updateByPrimaryKeySelective(ClientConnectionRecord record) { return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) .set(examId).equalToWhenPresent(record::getExamId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordDynamicSqlSupport.java index 46b631ca..e7fed67d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordDynamicSqlSupport.java @@ -7,31 +7,31 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ClientEventRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") public static final ClientEventRecord clientEventRecord = new ClientEventRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.id") public static final SqlColumn id = clientEventRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.connection_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.connection_id") public static final SqlColumn connectionId = clientEventRecord.connectionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.user_identifier") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.user_identifier") public static final SqlColumn userIdentifier = clientEventRecord.userIdentifier; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.type") public static final SqlColumn type = clientEventRecord.type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.timestamp") public static final SqlColumn timestamp = clientEventRecord.timestamp; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.numeric_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.numeric_value") public static final SqlColumn numericValue = clientEventRecord.numericValue; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.text") public static final SqlColumn text = clientEventRecord.text; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") public static final class ClientEventRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordMapper.java index 746ea8b2..62b590ff 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ClientEventRecordMapper.java @@ -33,20 +33,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ClientEventRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -59,7 +59,7 @@ public interface ClientEventRecordMapper { }) ClientEventRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -72,22 +72,22 @@ public interface ClientEventRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(clientEventRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord) .where(id, isEqualTo(id_)) @@ -95,7 +95,7 @@ public interface ClientEventRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default int insert(ClientEventRecord record) { return insert(SqlBuilder.insert(record) .into(clientEventRecord) @@ -109,7 +109,7 @@ public interface ClientEventRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default int insertSelective(ClientEventRecord record) { return insert(SqlBuilder.insert(record) .into(clientEventRecord) @@ -123,19 +123,19 @@ public interface ClientEventRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) .from(clientEventRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) .from(clientEventRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default ClientEventRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, connectionId, userIdentifier, type, timestamp, numericValue, text) .from(clientEventRecord) @@ -144,7 +144,7 @@ public interface ClientEventRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default UpdateDSL> updateByExample(ClientEventRecord record) { return UpdateDSL.updateWithMapper(this::update, clientEventRecord) .set(connectionId).equalTo(record::getConnectionId) @@ -155,7 +155,7 @@ public interface ClientEventRecordMapper { .set(text).equalTo(record::getText); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default UpdateDSL> updateByExampleSelective(ClientEventRecord record) { return UpdateDSL.updateWithMapper(this::update, clientEventRecord) .set(connectionId).equalToWhenPresent(record::getConnectionId) @@ -166,7 +166,7 @@ public interface ClientEventRecordMapper { .set(text).equalToWhenPresent(record::getText); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default int updateByPrimaryKey(ClientEventRecord record) { return UpdateDSL.updateWithMapper(this::update, clientEventRecord) .set(connectionId).equalTo(record::getConnectionId) @@ -180,7 +180,7 @@ public interface ClientEventRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") default int updateByPrimaryKeySelective(ClientEventRecord record) { return UpdateDSL.updateWithMapper(this::update, clientEventRecord) .set(connectionId).equalToWhenPresent(record::getConnectionId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java index df19e9af..21a37558 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java @@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ConfigurationAttributeRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.879+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source Table: configuration_attribute") public static final ConfigurationAttributeRecord configurationAttributeRecord = new ConfigurationAttributeRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.881+01:00", comments="Source field: configuration_attribute.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.id") public static final SqlColumn id = configurationAttributeRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.name") public static final SqlColumn name = configurationAttributeRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.type") public static final SqlColumn type = configurationAttributeRecord.type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.parent_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.parent_id") public static final SqlColumn parentId = configurationAttributeRecord.parentId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.resources") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.resources") public static final SqlColumn resources = configurationAttributeRecord.resources; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.validator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.validator") public static final SqlColumn validator = configurationAttributeRecord.validator; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.882+01:00", comments="Source field: configuration_attribute.dependencies") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.dependencies") public static final SqlColumn dependencies = configurationAttributeRecord.dependencies; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.883+01:00", comments="Source field: configuration_attribute.default_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source field: configuration_attribute.default_value") public static final SqlColumn defaultValue = configurationAttributeRecord.defaultValue; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.881+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source Table: configuration_attribute") public static final class ConfigurationAttributeRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordMapper.java index b06fae77..81c866f7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationAttributeRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ConfigurationAttributeRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.884+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source Table: configuration_attribute") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.886+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source Table: configuration_attribute") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.886+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.318+01:00", comments="Source Table: configuration_attribute") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.888+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -59,7 +59,7 @@ public interface ConfigurationAttributeRecordMapper { }) ConfigurationAttributeRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.889+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -73,22 +73,22 @@ public interface ConfigurationAttributeRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.890+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.891+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(configurationAttributeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.892+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.893+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord) .where(id, isEqualTo(id_)) @@ -96,7 +96,7 @@ public interface ConfigurationAttributeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.894+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default int insert(ConfigurationAttributeRecord record) { return insert(SqlBuilder.insert(record) .into(configurationAttributeRecord) @@ -111,7 +111,7 @@ public interface ConfigurationAttributeRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.895+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default int insertSelective(ConfigurationAttributeRecord record) { return insert(SqlBuilder.insert(record) .into(configurationAttributeRecord) @@ -126,19 +126,19 @@ public interface ConfigurationAttributeRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.896+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.334+01:00", comments="Source Table: configuration_attribute") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) .from(configurationAttributeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.897+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) .from(configurationAttributeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.897+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default ConfigurationAttributeRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, name, type, parentId, resources, validator, dependencies, defaultValue) .from(configurationAttributeRecord) @@ -147,7 +147,7 @@ public interface ConfigurationAttributeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.898+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default UpdateDSL> updateByExample(ConfigurationAttributeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) .set(name).equalTo(record::getName) @@ -159,7 +159,7 @@ public interface ConfigurationAttributeRecordMapper { .set(defaultValue).equalTo(record::getDefaultValue); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.899+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default UpdateDSL> updateByExampleSelective(ConfigurationAttributeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) .set(name).equalToWhenPresent(record::getName) @@ -171,7 +171,7 @@ public interface ConfigurationAttributeRecordMapper { .set(defaultValue).equalToWhenPresent(record::getDefaultValue); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.900+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default int updateByPrimaryKey(ConfigurationAttributeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) .set(name).equalTo(record::getName) @@ -186,7 +186,7 @@ public interface ConfigurationAttributeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.901+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.349+01:00", comments="Source Table: configuration_attribute") default int updateByPrimaryKeySelective(ConfigurationAttributeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) .set(name).equalToWhenPresent(record::getName) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java index c5530942..a40d924e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java @@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ConfigurationNodeRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") public static final ConfigurationNodeRecord configurationNodeRecord = new ConfigurationNodeRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.id") public static final SqlColumn id = configurationNodeRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.institution_id") public static final SqlColumn institutionId = configurationNodeRecord.institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.owner") public static final SqlColumn owner = configurationNodeRecord.owner; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.name") public static final SqlColumn name = configurationNodeRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.description") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.description") public static final SqlColumn description = configurationNodeRecord.description; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.type") public static final SqlColumn type = configurationNodeRecord.type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.template") public static final SqlColumn template = configurationNodeRecord.template; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.active") public static final SqlColumn active = configurationNodeRecord.active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") public static final class ConfigurationNodeRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordMapper.java index 0e4ab831..bc5c6ecc 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationNodeRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ConfigurationNodeRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -59,7 +59,7 @@ public interface ConfigurationNodeRecordMapper { }) ConfigurationNodeRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -73,22 +73,22 @@ public interface ConfigurationNodeRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(configurationNodeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord) .where(id, isEqualTo(id_)) @@ -96,7 +96,7 @@ public interface ConfigurationNodeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default int insert(ConfigurationNodeRecord record) { return insert(SqlBuilder.insert(record) .into(configurationNodeRecord) @@ -111,7 +111,7 @@ public interface ConfigurationNodeRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default int insertSelective(ConfigurationNodeRecord record) { return insert(SqlBuilder.insert(record) .into(configurationNodeRecord) @@ -126,19 +126,19 @@ public interface ConfigurationNodeRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active) .from(configurationNodeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active) .from(configurationNodeRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default ConfigurationNodeRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, owner, name, description, type, template, active) .from(configurationNodeRecord) @@ -147,7 +147,7 @@ public interface ConfigurationNodeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default UpdateDSL> updateByExample(ConfigurationNodeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -159,7 +159,7 @@ public interface ConfigurationNodeRecordMapper { .set(active).equalTo(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default UpdateDSL> updateByExampleSelective(ConfigurationNodeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) @@ -171,7 +171,7 @@ public interface ConfigurationNodeRecordMapper { .set(active).equalToWhenPresent(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default int updateByPrimaryKey(ConfigurationNodeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -186,7 +186,7 @@ public interface ConfigurationNodeRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: configuration_node") default int updateByPrimaryKeySelective(ConfigurationNodeRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordDynamicSqlSupport.java index 67da153b..34a8b412 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordDynamicSqlSupport.java @@ -7,25 +7,25 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ConfigurationRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") public static final ConfigurationRecord configurationRecord = new ConfigurationRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.id") public static final SqlColumn id = configurationRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.configuration_node_id") public static final SqlColumn configurationNodeId = configurationRecord.configurationNodeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version") public static final SqlColumn version = configurationRecord.version; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version_date") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version_date") public static final SqlColumn versionDate = configurationRecord.versionDate; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.followup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.followup") public static final SqlColumn followup = configurationRecord.followup; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") public static final class ConfigurationRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordMapper.java index 68761b05..6abb4862 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationRecordMapper.java @@ -34,20 +34,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ConfigurationRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -58,7 +58,7 @@ public interface ConfigurationRecordMapper { }) ConfigurationRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -69,22 +69,22 @@ public interface ConfigurationRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(configurationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord) .where(id, isEqualTo(id_)) @@ -92,7 +92,7 @@ public interface ConfigurationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default int insert(ConfigurationRecord record) { return insert(SqlBuilder.insert(record) .into(configurationRecord) @@ -104,7 +104,7 @@ public interface ConfigurationRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default int insertSelective(ConfigurationRecord record) { return insert(SqlBuilder.insert(record) .into(configurationRecord) @@ -116,19 +116,19 @@ public interface ConfigurationRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) .from(configurationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) .from(configurationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default ConfigurationRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, configurationNodeId, version, versionDate, followup) .from(configurationRecord) @@ -137,7 +137,7 @@ public interface ConfigurationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default UpdateDSL> updateByExample(ConfigurationRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationRecord) .set(configurationNodeId).equalTo(record::getConfigurationNodeId) @@ -146,7 +146,7 @@ public interface ConfigurationRecordMapper { .set(followup).equalTo(record::getFollowup); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default UpdateDSL> updateByExampleSelective(ConfigurationRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationRecord) .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) @@ -155,7 +155,7 @@ public interface ConfigurationRecordMapper { .set(followup).equalToWhenPresent(record::getFollowup); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default int updateByPrimaryKey(ConfigurationRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationRecord) .set(configurationNodeId).equalTo(record::getConfigurationNodeId) @@ -167,7 +167,7 @@ public interface ConfigurationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") default int updateByPrimaryKeySelective(ConfigurationRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationRecord) .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java index b6af469e..bb8a250b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java @@ -6,28 +6,28 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ConfigurationValueRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") public static final ConfigurationValueRecord configurationValueRecord = new ConfigurationValueRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.id") public static final SqlColumn id = configurationValueRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.configuration_id") public static final SqlColumn configurationId = configurationValueRecord.configurationId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.configuration_attribute_id") public static final SqlColumn configurationAttributeId = configurationValueRecord.configurationAttributeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.list_index") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.list_index") public static final SqlColumn listIndex = configurationValueRecord.listIndex; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.value") public static final SqlColumn value = configurationValueRecord.value; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.text") public static final SqlColumn text = configurationValueRecord.text; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") public static final class ConfigurationValueRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordMapper.java index 693dc69e..eee2f7a8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ConfigurationValueRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ConfigurationValueRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -57,7 +57,7 @@ public interface ConfigurationValueRecordMapper { }) ConfigurationValueRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -69,22 +69,22 @@ public interface ConfigurationValueRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(configurationValueRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord) .where(id, isEqualTo(id_)) @@ -92,7 +92,7 @@ public interface ConfigurationValueRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default int insert(ConfigurationValueRecord record) { return insert(SqlBuilder.insert(record) .into(configurationValueRecord) @@ -105,7 +105,7 @@ public interface ConfigurationValueRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default int insertSelective(ConfigurationValueRecord record) { return insert(SqlBuilder.insert(record) .into(configurationValueRecord) @@ -118,19 +118,19 @@ public interface ConfigurationValueRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) .from(configurationValueRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) .from(configurationValueRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default ConfigurationValueRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, configurationId, configurationAttributeId, listIndex, value, text) .from(configurationValueRecord) @@ -139,7 +139,7 @@ public interface ConfigurationValueRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default UpdateDSL> updateByExample(ConfigurationValueRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) .set(configurationId).equalTo(record::getConfigurationId) @@ -149,7 +149,7 @@ public interface ConfigurationValueRecordMapper { .set(text).equalTo(record::getText); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default UpdateDSL> updateByExampleSelective(ConfigurationValueRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) .set(configurationId).equalToWhenPresent(record::getConfigurationId) @@ -159,7 +159,7 @@ public interface ConfigurationValueRecordMapper { .set(text).equalToWhenPresent(record::getText); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default int updateByPrimaryKey(ConfigurationValueRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) .set(configurationId).equalTo(record::getConfigurationId) @@ -172,7 +172,7 @@ public interface ConfigurationValueRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_value") default int updateByPrimaryKeySelective(ConfigurationValueRecord record) { return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) .set(configurationId).equalToWhenPresent(record::getConfigurationId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java index c52a8fc1..c9fa6c5a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java @@ -6,22 +6,22 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ExamConfigurationMapRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") public static final ExamConfigurationMapRecord examConfigurationMapRecord = new ExamConfigurationMapRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.id") public static final SqlColumn id = examConfigurationMapRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.exam_id") public static final SqlColumn examId = examConfigurationMapRecord.examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.configuration_node_id") public static final SqlColumn configurationNodeId = examConfigurationMapRecord.configurationNodeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.user_names") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.user_names") public static final SqlColumn userNames = examConfigurationMapRecord.userNames; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") public static final class ExamConfigurationMapRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordMapper.java index 4a549ce1..a835bed8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamConfigurationMapRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ExamConfigurationMapRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -55,7 +55,7 @@ public interface ExamConfigurationMapRecordMapper { }) ExamConfigurationMapRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -65,22 +65,22 @@ public interface ExamConfigurationMapRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(examConfigurationMapRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord) .where(id, isEqualTo(id_)) @@ -88,7 +88,7 @@ public interface ExamConfigurationMapRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default int insert(ExamConfigurationMapRecord record) { return insert(SqlBuilder.insert(record) .into(examConfigurationMapRecord) @@ -99,7 +99,7 @@ public interface ExamConfigurationMapRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default int insertSelective(ExamConfigurationMapRecord record) { return insert(SqlBuilder.insert(record) .into(examConfigurationMapRecord) @@ -110,19 +110,19 @@ public interface ExamConfigurationMapRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) .from(examConfigurationMapRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) .from(examConfigurationMapRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default ExamConfigurationMapRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, examId, configurationNodeId, userNames) .from(examConfigurationMapRecord) @@ -131,7 +131,7 @@ public interface ExamConfigurationMapRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default UpdateDSL> updateByExample(ExamConfigurationMapRecord record) { return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) .set(examId).equalTo(record::getExamId) @@ -139,7 +139,7 @@ public interface ExamConfigurationMapRecordMapper { .set(userNames).equalTo(record::getUserNames); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default UpdateDSL> updateByExampleSelective(ExamConfigurationMapRecord record) { return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) .set(examId).equalToWhenPresent(record::getExamId) @@ -147,7 +147,7 @@ public interface ExamConfigurationMapRecordMapper { .set(userNames).equalToWhenPresent(record::getUserNames); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default int updateByPrimaryKey(ExamConfigurationMapRecord record) { return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) .set(examId).equalTo(record::getExamId) @@ -158,7 +158,7 @@ public interface ExamConfigurationMapRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") default int updateByPrimaryKeySelective(ExamConfigurationMapRecord record) { return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) .set(examId).equalToWhenPresent(record::getExamId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordDynamicSqlSupport.java index cbc66118..e93b5b4f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordDynamicSqlSupport.java @@ -6,37 +6,37 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ExamRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") public static final ExamRecord examRecord = new ExamRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.id") public static final SqlColumn id = examRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.institution_id") public static final SqlColumn institutionId = examRecord.institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.lms_setup_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.lms_setup_id") public static final SqlColumn lmsSetupId = examRecord.lmsSetupId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.external_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.external_id") public static final SqlColumn externalId = examRecord.externalId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.owner") public static final SqlColumn owner = examRecord.owner; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.supporter") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.supporter") public static final SqlColumn supporter = examRecord.supporter; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.type") public static final SqlColumn type = examRecord.type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.status") public static final SqlColumn status = examRecord.status; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.active") public static final SqlColumn active = examRecord.active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") public static final class ExamRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordMapper.java index 2b1ce608..eed0d0e7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ExamRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ExamRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -60,7 +60,7 @@ public interface ExamRecordMapper { }) ExamRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -75,22 +75,22 @@ public interface ExamRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(examRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, examRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, examRecord) .where(id, isEqualTo(id_)) @@ -98,7 +98,7 @@ public interface ExamRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default int insert(ExamRecord record) { return insert(SqlBuilder.insert(record) .into(examRecord) @@ -114,7 +114,7 @@ public interface ExamRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default int insertSelective(ExamRecord record) { return insert(SqlBuilder.insert(record) .into(examRecord) @@ -130,19 +130,19 @@ public interface ExamRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) .from(examRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) .from(examRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default ExamRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) .from(examRecord) @@ -151,7 +151,7 @@ public interface ExamRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default UpdateDSL> updateByExample(ExamRecord record) { return UpdateDSL.updateWithMapper(this::update, examRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -164,7 +164,7 @@ public interface ExamRecordMapper { .set(active).equalTo(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default UpdateDSL> updateByExampleSelective(ExamRecord record) { return UpdateDSL.updateWithMapper(this::update, examRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) @@ -177,7 +177,7 @@ public interface ExamRecordMapper { .set(active).equalToWhenPresent(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default int updateByPrimaryKey(ExamRecord record) { return UpdateDSL.updateWithMapper(this::update, examRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -193,7 +193,7 @@ public interface ExamRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") default int updateByPrimaryKeySelective(ExamRecord record) { return UpdateDSL.updateWithMapper(this::update, examRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordDynamicSqlSupport.java index 4e50b480..070822f1 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordDynamicSqlSupport.java @@ -6,25 +6,25 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class IndicatorRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") public static final IndicatorRecord indicatorRecord = new IndicatorRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.id") public static final SqlColumn id = indicatorRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.exam_id") public static final SqlColumn examId = indicatorRecord.examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.type") public static final SqlColumn type = indicatorRecord.type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: indicator.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.name") public static final SqlColumn name = indicatorRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: indicator.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.color") public static final SqlColumn color = indicatorRecord.color; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") public static final class IndicatorRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordMapper.java index 3d39eadc..cbf5c8f0 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/IndicatorRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface IndicatorRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -56,7 +56,7 @@ public interface IndicatorRecordMapper { }) IndicatorRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -67,22 +67,22 @@ public interface IndicatorRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(indicatorRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord) .where(id, isEqualTo(id_)) @@ -90,7 +90,7 @@ public interface IndicatorRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default int insert(IndicatorRecord record) { return insert(SqlBuilder.insert(record) .into(indicatorRecord) @@ -102,7 +102,7 @@ public interface IndicatorRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default int insertSelective(IndicatorRecord record) { return insert(SqlBuilder.insert(record) .into(indicatorRecord) @@ -114,19 +114,19 @@ public interface IndicatorRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, examId, type, name, color) .from(indicatorRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, type, name, color) .from(indicatorRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default IndicatorRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, examId, type, name, color) .from(indicatorRecord) @@ -135,7 +135,7 @@ public interface IndicatorRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default UpdateDSL> updateByExample(IndicatorRecord record) { return UpdateDSL.updateWithMapper(this::update, indicatorRecord) .set(examId).equalTo(record::getExamId) @@ -144,7 +144,7 @@ public interface IndicatorRecordMapper { .set(color).equalTo(record::getColor); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default UpdateDSL> updateByExampleSelective(IndicatorRecord record) { return UpdateDSL.updateWithMapper(this::update, indicatorRecord) .set(examId).equalToWhenPresent(record::getExamId) @@ -153,7 +153,7 @@ public interface IndicatorRecordMapper { .set(color).equalToWhenPresent(record::getColor); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default int updateByPrimaryKey(IndicatorRecord record) { return UpdateDSL.updateWithMapper(this::update, indicatorRecord) .set(examId).equalTo(record::getExamId) @@ -165,7 +165,7 @@ public interface IndicatorRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") default int updateByPrimaryKeySelective(IndicatorRecord record) { return UpdateDSL.updateWithMapper(this::update, indicatorRecord) .set(examId).equalToWhenPresent(record::getExamId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordDynamicSqlSupport.java index dc12832c..ff01769c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordDynamicSqlSupport.java @@ -6,25 +6,25 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class InstitutionRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") public static final InstitutionRecord institutionRecord = new InstitutionRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.id") public static final SqlColumn id = institutionRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.name") public static final SqlColumn name = institutionRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.url_suffix") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.url_suffix") public static final SqlColumn urlSuffix = institutionRecord.urlSuffix; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.active") public static final SqlColumn active = institutionRecord.active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.logo_image") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.logo_image") public static final SqlColumn logoImage = institutionRecord.logoImage; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") public static final class InstitutionRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordMapper.java index fbc656a5..59547b4e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/InstitutionRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface InstitutionRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -56,7 +56,7 @@ public interface InstitutionRecordMapper { }) InstitutionRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -67,22 +67,22 @@ public interface InstitutionRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(institutionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord) .where(id, isEqualTo(id_)) @@ -90,7 +90,7 @@ public interface InstitutionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default int insert(InstitutionRecord record) { return insert(SqlBuilder.insert(record) .into(institutionRecord) @@ -102,7 +102,7 @@ public interface InstitutionRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default int insertSelective(InstitutionRecord record) { return insert(SqlBuilder.insert(record) .into(institutionRecord) @@ -114,19 +114,19 @@ public interface InstitutionRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage) .from(institutionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage) .from(institutionRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default InstitutionRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, name, urlSuffix, active, logoImage) .from(institutionRecord) @@ -135,7 +135,7 @@ public interface InstitutionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default UpdateDSL> updateByExample(InstitutionRecord record) { return UpdateDSL.updateWithMapper(this::update, institutionRecord) .set(name).equalTo(record::getName) @@ -144,7 +144,7 @@ public interface InstitutionRecordMapper { .set(logoImage).equalTo(record::getLogoImage); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default UpdateDSL> updateByExampleSelective(InstitutionRecord record) { return UpdateDSL.updateWithMapper(this::update, institutionRecord) .set(name).equalToWhenPresent(record::getName) @@ -153,7 +153,7 @@ public interface InstitutionRecordMapper { .set(logoImage).equalToWhenPresent(record::getLogoImage); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default int updateByPrimaryKey(InstitutionRecord record) { return UpdateDSL.updateWithMapper(this::update, institutionRecord) .set(name).equalTo(record::getName) @@ -165,7 +165,7 @@ public interface InstitutionRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") default int updateByPrimaryKeySelective(InstitutionRecord record) { return UpdateDSL.updateWithMapper(this::update, institutionRecord) .set(name).equalToWhenPresent(record::getName) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordDynamicSqlSupport.java index a2111ac4..8bce049f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordDynamicSqlSupport.java @@ -6,43 +6,43 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class LmsSetupRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") public static final LmsSetupRecord lmsSetupRecord = new LmsSetupRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.id") public static final SqlColumn id = lmsSetupRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.125+01:00", comments="Source field: lms_setup.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.institution_id") public static final SqlColumn institutionId = lmsSetupRecord.institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.126+01:00", comments="Source field: lms_setup.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.name") public static final SqlColumn name = lmsSetupRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.128+01:00", comments="Source field: lms_setup.lms_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_type") public static final SqlColumn lmsType = lmsSetupRecord.lmsType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.128+01:00", comments="Source field: lms_setup.lms_url") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_url") public static final SqlColumn lmsUrl = lmsSetupRecord.lmsUrl; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.128+01:00", comments="Source field: lms_setup.lms_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientname") public static final SqlColumn lmsClientname = lmsSetupRecord.lmsClientname; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.128+01:00", comments="Source field: lms_setup.lms_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientsecret") public static final SqlColumn lmsClientsecret = lmsSetupRecord.lmsClientsecret; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.129+01:00", comments="Source field: lms_setup.lms_rest_api_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_rest_api_token") public static final SqlColumn lmsRestApiToken = lmsSetupRecord.lmsRestApiToken; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.129+01:00", comments="Source field: lms_setup.seb_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientname") public static final SqlColumn sebClientname = lmsSetupRecord.sebClientname; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.129+01:00", comments="Source field: lms_setup.seb_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientsecret") public static final SqlColumn sebClientsecret = lmsSetupRecord.sebClientsecret; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.129+01:00", comments="Source field: lms_setup.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.active") public static final SqlColumn active = lmsSetupRecord.active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") public static final class LmsSetupRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordMapper.java index 00be0d4d..0e9ee95a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/LmsSetupRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface LmsSetupRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -62,7 +62,7 @@ public interface LmsSetupRecordMapper { }) LmsSetupRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -79,22 +79,22 @@ public interface LmsSetupRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(lmsSetupRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, lmsSetupRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, lmsSetupRecord) .where(id, isEqualTo(id_)) @@ -102,7 +102,7 @@ public interface LmsSetupRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default int insert(LmsSetupRecord record) { return insert(SqlBuilder.insert(record) .into(lmsSetupRecord) @@ -120,7 +120,7 @@ public interface LmsSetupRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default int insertSelective(LmsSetupRecord record) { return insert(SqlBuilder.insert(record) .into(lmsSetupRecord) @@ -138,19 +138,19 @@ public interface LmsSetupRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) .from(lmsSetupRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) .from(lmsSetupRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default LmsSetupRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) .from(lmsSetupRecord) @@ -159,7 +159,7 @@ public interface LmsSetupRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default UpdateDSL> updateByExample(LmsSetupRecord record) { return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -174,7 +174,7 @@ public interface LmsSetupRecordMapper { .set(active).equalTo(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default UpdateDSL> updateByExampleSelective(LmsSetupRecord record) { return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) @@ -189,7 +189,7 @@ public interface LmsSetupRecordMapper { .set(active).equalToWhenPresent(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default int updateByPrimaryKey(LmsSetupRecord record) { return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -207,7 +207,7 @@ public interface LmsSetupRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") default int updateByPrimaryKeySelective(LmsSetupRecord record) { return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordDynamicSqlSupport.java index c1ea5295..1ea8417d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordDynamicSqlSupport.java @@ -6,37 +6,37 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class OrientationRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") public static final OrientationRecord orientationRecord = new OrientationRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.id") public static final SqlColumn id = orientationRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.config_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.config_attribute_id") public static final SqlColumn configAttributeId = orientationRecord.configAttributeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.template") public static final SqlColumn template = orientationRecord.template; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.view") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.view") public static final SqlColumn view = orientationRecord.view; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.group") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.group") public static final SqlColumn group = orientationRecord.group; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.x_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.x_position") public static final SqlColumn xPosition = orientationRecord.xPosition; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.y_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.y_position") public static final SqlColumn yPosition = orientationRecord.yPosition; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.width") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.width") public static final SqlColumn width = orientationRecord.width; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.height") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.height") public static final SqlColumn height = orientationRecord.height; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") public static final class OrientationRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordMapper.java index 524956b7..5973e336 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/OrientationRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface OrientationRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -60,7 +60,7 @@ public interface OrientationRecordMapper { }) OrientationRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -75,22 +75,22 @@ public interface OrientationRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(orientationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord) .where(id, isEqualTo(id_)) @@ -98,7 +98,7 @@ public interface OrientationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default int insert(OrientationRecord record) { return insert(SqlBuilder.insert(record) .into(orientationRecord) @@ -114,7 +114,7 @@ public interface OrientationRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default int insertSelective(OrientationRecord record) { return insert(SqlBuilder.insert(record) .into(orientationRecord) @@ -130,19 +130,19 @@ public interface OrientationRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) .from(orientationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) .from(orientationRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default OrientationRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) .from(orientationRecord) @@ -151,7 +151,7 @@ public interface OrientationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default UpdateDSL> updateByExample(OrientationRecord record) { return UpdateDSL.updateWithMapper(this::update, orientationRecord) .set(configAttributeId).equalTo(record::getConfigAttributeId) @@ -164,7 +164,7 @@ public interface OrientationRecordMapper { .set(height).equalTo(record::getHeight); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default UpdateDSL> updateByExampleSelective(OrientationRecord record) { return UpdateDSL.updateWithMapper(this::update, orientationRecord) .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) @@ -177,7 +177,7 @@ public interface OrientationRecordMapper { .set(height).equalToWhenPresent(record::getHeight); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default int updateByPrimaryKey(OrientationRecord record) { return UpdateDSL.updateWithMapper(this::update, orientationRecord) .set(configAttributeId).equalTo(record::getConfigAttributeId) @@ -193,7 +193,7 @@ public interface OrientationRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") default int updateByPrimaryKeySelective(OrientationRecord record) { return UpdateDSL.updateWithMapper(this::update, orientationRecord) .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordDynamicSqlSupport.java index bafb9df2..64a66b41 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordDynamicSqlSupport.java @@ -6,19 +6,19 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class RoleRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") public static final RoleRecord roleRecord = new RoleRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.id") public static final SqlColumn id = roleRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.user_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.user_id") public static final SqlColumn userId = roleRecord.userId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.role_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.role_name") public static final SqlColumn roleName = roleRecord.roleName; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") public static final class RoleRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordMapper.java index 50629845..7dfa4702 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/RoleRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface RoleRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -54,7 +54,7 @@ public interface RoleRecordMapper { }) RoleRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -63,22 +63,22 @@ public interface RoleRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(roleRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord) .where(id, isEqualTo(id_)) @@ -86,7 +86,7 @@ public interface RoleRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default int insert(RoleRecord record) { return insert(SqlBuilder.insert(record) .into(roleRecord) @@ -96,7 +96,7 @@ public interface RoleRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default int insertSelective(RoleRecord record) { return insert(SqlBuilder.insert(record) .into(roleRecord) @@ -106,19 +106,19 @@ public interface RoleRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, userId, roleName) .from(roleRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userId, roleName) .from(roleRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default RoleRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, userId, roleName) .from(roleRecord) @@ -127,21 +127,21 @@ public interface RoleRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default UpdateDSL> updateByExample(RoleRecord record) { return UpdateDSL.updateWithMapper(this::update, roleRecord) .set(userId).equalTo(record::getUserId) .set(roleName).equalTo(record::getRoleName); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default UpdateDSL> updateByExampleSelective(RoleRecord record) { return UpdateDSL.updateWithMapper(this::update, roleRecord) .set(userId).equalToWhenPresent(record::getUserId) .set(roleName).equalToWhenPresent(record::getRoleName); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default int updateByPrimaryKey(RoleRecord record) { return UpdateDSL.updateWithMapper(this::update, roleRecord) .set(userId).equalTo(record::getUserId) @@ -151,7 +151,7 @@ public interface RoleRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") default int updateByPrimaryKeySelective(RoleRecord record) { return UpdateDSL.updateWithMapper(this::update, roleRecord) .set(userId).equalToWhenPresent(record::getUserId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordDynamicSqlSupport.java index 2bb7f967..1553e552 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordDynamicSqlSupport.java @@ -7,22 +7,22 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class ThresholdRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: threshold") public static final ThresholdRecord thresholdRecord = new ThresholdRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.id") public static final SqlColumn id = thresholdRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.indicator_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.indicator_id") public static final SqlColumn indicatorId = thresholdRecord.indicatorId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.value") public static final SqlColumn value = thresholdRecord.value; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.color") public static final SqlColumn color = thresholdRecord.color; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: threshold") public static final class ThresholdRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordMapper.java index 40312ce2..2c162225 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/ThresholdRecordMapper.java @@ -33,20 +33,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface ThresholdRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -56,7 +56,7 @@ public interface ThresholdRecordMapper { }) ThresholdRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -66,22 +66,22 @@ public interface ThresholdRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(thresholdRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, thresholdRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, thresholdRecord) .where(id, isEqualTo(id_)) @@ -89,7 +89,7 @@ public interface ThresholdRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default int insert(ThresholdRecord record) { return insert(SqlBuilder.insert(record) .into(thresholdRecord) @@ -100,7 +100,7 @@ public interface ThresholdRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default int insertSelective(ThresholdRecord record) { return insert(SqlBuilder.insert(record) .into(thresholdRecord) @@ -111,19 +111,19 @@ public interface ThresholdRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, indicatorId, value, color) .from(thresholdRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, indicatorId, value, color) .from(thresholdRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default ThresholdRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, indicatorId, value, color) .from(thresholdRecord) @@ -132,7 +132,7 @@ public interface ThresholdRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default UpdateDSL> updateByExample(ThresholdRecord record) { return UpdateDSL.updateWithMapper(this::update, thresholdRecord) .set(indicatorId).equalTo(record::getIndicatorId) @@ -140,7 +140,7 @@ public interface ThresholdRecordMapper { .set(color).equalTo(record::getColor); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default UpdateDSL> updateByExampleSelective(ThresholdRecord record) { return UpdateDSL.updateWithMapper(this::update, thresholdRecord) .set(indicatorId).equalToWhenPresent(record::getIndicatorId) @@ -148,7 +148,7 @@ public interface ThresholdRecordMapper { .set(color).equalToWhenPresent(record::getColor); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default int updateByPrimaryKey(ThresholdRecord record) { return UpdateDSL.updateWithMapper(this::update, thresholdRecord) .set(indicatorId).equalTo(record::getIndicatorId) @@ -159,7 +159,7 @@ public interface ThresholdRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.553+01:00", comments="Source Table: threshold") default int updateByPrimaryKeySelective(ThresholdRecord record) { return UpdateDSL.updateWithMapper(this::update, thresholdRecord) .set(indicatorId).equalToWhenPresent(record::getIndicatorId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordDynamicSqlSupport.java index 4412a272..c33cd2d6 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordDynamicSqlSupport.java @@ -6,31 +6,31 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class UserActivityLogRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_activity_log") public static final UserActivityLogRecord userActivityLogRecord = new UserActivityLogRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.id") public static final SqlColumn id = userActivityLogRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.user_uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.user_uuid") public static final SqlColumn userUuid = userActivityLogRecord.userUuid; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.timestamp") public static final SqlColumn timestamp = userActivityLogRecord.timestamp; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.activity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.activity_type") public static final SqlColumn activityType = userActivityLogRecord.activityType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source field: user_activity_log.entity_type") public static final SqlColumn entityType = userActivityLogRecord.entityType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source field: user_activity_log.entity_id") public static final SqlColumn entityId = userActivityLogRecord.entityId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.message") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source field: user_activity_log.message") public static final SqlColumn message = userActivityLogRecord.message; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_activity_log") public static final class UserActivityLogRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordMapper.java index 624e3eb3..79d78f01 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserActivityLogRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface UserActivityLogRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -58,7 +58,7 @@ public interface UserActivityLogRecordMapper { }) UserActivityLogRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -71,22 +71,22 @@ public interface UserActivityLogRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(userActivityLogRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, userActivityLogRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, userActivityLogRecord) .where(id, isEqualTo(id_)) @@ -94,7 +94,7 @@ public interface UserActivityLogRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default int insert(UserActivityLogRecord record) { return insert(SqlBuilder.insert(record) .into(userActivityLogRecord) @@ -108,7 +108,7 @@ public interface UserActivityLogRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default int insertSelective(UserActivityLogRecord record) { return insert(SqlBuilder.insert(record) .into(userActivityLogRecord) @@ -122,19 +122,19 @@ public interface UserActivityLogRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message) .from(userActivityLogRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message) .from(userActivityLogRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default UserActivityLogRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, userUuid, timestamp, activityType, entityType, entityId, message) .from(userActivityLogRecord) @@ -143,7 +143,7 @@ public interface UserActivityLogRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default UpdateDSL> updateByExample(UserActivityLogRecord record) { return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) .set(userUuid).equalTo(record::getUserUuid) @@ -154,7 +154,7 @@ public interface UserActivityLogRecordMapper { .set(message).equalTo(record::getMessage); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default UpdateDSL> updateByExampleSelective(UserActivityLogRecord record) { return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) .set(userUuid).equalToWhenPresent(record::getUserUuid) @@ -165,7 +165,7 @@ public interface UserActivityLogRecordMapper { .set(message).equalToWhenPresent(record::getMessage); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.162+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default int updateByPrimaryKey(UserActivityLogRecord record) { return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) .set(userUuid).equalTo(record::getUserUuid) @@ -179,7 +179,7 @@ public interface UserActivityLogRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.162+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.599+01:00", comments="Source Table: user_activity_log") default int updateByPrimaryKeySelective(UserActivityLogRecord record) { return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) .set(userUuid).equalToWhenPresent(record::getUserUuid) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordDynamicSqlSupport.java index 25568a3f..d8cacabe 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordDynamicSqlSupport.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordDynamicSqlSupport.java @@ -6,40 +6,40 @@ import org.mybatis.dynamic.sql.SqlColumn; import org.mybatis.dynamic.sql.SqlTable; public final class UserRecordDynamicSqlSupport { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") public static final UserRecord userRecord = new UserRecord(); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.id") public static final SqlColumn id = userRecord.id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.institution_id") public static final SqlColumn institutionId = userRecord.institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.uuid") public static final SqlColumn uuid = userRecord.uuid; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.name") public static final SqlColumn name = userRecord.name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.username") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.username") public static final SqlColumn username = userRecord.username; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.password") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.password") public static final SqlColumn password = userRecord.password; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.email") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.email") public static final SqlColumn email = userRecord.email; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.locale") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.locale") public static final SqlColumn locale = userRecord.locale; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.timezone") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.timezone") public static final SqlColumn timezone = userRecord.timezone; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.active") public static final SqlColumn active = userRecord.active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") public static final class UserRecord extends SqlTable { public final SqlColumn id = column("id", JDBCType.BIGINT); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordMapper.java index c2491749..f36a0b5c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/mapper/UserRecordMapper.java @@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter; @Mapper public interface UserRecordMapper { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @SelectProvider(type=SqlProviderAdapter.class, method="select") long count(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @DeleteProvider(type=SqlProviderAdapter.class, method="delete") int delete(DeleteStatementProvider deleteStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @InsertProvider(type=SqlProviderAdapter.class, method="insert") @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) int insert(InsertStatementProvider insertStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -61,7 +61,7 @@ public interface UserRecordMapper { }) UserRecord selectOne(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @SelectProvider(type=SqlProviderAdapter.class, method="select") @ConstructorArgs({ @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @@ -77,22 +77,22 @@ public interface UserRecordMapper { }) List selectMany(SelectStatementProvider selectStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") @UpdateProvider(type=SqlProviderAdapter.class, method="update") int update(UpdateStatementProvider updateStatement); - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default QueryExpressionDSL> countByExample() { return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) .from(userRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default DeleteDSL> deleteByExample() { return DeleteDSL.deleteFromWithMapper(this::delete, userRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default int deleteByPrimaryKey(Long id_) { return DeleteDSL.deleteFromWithMapper(this::delete, userRecord) .where(id, isEqualTo(id_)) @@ -100,7 +100,7 @@ public interface UserRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default int insert(UserRecord record) { return insert(SqlBuilder.insert(record) .into(userRecord) @@ -117,7 +117,7 @@ public interface UserRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default int insertSelective(UserRecord record) { return insert(SqlBuilder.insert(record) .into(userRecord) @@ -134,19 +134,19 @@ public interface UserRecordMapper { .render(RenderingStrategy.MYBATIS3)); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default QueryExpressionDSL>> selectByExample() { return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active) .from(userRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default QueryExpressionDSL>> selectDistinctByExample() { return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active) .from(userRecord); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default UserRecord selectByPrimaryKey(Long id_) { return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, uuid, name, username, password, email, locale, timezone, active) .from(userRecord) @@ -155,7 +155,7 @@ public interface UserRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default UpdateDSL> updateByExample(UserRecord record) { return UpdateDSL.updateWithMapper(this::update, userRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -169,7 +169,7 @@ public interface UserRecordMapper { .set(active).equalTo(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default UpdateDSL> updateByExampleSelective(UserRecord record) { return UpdateDSL.updateWithMapper(this::update, userRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) @@ -183,7 +183,7 @@ public interface UserRecordMapper { .set(active).equalToWhenPresent(record::getActive); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default int updateByPrimaryKey(UserRecord record) { return UpdateDSL.updateWithMapper(this::update, userRecord) .set(institutionId).equalTo(record::getInstitutionId) @@ -200,7 +200,7 @@ public interface UserRecordMapper { .execute(); } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") default int updateByPrimaryKeySelective(UserRecord record) { return UpdateDSL.updateWithMapper(this::update, userRecord) .set(institutionId).equalToWhenPresent(record::getInstitutionId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientConnectionRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientConnectionRecord.java index 818d8ca3..163d5df5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientConnectionRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientConnectionRecord.java @@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ClientConnectionRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.exam_id") private Long examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.status") private String status; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.connection_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.connection_token") private String connectionToken; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.user_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.user_name") private String userName; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.vdi") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.vdi") private Boolean vdi; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.client_address") private String clientAddress; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.virtual_client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.virtual_client_address") private String virtualClientAddress; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source Table: client_connection") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: client_connection") public ClientConnectionRecord(Long id, Long examId, String status, String connectionToken, String userName, Boolean vdi, String clientAddress, String virtualClientAddress) { this.id = id; this.examId = examId; @@ -39,42 +39,42 @@ public class ClientConnectionRecord { this.virtualClientAddress = virtualClientAddress; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.exam_id") public Long getExamId() { return examId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: client_connection.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.status") public String getStatus() { return status; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.connection_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.connection_token") public String getConnectionToken() { return connectionToken; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.user_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.user_name") public String getUserName() { return userName; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.vdi") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.vdi") public Boolean getVdi() { return vdi; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.client_address") public String getClientAddress() { return clientAddress; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_connection.virtual_client_address") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_connection.virtual_client_address") public String getVirtualClientAddress() { return virtualClientAddress; } @@ -83,7 +83,7 @@ public class ClientConnectionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_connection * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -107,7 +107,7 @@ public class ClientConnectionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_connection * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -135,7 +135,7 @@ public class ClientConnectionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_connection * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientEventRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientEventRecord.java index aa737880..713b2746 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientEventRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ClientEventRecord.java @@ -4,28 +4,28 @@ import java.math.BigDecimal; import javax.annotation.Generated; public class ClientEventRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.connection_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.connection_id") private Long connectionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.user_identifier") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.user_identifier") private String userIdentifier; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.type") private Integer type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.timestamp") private Long timestamp; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.numeric_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.numeric_value") private BigDecimal numericValue; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.text") private String text; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: client_event") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: client_event") public ClientEventRecord(Long id, Long connectionId, String userIdentifier, Integer type, Long timestamp, BigDecimal numericValue, String text) { this.id = id; this.connectionId = connectionId; @@ -36,37 +36,37 @@ public class ClientEventRecord { this.text = text; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.connection_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.connection_id") public Long getConnectionId() { return connectionId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.user_identifier") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.user_identifier") public String getUserIdentifier() { return userIdentifier; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.type") public Integer getType() { return type; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.timestamp") public Long getTimestamp() { return timestamp; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.numeric_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.numeric_value") public BigDecimal getNumericValue() { return numericValue; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: client_event.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: client_event.text") public String getText() { return text; } @@ -75,7 +75,7 @@ public class ClientEventRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_event * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -98,7 +98,7 @@ public class ClientEventRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_event * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -125,7 +125,7 @@ public class ClientEventRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table client_event * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationAttributeRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationAttributeRecord.java index f2c282d2..049ae68c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationAttributeRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationAttributeRecord.java @@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ConfigurationAttributeRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.873+01:00", comments="Source field: configuration_attribute.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.874+01:00", comments="Source field: configuration_attribute.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.874+01:00", comments="Source field: configuration_attribute.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.type") private String type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.parent_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.parent_id") private Long parentId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.resources") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.resources") private String resources; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.validator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.validator") private String validator; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.dependencies") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.dependencies") private String dependencies; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.default_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.default_value") private String defaultValue; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.867+01:00", comments="Source Table: configuration_attribute") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source Table: configuration_attribute") public ConfigurationAttributeRecord(Long id, String name, String type, Long parentId, String resources, String validator, String dependencies, String defaultValue) { this.id = id; this.name = name; @@ -39,42 +39,42 @@ public class ConfigurationAttributeRecord { this.defaultValue = defaultValue; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.874+01:00", comments="Source field: configuration_attribute.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.874+01:00", comments="Source field: configuration_attribute.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.874+01:00", comments="Source field: configuration_attribute.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.type") public String getType() { return type; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.parent_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.parent_id") public Long getParentId() { return parentId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.resources") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.resources") public String getResources() { return resources; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.validator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.validator") public String getValidator() { return validator; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.dependencies") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.dependencies") public String getDependencies() { return dependencies; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:16.875+01:00", comments="Source field: configuration_attribute.default_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.303+01:00", comments="Source field: configuration_attribute.default_value") public String getDefaultValue() { return defaultValue; } @@ -83,7 +83,7 @@ public class ConfigurationAttributeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_attribute * - * @mbg.generated Mon Jan 21 16:09:16 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -107,7 +107,7 @@ public class ConfigurationAttributeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_attribute * - * @mbg.generated Mon Jan 21 16:09:16 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -135,7 +135,7 @@ public class ConfigurationAttributeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_attribute * - * @mbg.generated Mon Jan 21 16:09:16 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationNodeRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationNodeRecord.java index 95cfd5ec..1daef315 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationNodeRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationNodeRecord.java @@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ConfigurationNodeRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_node.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_node.institution_id") private Long institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.owner") private String owner; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.description") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.description") private String description; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.type") private String type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.template") private String template; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.active") private Integer active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration_node") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration_node") public ConfigurationNodeRecord(Long id, Long institutionId, String owner, String name, String description, String type, String template, Integer active) { this.id = id; this.institutionId = institutionId; @@ -39,42 +39,42 @@ public class ConfigurationNodeRecord { this.active = active; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_node.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_node.institution_id") public Long getInstitutionId() { return institutionId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.owner") public String getOwner() { return owner; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.description") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.description") public String getDescription() { return description; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.type") public String getType() { return type; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.template") public String getTemplate() { return template; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration_node.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: configuration_node.active") public Integer getActive() { return active; } @@ -83,7 +83,7 @@ public class ConfigurationNodeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_node * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -107,7 +107,7 @@ public class ConfigurationNodeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_node * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -135,7 +135,7 @@ public class ConfigurationNodeRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_node * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationRecord.java index 1664419a..ae648fb4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationRecord.java @@ -4,22 +4,22 @@ import javax.annotation.Generated; import org.joda.time.DateTime; public class ConfigurationRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.configuration_node_id") private Long configurationNodeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version") private String version; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version_date") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version_date") private DateTime versionDate; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.followup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.followup") private Integer followup; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source Table: configuration") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: configuration") public ConfigurationRecord(Long id, Long configurationNodeId, String version, DateTime versionDate, Integer followup) { this.id = id; this.configurationNodeId = configurationNodeId; @@ -28,27 +28,27 @@ public class ConfigurationRecord { this.followup = followup; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.configuration_node_id") public Long getConfigurationNodeId() { return configurationNodeId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version") public String getVersion() { return version; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.version_date") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.version_date") public DateTime getVersionDate() { return versionDate; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.046+01:00", comments="Source field: configuration.followup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration.followup") public Integer getFollowup() { return followup; } @@ -57,7 +57,7 @@ public class ConfigurationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -78,7 +78,7 @@ public class ConfigurationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -103,7 +103,7 @@ public class ConfigurationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationValueRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationValueRecord.java index a8c53779..bee00ad1 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationValueRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ConfigurationValueRecord.java @@ -3,25 +3,25 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ConfigurationValueRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source field: configuration_value.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source field: configuration_value.configuration_id") private Long configurationId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source field: configuration_value.configuration_attribute_id") private Long configurationAttributeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.list_index") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.list_index") private Integer listIndex; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.value") private String value; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.text") private String text; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: configuration_value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source Table: configuration_value") public ConfigurationValueRecord(Long id, Long configurationId, Long configurationAttributeId, Integer listIndex, String value, String text) { this.id = id; this.configurationId = configurationId; @@ -31,32 +31,32 @@ public class ConfigurationValueRecord { this.text = text; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source field: configuration_value.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.490+01:00", comments="Source field: configuration_value.configuration_id") public Long getConfigurationId() { return configurationId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.configuration_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.configuration_attribute_id") public Long getConfigurationAttributeId() { return configurationAttributeId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.list_index") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.list_index") public Integer getListIndex() { return listIndex; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.value") public String getValue() { return value; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: configuration_value.text") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: configuration_value.text") public String getText() { return text; } @@ -65,7 +65,7 @@ public class ConfigurationValueRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_value * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -87,7 +87,7 @@ public class ConfigurationValueRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_value * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -113,7 +113,7 @@ public class ConfigurationValueRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table configuration_value * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamConfigurationMapRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamConfigurationMapRecord.java index e8517ee5..32985f11 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamConfigurationMapRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamConfigurationMapRecord.java @@ -3,19 +3,19 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ExamConfigurationMapRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.exam_id") private Long examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.configuration_node_id") private Long configurationNodeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.user_names") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.user_names") private String userNames; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam_configuration_map") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam_configuration_map") public ExamConfigurationMapRecord(Long id, Long examId, Long configurationNodeId, String userNames) { this.id = id; this.examId = examId; @@ -23,22 +23,22 @@ public class ExamConfigurationMapRecord { this.userNames = userNames; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.exam_id") public Long getExamId() { return examId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.configuration_node_id") public Long getConfigurationNodeId() { return configurationNodeId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam_configuration_map.user_names") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam_configuration_map.user_names") public String getUserNames() { return userNames; } @@ -47,7 +47,7 @@ public class ExamConfigurationMapRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam_configuration_map * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -67,7 +67,7 @@ public class ExamConfigurationMapRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam_configuration_map * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -91,7 +91,7 @@ public class ExamConfigurationMapRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam_configuration_map * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamRecord.java index ade7febb..52fa63a0 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ExamRecord.java @@ -3,34 +3,34 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class ExamRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.institution_id") private Long institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.lms_setup_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.lms_setup_id") private Long lmsSetupId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.external_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.external_id") private String externalId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.owner") private String owner; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.supporter") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.supporter") private String supporter; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.type") private String type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.status") private String status; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.active") private Integer active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source Table: exam") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source Table: exam") public ExamRecord(Long id, Long institutionId, Long lmsSetupId, String externalId, String owner, String supporter, String type, String status, Integer active) { this.id = id; this.institutionId = institutionId; @@ -43,47 +43,47 @@ public class ExamRecord { this.active = active; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.institution_id") public Long getInstitutionId() { return institutionId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.062+01:00", comments="Source field: exam.lms_setup_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.lms_setup_id") public Long getLmsSetupId() { return lmsSetupId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.external_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.external_id") public String getExternalId() { return externalId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.owner") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.owner") public String getOwner() { return owner; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.supporter") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.supporter") public String getSupporter() { return supporter; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.type") public String getType() { return type; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.status") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.status") public String getStatus() { return status; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.078+01:00", comments="Source field: exam.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.521+01:00", comments="Source field: exam.active") public Integer getActive() { return active; } @@ -92,7 +92,7 @@ public class ExamRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -117,7 +117,7 @@ public class ExamRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -146,7 +146,7 @@ public class ExamRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table exam * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/IndicatorRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/IndicatorRecord.java index ea488bb9..7c91acc8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/IndicatorRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/IndicatorRecord.java @@ -3,22 +3,22 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class IndicatorRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.exam_id") private Long examId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.type") private String type; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.color") private String color; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source Table: indicator") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: indicator") public IndicatorRecord(Long id, Long examId, String type, String name, String color) { this.id = id; this.examId = examId; @@ -27,27 +27,27 @@ public class IndicatorRecord { this.color = color; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.exam_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.exam_id") public Long getExamId() { return examId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.type") public String getType() { return type; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.093+01:00", comments="Source field: indicator.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: indicator.color") public String getColor() { return color; } @@ -56,7 +56,7 @@ public class IndicatorRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table indicator * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -77,7 +77,7 @@ public class IndicatorRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table indicator * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -102,7 +102,7 @@ public class IndicatorRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table indicator * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/InstitutionRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/InstitutionRecord.java index 91c74d81..7e276335 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/InstitutionRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/InstitutionRecord.java @@ -3,22 +3,22 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class InstitutionRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.url_suffix") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.url_suffix") private String urlSuffix; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.active") private Integer active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.logo_image") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.logo_image") private String logoImage; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: institution") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: institution") public InstitutionRecord(Long id, String name, String urlSuffix, Integer active, String logoImage) { this.id = id; this.name = name; @@ -27,27 +27,27 @@ public class InstitutionRecord { this.logoImage = logoImage; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.url_suffix") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.url_suffix") public String getUrlSuffix() { return urlSuffix; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.active") public Integer getActive() { return active; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: institution.logo_image") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: institution.logo_image") public String getLogoImage() { return logoImage; } @@ -56,7 +56,7 @@ public class InstitutionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table institution * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -77,7 +77,7 @@ public class InstitutionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table institution * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -102,7 +102,7 @@ public class InstitutionRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table institution * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/LmsSetupRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/LmsSetupRecord.java index c0f74278..f3b040a4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/LmsSetupRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/LmsSetupRecord.java @@ -3,40 +3,40 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class LmsSetupRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.institution_id") private Long institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_type") private String lmsType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_url") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_url") private String lmsUrl; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientname") private String lmsClientname; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientsecret") private String lmsClientsecret; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_rest_api_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_rest_api_token") private String lmsRestApiToken; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.seb_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientname") private String sebClientname; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.seb_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientsecret") private String sebClientsecret; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.active") private Integer active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: lms_setup") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source Table: lms_setup") public LmsSetupRecord(Long id, Long institutionId, String name, String lmsType, String lmsUrl, String lmsClientname, String lmsClientsecret, String lmsRestApiToken, String sebClientname, String sebClientsecret, Integer active) { this.id = id; this.institutionId = institutionId; @@ -51,57 +51,57 @@ public class LmsSetupRecord { this.active = active; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.institution_id") public Long getInstitutionId() { return institutionId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_type") public String getLmsType() { return lmsType; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_url") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_url") public String getLmsUrl() { return lmsUrl; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientname") public String getLmsClientname() { return lmsClientname; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_clientsecret") public String getLmsClientsecret() { return lmsClientsecret; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.lms_rest_api_token") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.lms_rest_api_token") public String getLmsRestApiToken() { return lmsRestApiToken; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.seb_clientname") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientname") public String getSebClientname() { return sebClientname; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.seb_clientsecret") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.seb_clientsecret") public String getSebClientsecret() { return sebClientsecret; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: lms_setup.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.568+01:00", comments="Source field: lms_setup.active") public Integer getActive() { return active; } @@ -110,7 +110,7 @@ public class LmsSetupRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table lms_setup * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -137,7 +137,7 @@ public class LmsSetupRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table lms_setup * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -168,7 +168,7 @@ public class LmsSetupRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table lms_setup * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/OrientationRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/OrientationRecord.java index edb733f3..4deace15 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/OrientationRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/OrientationRecord.java @@ -3,34 +3,34 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class OrientationRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.config_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.config_attribute_id") private Long configAttributeId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.template") private String template; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.view") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.view") private String view; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.group") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.group") private String group; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.x_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.x_position") private Integer xPosition; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.y_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.y_position") private Integer yPosition; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.width") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.width") private Integer width; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.height") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.height") private Integer height; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source Table: orientation") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source Table: orientation") public OrientationRecord(Long id, Long configAttributeId, String template, String view, String group, Integer xPosition, Integer yPosition, Integer width, Integer height) { this.id = id; this.configAttributeId = configAttributeId; @@ -43,47 +43,47 @@ public class OrientationRecord { this.height = height; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.config_attribute_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.config_attribute_id") public Long getConfigAttributeId() { return configAttributeId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.template") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.template") public String getTemplate() { return template; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.view") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.view") public String getView() { return view; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.group") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.group") public String getGroup() { return group; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.x_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.x_position") public Integer getxPosition() { return xPosition; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.y_position") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.y_position") public Integer getyPosition() { return yPosition; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.width") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.width") public Integer getWidth() { return width; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.031+01:00", comments="Source field: orientation.height") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.506+01:00", comments="Source field: orientation.height") public Integer getHeight() { return height; } @@ -92,7 +92,7 @@ public class OrientationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table orientation * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -117,7 +117,7 @@ public class OrientationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table orientation * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -146,7 +146,7 @@ public class OrientationRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table orientation * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/RoleRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/RoleRecord.java index f07f1c00..80c79006 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/RoleRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/RoleRecord.java @@ -3,33 +3,33 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class RoleRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.user_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.user_id") private Long userId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.role_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.role_name") private String roleName; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_role") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_role") public RoleRecord(Long id, Long userId, String roleName) { this.id = id; this.userId = userId; this.roleName = roleName; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.user_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.user_id") public Long getUserId() { return userId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_role.role_name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_role.role_name") public String getRoleName() { return roleName; } @@ -38,7 +38,7 @@ public class RoleRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_role * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -57,7 +57,7 @@ public class RoleRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_role * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -80,7 +80,7 @@ public class RoleRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_role * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ThresholdRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ThresholdRecord.java index f2d0e4fe..5496f311 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ThresholdRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/ThresholdRecord.java @@ -4,19 +4,19 @@ import java.math.BigDecimal; import javax.annotation.Generated; public class ThresholdRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.indicator_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.indicator_id") private Long indicatorId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.value") private BigDecimal value; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.color") private String color; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source Table: threshold") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source Table: threshold") public ThresholdRecord(Long id, Long indicatorId, BigDecimal value, String color) { this.id = id; this.indicatorId = indicatorId; @@ -24,22 +24,22 @@ public class ThresholdRecord { this.color = color; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.indicator_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.indicator_id") public Long getIndicatorId() { return indicatorId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.value") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.value") public BigDecimal getValue() { return value; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.109+01:00", comments="Source field: threshold.color") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.537+01:00", comments="Source field: threshold.color") public String getColor() { return color; } @@ -48,7 +48,7 @@ public class ThresholdRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table threshold * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -68,7 +68,7 @@ public class ThresholdRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table threshold * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -92,7 +92,7 @@ public class ThresholdRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table threshold * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserActivityLogRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserActivityLogRecord.java index a01b093c..3afcefde 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserActivityLogRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserActivityLogRecord.java @@ -3,28 +3,28 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class UserActivityLogRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.user_uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.user_uuid") private String userUuid; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.timestamp") private Long timestamp; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.activity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.activity_type") private String activityType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.entity_type") private String entityType; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.entity_id") private String entityId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.message") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.message") private String message; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source Table: user_activity_log") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user_activity_log") public UserActivityLogRecord(Long id, String userUuid, Long timestamp, String activityType, String entityType, String entityId, String message) { this.id = id; this.userUuid = userUuid; @@ -35,37 +35,37 @@ public class UserActivityLogRecord { this.message = message; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.user_uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.user_uuid") public String getUserUuid() { return userUuid; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.timestamp") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.timestamp") public Long getTimestamp() { return timestamp; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.activity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.activity_type") public String getActivityType() { return activityType; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_type") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.entity_type") public String getEntityType() { return entityType; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.entity_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.entity_id") public String getEntityId() { return entityId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.147+01:00", comments="Source field: user_activity_log.message") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user_activity_log.message") public String getMessage() { return message; } @@ -74,7 +74,7 @@ public class UserActivityLogRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_activity_log * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -97,7 +97,7 @@ public class UserActivityLogRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_activity_log * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -124,7 +124,7 @@ public class UserActivityLogRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user_activity_log * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserRecord.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserRecord.java index a6d62236..a5cffe56 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserRecord.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/model/UserRecord.java @@ -3,37 +3,37 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model; import javax.annotation.Generated; public class UserRecord { - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.id") private Long id; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.institution_id") private Long institutionId; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.uuid") private String uuid; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.name") private String name; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.username") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.username") private String username; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.password") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.password") private String password; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.email") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.email") private String email; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.locale") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.locale") private String locale; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.timezone") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.timezone") private String timezone; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.active") private Integer active; - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source Table: user") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source Table: user") public UserRecord(Long id, Long institutionId, String uuid, String name, String username, String password, String email, String locale, String timezone, Integer active) { this.id = id; this.institutionId = institutionId; @@ -47,52 +47,52 @@ public class UserRecord { this.active = active; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.id") public Long getId() { return id; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.institution_id") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.institution_id") public Long getInstitutionId() { return institutionId; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.uuid") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.uuid") public String getUuid() { return uuid; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.name") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.name") public String getName() { return name; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.username") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.username") public String getUsername() { return username; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.password") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.password") public String getPassword() { return password; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.email") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.email") public String getEmail() { return email; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.locale") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.locale") public String getLocale() { return locale; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.timezone") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.timezone") public String getTimezone() { return timezone; } - @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-21T16:09:17.131+01:00", comments="Source field: user.active") + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2019-01-24T13:19:09.584+01:00", comments="Source field: user.active") public Integer getActive() { return active; } @@ -101,7 +101,7 @@ public class UserRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public String toString() { @@ -127,7 +127,7 @@ public class UserRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public boolean equals(Object that) { @@ -157,7 +157,7 @@ public class UserRecord { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Mon Jan 21 16:09:17 CET 2019 + * @mbg.generated Thu Jan 24 13:19:09 CET 2019 */ @Override public int hashCode() { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationService.java index 0c9e13be..3e8f0605 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationService.java @@ -25,6 +25,7 @@ import ch.ethz.seb.sebserver.gbl.model.Domain; import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; +import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ExamRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserRecordDynamicSqlSupport; @@ -70,15 +71,17 @@ public class PaginationService { return tableMap.containsKey(orderBy); } - public void setDefaultLimitOfNotSet(final SqlTable table) { + /** Use this to set a page limitation on SQL level. This checks first if there is + * already a page-limitation set for the local thread and if not, set the default page-limitation */ + public void setDefaultLimitIfNotSet() { if (PageHelper.getLocalPage() != null) { return; } - setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, table); + setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, null); } - public void setDefaultLimit(final SqlTable table) { - setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, table); + public void setDefaultLimit() { + setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, null); } public void setDefaultLimit(final String sortBy, final SqlTable table) { @@ -113,29 +116,34 @@ public class PaginationService { final com.github.pagehelper.Page startPage = PageHelper.startPage(getPageNumber(pageNumber), getPageSize(pageSize), true, true, false); - final String sortColumnName = verifySortColumnName(sortBy, table); - if (StringUtils.isNoneBlank(sortColumnName)) { - if (sortOrder == Page.SortOrder.DESCENDING) { - PageHelper.orderBy(sortColumnName + " DESC"); - } else { - PageHelper.orderBy(sortColumnName); + if (table != null) { + final String sortColumnName = verifySortColumnName(sortBy, table); + if (StringUtils.isNoneBlank(sortColumnName)) { + if (sortOrder == Page.SortOrder.DESCENDING) { + PageHelper.orderBy(sortColumnName + " DESC"); + } else { + PageHelper.orderBy(sortColumnName); + } } } return startPage; } - public Page getPage( + public Result> getPage( final Integer pageNumber, final Integer pageSize, final String sortBy, final Page.SortOrder sortOrder, final SqlTable table, - final Supplier> delegate) { + final Supplier>> delegate) { - final com.github.pagehelper.Page page = setPagination(pageNumber, pageSize, sortBy, sortOrder, table); - final Collection pageList = delegate.get(); - return new Page<>(page.getPages(), page.getPageNum(), sortBy, sortOrder, pageList); + return Result.tryCatch(() -> { + final com.github.pagehelper.Page page = + setPagination(pageNumber, pageSize, sortBy, sortOrder, table); + final Collection pageList = delegate.get().getOrThrow(); + return new Page<>(page.getPages(), page.getPageNum(), sortBy, sortOrder, pageList); + }); } private String verifySortColumnName(final String sortBy, final SqlTable table) { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/authorization/GrantEntity.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/authorization/GrantEntity.java index d175b87b..39649676 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/authorization/GrantEntity.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/authorization/GrantEntity.java @@ -8,6 +8,8 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.authorization; +import com.fasterxml.jackson.annotation.JsonIgnore; + import ch.ethz.seb.sebserver.gbl.model.Entity; /** Interface of an entity that needs a grant for access. @@ -18,11 +20,13 @@ public interface GrantEntity extends Entity { * of the institution entity associated within this entity. * * @return The institution association of a GrantEntity */ + @JsonIgnore Long getInstitutionId(); /** The institution association of a GrantEntity. This is the UUID of the owner-user * * @return The institution association of a GrantEntity */ + @JsonIgnore String getOwnerId(); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ActivatableEntityDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ActivatableEntityDAO.java index 0dcf73da..feb2b118 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ActivatableEntityDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ActivatableEntityDAO.java @@ -18,25 +18,33 @@ import ch.ethz.seb.sebserver.gbl.util.Result; /** Interface of a DAO for an Entity that has activation feature. * - * @param the concrete Entity type */ + * @param the type of Entity */ public interface ActivatableEntityDAO extends EntityDAO { + /** Load all active entities of concrete type for the given institution and of given activity + * + * NOTE: institutionId may be null. In that case this method uses a query to get all active entities of + * concrete type from all institutions. Anyways, to not pollute the memory it is recommended to set a limit by + * using the PaginationService before calling this method + * + * @param institutionId the identifier of the institution. + * @param active activity flag: true = all active, false = all inactive, null = all active and inactive + * @return Result of Collection of Entity of the given institution and activity */ Result> all(Long institutionId, Boolean active); - default Result> allOfInstitution(final long institutionId, final Boolean active) { - return all(institutionId, active); - } - + /** Load all active entities of concrete type for the given institution + * + * NOTE: institutionId may be null. In that case this method uses a query to get all active entities of + * concrete type from all institutions. Anyways, to not pollute the memory it is recommended to set a limit by + * using the PaginationService before calling this method + * + * @param institutionId the identifier of the institution. + * @return Result of Collection of Entity of the given institution */ @Override default Result> all(final Long institutionId) { return all(institutionId, true); } - @Override - default Result> allOfInstitution(final long institutionId) { - return all(institutionId, true); - } - /** Set all entities referred by the given Collection of EntityKey active / inactive * * @param all The Collection of EntityKeys to set active or inactive diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/EntityDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/EntityDAO.java index cf33709c..134da7d5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/EntityDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/EntityDAO.java @@ -12,10 +12,9 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.transaction.annotation.Transactional; import ch.ethz.seb.sebserver.gbl.model.Entity; @@ -27,14 +26,12 @@ import ch.ethz.seb.sebserver.gbl.util.Result; public interface EntityDAO { - Logger log = LoggerFactory.getLogger(EntityDAO.class); - /** Get the entity type for a concrete EntityDAO implementation. * * @return The EntityType for a concrete EntityDAO implementation */ EntityType entityType(); - /** Use this to get an Entity instance of concrete type by database identifier + /** Use this to get an Entity instance of concrete type by database identifier/primary-key (PK) * * @param id the data base identifier of the entity * @return Result refer the Entity instance with the specified database identifier or refer to an error if @@ -49,38 +46,23 @@ public interface EntityDAO { * @param id the model identifier * @return Result refer the Entity instance with the specified model identifier or refer to an error if * happened */ + @Transactional(readOnly = true) default Result byModelId(final String id) { return Result.tryCatch(() -> { return Long.parseLong(id); }).flatMap(this::byPK); } - /** Use this to get a Collection of all entities of concrete type that matches a given predicate. + /** Use this to get a Collection of all entities of concrete type of the given institution. * - * NOTE: This first gets all records from database, for each creates new Entity instance and then - * tests then matching predicate. So predicate filtering is not really fast - * If you need a fast filtering implement a specific filtering in SQL level + * NOTE: institutionId may be null. In that case this method uses a query to get all entities of + * concrete type from all institutions. Anyways, to not pollute the memory it is recommended to set a limit by + * using the PaginationService before calling this method * - * @param predicate Predicate expecting instance of type specific entity type - * @param - * @param active indicates if only active entities should be included (on SQL level). Can be null. - * @return Result of Collection of Entity that matches a given predicate. Or an exception result on error - * case */ + * @param institutionId the identifier of the institution. + * @return Result of Collection of Entity of the given institution */ Result> all(Long institutionId); - /** Use this to get a Collection of all entities of concrete type that matches a given predicate. - * - * NOTE: This first gets all records from database, for each creates new Entity instance and then - * tests then matching predicate. So predicate filtering is not really fast - * If you need a fast filtering implement a specific filtering in SQL level - * - * @param predicate Predicate expecting instance of type specific entity type - * @return Result of Collection of Entity that matches a given predicate. Or an exception result on error - * case */ - default Result> allOfInstitution(final long institutionId) { - return all(institutionId); - } - Result> loadEntities(Collection keys); @Transactional(readOnly = true) @@ -114,6 +96,13 @@ public interface EntityDAO { * happened */ Result> delete(Set all); + @Transactional(readOnly = true) + default Result> allMatching(final FilterMap filterMap) { + return allMatching(filterMap, e -> true); + } + + Result> allMatching(FilterMap filterMap, Predicate predicate); + /** Context based utility method to extract an expected single resource entry form a Collection of specified type. * Gets a Result refer to an expected single resource entry form a Collection of specified type or refer * to a ResourceNotFoundException if specified collection is null or empty or refer to a diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java index e5ce545c..dcec75f7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java @@ -8,29 +8,13 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao; -import java.util.Collection; - -import org.joda.time.DateTime; - import ch.ethz.seb.sebserver.gbl.model.exam.Exam; -import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; -import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO; public interface ExamDAO extends ActivatableEntityDAO, BulkActionSupportDAO { - Result importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData); - - Result byQuizId(String quizId); - - Result> allMatching( - Long institutionId, - Long lmsSetupId, - String name, - Exam.ExamStatus status, - Exam.ExamType type, - DateTime from, - String owner, - Boolean active); +// Result importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData); +// +// Result byQuizId(String quizId); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java new file mode 100644 index 00000000..30c9d2f6 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.servicelayer.dao; + +import java.util.Locale; +import java.util.Map; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.LocaleUtils; +import org.joda.time.DateTime; + +import ch.ethz.seb.sebserver.gbl.model.exam.Exam; +import ch.ethz.seb.sebserver.gbl.model.exam.Indicator; +import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup; +import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; +import ch.ethz.seb.sebserver.gbl.util.Utils; +import ch.ethz.seb.sebserver.webservice.datalayer.batis.JodaTimeTypeResolver; + +public class FilterMap { + + public final Map params; + + public FilterMap(final Map params) { + super(); + this.params = Utils.immutableMapOf(params); + } + + public Integer getActiveAsInt() { + return getBooleanAsInteger(UserInfo.FILTER_ATTR_ACTIVE); + } + + public Long getInstitutionId() { + return getLong(UserInfo.FILTER_ATTR_INSTITUTION); + } + + public String getName() { + return getSQLWildcard(UserInfo.FILTER_ATTR_NAME); + } + + public String getUserUsername() { + return getSQLWildcard(UserInfo.FILTER_ATTR_USER_NAME); + } + + public String getUserEmail() { + return getSQLWildcard(UserInfo.FILTER_ATTR_EMAIL); + } + + public String getUserLocale() { + return getString(UserInfo.FILTER_ATTR_LOCALE); + } + + public String getLmsSetupName() { + return getSQLWildcard(LmsSetup.FILTER_ATTR_NAME); + } + + public String getLmsSetupType() { + return getString(LmsSetup.FILTER_ATTR_LMS_TYPE); + } + + public DateTime getExamFromTime() { + return JodaTimeTypeResolver.getDateTime(getString(Exam.FILTER_ATTR_FROM)); + } + + public String getExamQuizId() { + return getString(Exam.FILTER_ATTR_QUIZ_ID); + } + + public Long getExamLmsSetupId() { + return getLong(Exam.FILTER_ATTR_LMS_SETUP); + } + + public String getExamStatus() { + return getString(Exam.FILTER_ATTR_STATUS); + } + + public String getExamType() { + return getString(Exam.FILTER_ATTR_TYPE); + } + + public String getExamOwner() { + return getString(Exam.FILTER_ATTR_OWNER); + } + + public Long getIndicatorExamId() { + return getLong(Indicator.FILTER_ATTR_EXAM); + } + + public String getIndicatorName() { + return getSQLWildcard(Indicator.FILTER_ATTR_NAME); + } + + public String getString(final String name) { + return this.params.get(name); + } + + public String getSQLWildcard(final String name) { + return toSQLWildcard(this.params.get(name)); + } + + public Long getLong(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return Long.parseLong(value); + } + + public Integer getInteger(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return Integer.parseInt(value); + } + + public Locale getLocale(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return LocaleUtils.toLocale(name); + } + + public boolean getBoolean(final String name) { + return BooleanUtils.toBoolean(this.params.get(name)); + } + + public Boolean getBooleanObject(final String name) { + return BooleanUtils.toBooleanObject(this.params.get(name)); + } + + public Integer getBooleanAsInteger(final String name) { + final Boolean booleanObject = getBooleanObject(name); + if (booleanObject == null) { + return null; + } + return BooleanUtils.toIntegerObject(booleanObject); + } + + public static String toSQLWildcard(final String text) { + return (text == null) ? null : "%" + text + "%"; + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/InstitutionDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/InstitutionDAO.java index 46cde571..7441382d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/InstitutionDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/InstitutionDAO.java @@ -8,15 +8,10 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao; -import java.util.Collection; - import ch.ethz.seb.sebserver.gbl.model.institution.Institution; -import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO; public interface InstitutionDAO extends ActivatableEntityDAO, BulkActionSupportDAO { - Result> allMatching(String name, Boolean active); - } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java index 26eb35cc..815e9662 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java @@ -8,22 +8,9 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao; -import java.util.Collection; - -import org.springframework.transaction.annotation.Transactional; - import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup; -import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType; -import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO; public interface LmsSetupDAO extends ActivatableEntityDAO, BulkActionSupportDAO { - @Transactional(readOnly = true) - default Result> allOfInstitution(final Long institutionId, final Boolean active) { - return allMatching(institutionId, null, null, active); - } - - Result> allMatching(Long institutionId, String name, LmsType lmsType, Boolean active); - } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserActivityLogDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserActivityLogDAO.java index ab1d0ab7..414a5a46 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserActivityLogDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserActivityLogDAO.java @@ -15,7 +15,6 @@ import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog; import ch.ethz.seb.sebserver.gbl.util.Result; -import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserActivityLogRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser; public interface UserActivityLogDAO @@ -89,6 +88,8 @@ public interface UserActivityLogDAO String userId, Long from, Long to, - Predicate predicate); + String activityTypes, + String entityTypes, + Predicate predicate); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserDAO.java index 851ef5fb..e314650c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/UserDAO.java @@ -11,7 +11,6 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao; import java.util.Collection; import ch.ethz.seb.sebserver.gbl.model.EntityKey; -import ch.ethz.seb.sebserver.gbl.model.user.UserFilter; import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.util.Result; @@ -41,13 +40,13 @@ public interface UserDAO extends ActivatableEntityDAO, BulkAc * @return a Result of SEBServerUser for specified username. Or an exception result on error case */ Result sebServerUserByUsername(String username); - /** Use this to get a Collection of filtered UserInfo. The filter criteria - * from given UserFilter instance will be translated to SQL query and - * the filtering happens on data-base level - * - * @param filter The UserFilter instance containing all filter criteria - * @return a Result of Collection of filtered UserInfo. Or an exception result on error case */ - Result> allMatching(final UserFilter filter); +// /** Use this to get a Collection of filtered UserInfo. The filter criteria +// * from given UserFilter instance will be translated to SQL query and +// * the filtering happens on data-base level +// * +// * @param filter The UserFilter instance containing all filter criteria +// * @return a Result of Collection of filtered UserInfo. Or an exception result on error case */ +// Result> allMatching(final UserFilter filter); /** Use this to get a Collection containing EntityKey's of all entities that belongs to a given User. * diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index 26518d40..7aa5143b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -42,6 +42,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ExamRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService; @@ -76,13 +77,6 @@ public class ExamDAOImpl implements ExamDAO { .flatMap(this::toDomainModel); } - @Override - @Transactional(readOnly = true) - public Result byQuizId(final String quizId) { - return recordByQuizId(quizId) - .flatMap(this::toDomainModel); - } - @Override @Transactional(readOnly = true) public Result> all(final Long institutionId, final Boolean active) { @@ -106,18 +100,12 @@ public class ExamDAOImpl implements ExamDAO { @Override @Transactional(readOnly = true) - public Result> allMatching( - final Long institutionId, - final Long lmsSetupId, - final String name, - final ExamStatus status, - final ExamType type, - final DateTime from, - final String owner, - final Boolean active) { + public Result> allMatching(final FilterMap filterMap, final Predicate predicate) { return Result.tryCatch(() -> { + final String name = filterMap.getName(); + final DateTime from = filterMap.getExamFromTime(); final Predicate quizDataFilter = exam -> { if (StringUtils.isNoneBlank(name)) { if (!exam.name.contains(name)) { @@ -137,108 +125,50 @@ public class ExamDAOImpl implements ExamDAO { final List records = this.examRecordMapper.selectByExample() .where( ExamRecordDynamicSqlSupport.active, - isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) + isEqualToWhenPresent(filterMap.getActiveAsInt())) .and( ExamRecordDynamicSqlSupport.institutionId, - isEqualToWhenPresent(institutionId)) + isEqualToWhenPresent(filterMap.getInstitutionId())) + .and( + ExamRecordDynamicSqlSupport.externalId, + isEqualToWhenPresent(filterMap.getExamQuizId())) .and( ExamRecordDynamicSqlSupport.lmsSetupId, - isEqualToWhenPresent(lmsSetupId)) + isEqualToWhenPresent(filterMap.getExamLmsSetupId())) .and( ExamRecordDynamicSqlSupport.status, - isEqualToWhenPresent((status != null) ? status.name() : null)) + isEqualToWhenPresent(filterMap.getExamStatus())) .and( ExamRecordDynamicSqlSupport.type, - isEqualToWhenPresent((type != null) ? type.name() : null)) + isEqualToWhenPresent(filterMap.getExamType())) .and( ExamRecordDynamicSqlSupport.owner, - isEqualToWhenPresent(owner)) + isEqualToWhenPresent(filterMap.getExamOwner())) .build() .execute(); return this.toDomainModel(records) .getOrThrow() .stream() - .filter(quizDataFilter) + .filter(quizDataFilter.and(predicate)) .collect(Collectors.toList()); }); } - @Override - @Transactional - public Result importFromQuizData( - final Long institutionId, - final Long lmsSetupId, - final QuizData quizData) { - - return Result.tryCatch(() -> { - // fist check if it is not already existing - final List exam = this.examRecordMapper.selectByExample() - .where(ExamRecordDynamicSqlSupport.lmsSetupId, isEqualTo(lmsSetupId)) - .and(ExamRecordDynamicSqlSupport.externalId, isEqualTo(quizData.id)) - .build() - .execute(); - - // if there is already an existing imported exam for the quiz, this is returned - if (exam != null && exam.size() > 0) { - return exam.get(0); - } - - // otherwise create a new one - final String ownerId = this.userService.getCurrentUser().uuid(); - final ExamRecord examRecord = new ExamRecord( - null, - institutionId, - lmsSetupId, - quizData.id, - ownerId, - null, - ExamType.UNDEFINED.name(), - ExamStatus.ON_CREATION.name(), - BooleanUtils.toIntegerObject(true)); - - final int insert = this.examRecordMapper.insert(examRecord); - if (insert != 1) { - - } - - return this.examRecordMapper.selectByPrimaryKey(examRecord.getId()); - }) - .flatMap(this::toDomainModel) - .onErrorDo(TransactionHandler::rollback); - - } - @Override @Transactional public Result save(final Exam exam) { if (exam == null) { return Result.ofError(new NullPointerException("exam has null-reference")); } - if (exam.id == null) { - return Result.ofError(new IllegalArgumentException("exam.id has null-reference")); - } - return update(exam) - .flatMap(this::toDomainModel) - .onErrorDo(TransactionHandler::rollback); - } - - private Result update(final Exam exam) { - return Result.tryCatch(() -> { - final ExamRecord examRecord = new ExamRecord( - exam.id, - null, null, null, null, - (exam.supporter != null) - ? StringUtils.join(exam.supporter, Constants.LIST_SEPARATOR_CHAR) - : null, - (exam.type != null) ? exam.type.name() : null, - (exam.status != null) ? exam.status.name() : null, - BooleanUtils.toIntegerObject(exam.active)); - - this.examRecordMapper.updateByPrimaryKeySelective(examRecord); - return this.examRecordMapper.selectByPrimaryKey(exam.id); - }); + return (exam.id == null) + ? insert(exam) + .flatMap(this::toDomainModel) + .onErrorDo(TransactionHandler::rollback) + : update(exam) + .flatMap(this::toDomainModel) + .onErrorDo(TransactionHandler::rollback); } @Override @@ -307,6 +237,54 @@ public class ExamDAOImpl implements ExamDAO { }).flatMap(this::toDomainModel); } + private Result insert(final Exam exam) { + return Result.tryCatch(() -> { + + // fist check if it is not already existing + final List records = this.examRecordMapper.selectByExample() + .where(ExamRecordDynamicSqlSupport.lmsSetupId, isEqualTo(exam.lmsSetupId)) + .and(ExamRecordDynamicSqlSupport.externalId, isEqualTo(exam.externalId)) + .build() + .execute(); + + // if there is already an existing imported exam for the quiz, this is returned + if (records != null && records.size() > 0) { + return records.get(0); + } + + final ExamRecord examRecord = new ExamRecord( + null, + exam.institutionId, + exam.lmsSetupId, + exam.externalId, + this.userService.getCurrentUser().uuid(), + null, + null, + null, + BooleanUtils.toInteger(false)); + + this.examRecordMapper.updateByPrimaryKeySelective(examRecord); + return this.examRecordMapper.selectByPrimaryKey(exam.id); + }); + } + + private Result update(final Exam exam) { + return Result.tryCatch(() -> { + final ExamRecord examRecord = new ExamRecord( + exam.id, + null, null, null, null, + (exam.supporter != null) + ? StringUtils.join(exam.supporter, Constants.LIST_SEPARATOR_CHAR) + : null, + (exam.type != null) ? exam.type.name() : null, + (exam.status != null) ? exam.status.name() : null, + BooleanUtils.toIntegerObject(exam.active)); + + this.examRecordMapper.updateByPrimaryKeySelective(examRecord); + return this.examRecordMapper.selectByPrimaryKey(exam.id); + }); + } + private Result> allIdsOfInstitution(final EntityKey institutionKey) { return Result.tryCatch(() -> { return this.examRecordMapper.selectIdsByExample() @@ -345,15 +323,6 @@ public class ExamDAOImpl implements ExamDAO { }); } - private Result recordByQuizId(final String quizId) { - return getSingleResource( - quizId, - this.examRecordMapper.selectByExample() - .where(ExamRecordDynamicSqlSupport.externalId, isEqualTo(quizId)) - .build() - .execute()); - } - private Result toDomainModel(final ExamRecord record) { return toDomainModel( record.getLmsSetupId(), diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/IndicatorDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/IndicatorDAOImpl.java index 8115bb99..2ef0f921 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/IndicatorDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/IndicatorDAOImpl.java @@ -8,13 +8,13 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; -import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo; -import static org.mybatis.dynamic.sql.SqlBuilder.isIn; +import static org.mybatis.dynamic.sql.SqlBuilder.*; import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -30,14 +30,17 @@ import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType; import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.Threshold; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ExamRecordDynamicSqlSupport; +import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ExamRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.IndicatorRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.IndicatorRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ThresholdRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ThresholdRecordMapper; +import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ExamRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.IndicatorRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ThresholdRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.IndicatorDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; @@ -48,13 +51,16 @@ public class IndicatorDAOImpl implements IndicatorDAO { private final IndicatorRecordMapper indicatorRecordMapper; private final ThresholdRecordMapper thresholdRecordMapper; + private final ExamRecordMapper examRecordMapper; public IndicatorDAOImpl( final IndicatorRecordMapper indicatorRecordMapper, - final ThresholdRecordMapper thresholdRecordMapper) { + final ThresholdRecordMapper thresholdRecordMapper, + final ExamRecordMapper examRecordMapper) { this.indicatorRecordMapper = indicatorRecordMapper; this.thresholdRecordMapper = thresholdRecordMapper; + this.examRecordMapper = examRecordMapper; } @Override @@ -90,6 +96,34 @@ public class IndicatorDAOImpl implements IndicatorDAO { }); } + @Override + @Transactional(readOnly = true) + public Result> allMatching(final FilterMap filterMap, final Predicate predicate) { + return Result.tryCatch(() -> { + return this.indicatorRecordMapper.selectByExample() + .join(ExamRecordDynamicSqlSupport.examRecord) + .on( + ExamRecordDynamicSqlSupport.id, + SqlBuilder.equalTo(IndicatorRecordDynamicSqlSupport.examId)) + .where( + ExamRecordDynamicSqlSupport.institutionId, + isEqualToWhenPresent(filterMap.getInstitutionId())) + .and( + IndicatorRecordDynamicSqlSupport.examId, + isEqualToWhenPresent(filterMap.getIndicatorExamId())) + .and( + IndicatorRecordDynamicSqlSupport.name, + isLikeWhenPresent(filterMap.getIndicatorName())) + .build() + .execute() + .stream() + .map(this::toDomainModel) + .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) + .filter(predicate) + .collect(Collectors.toList()); + }); + } + @Override @Transactional(readOnly = true) public Result> loadEntities(final Collection keys) { @@ -202,6 +236,8 @@ public class IndicatorDAOImpl implements IndicatorDAO { private Result toDomainModel(final IndicatorRecord record) { return Result.tryCatch(() -> { + final ExamRecord examRecord = this.examRecordMapper.selectByPrimaryKey(record.getExamId()); + final List thresholds = this.thresholdRecordMapper.selectByExample() .where(ThresholdRecordDynamicSqlSupport.indicatorId, isEqualTo(record.getId())) .build() @@ -216,6 +252,8 @@ public class IndicatorDAOImpl implements IndicatorDAO { return new Indicator( record.getId(), + examRecord.getInstitutionId(), + examRecord.getOwner(), record.getExamId(), record.getName(), IndicatorType.valueOf(record.getType()), diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/InstitutionDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/InstitutionDAOImpl.java index f29a2b86..e18a5008 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/InstitutionDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/InstitutionDAOImpl.java @@ -15,6 +15,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; import org.apache.commons.lang3.BooleanUtils; @@ -29,12 +30,12 @@ import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.institution.Institution; import ch.ethz.seb.sebserver.gbl.util.Result; -import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.InstitutionRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.InstitutionDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; @@ -89,20 +90,24 @@ public class InstitutionDAOImpl implements InstitutionDAO { @Override @Transactional(readOnly = true) - public Result> allMatching(final String name, final Boolean active) { + public Result> allMatching( + final FilterMap filterMap, + final Predicate predicate) { + return Result.tryCatch(() -> this.institutionRecordMapper .selectByExample() .where( InstitutionRecordDynamicSqlSupport.active, - SqlBuilder.isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) + SqlBuilder.isEqualToWhenPresent(filterMap.getActiveAsInt())) .and( InstitutionRecordDynamicSqlSupport.name, - SqlBuilder.isEqualToWhenPresent(Utils.toSQLWildcard(name))) + SqlBuilder.isEqualToWhenPresent(filterMap.getName())) .build() .execute() .stream() .map(InstitutionDAOImpl::toDomainModel) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) + .filter(predicate) .collect(Collectors.toList())); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java index 130f6534..0dbdf33d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java @@ -8,13 +8,13 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; -import static ch.ethz.seb.sebserver.gbl.util.Utils.toSQLWildcard; import static org.mybatis.dynamic.sql.SqlBuilder.*; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; import org.apache.commons.lang3.BooleanUtils; @@ -34,6 +34,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.LmsSetupRecordMap import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.LmsSetupRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.LmsSetupDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; @@ -89,33 +90,31 @@ public class LmsSetupDAOImpl implements LmsSetupDAO { @Override @Transactional(readOnly = true) public Result> allMatching( - final Long institutionId, - final String name, - final LmsType lmsType, - final Boolean active) { + final FilterMap filterMap, + final Predicate predicate) { return Result.tryCatch(() -> { - final String _lmsType = (lmsType != null) ? lmsType.name() : null; return this.lmsSetupRecordMapper .selectByExample() .where( LmsSetupRecordDynamicSqlSupport.institutionId, - isEqualToWhenPresent(institutionId)) + isEqualToWhenPresent(filterMap.getInstitutionId())) .and( LmsSetupRecordDynamicSqlSupport.name, - isLikeWhenPresent(toSQLWildcard(name))) + isLikeWhenPresent(filterMap.getLmsSetupName())) .and( LmsSetupRecordDynamicSqlSupport.lmsType, - isEqualToWhenPresent(_lmsType)) + isEqualToWhenPresent(filterMap.getLmsSetupType())) .and( LmsSetupRecordDynamicSqlSupport.active, - isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) + isEqualToWhenPresent(filterMap.getActiveAsInt())) .build() .execute() .stream() .map(LmsSetupDAOImpl::toDomainModel) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) + .filter(predicate) .collect(Collectors.toList()); }); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserActivityLogDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserActivityLogDAOImpl.java index c74ae16e..40050873 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserActivityLogDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserActivityLogDAOImpl.java @@ -10,12 +10,14 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; import static org.mybatis.dynamic.sql.SqlBuilder.isIn; +import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; import org.mybatis.dynamic.sql.SqlBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,6 +26,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityType; @@ -33,10 +36,10 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRe import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserActivityLogRecord; -import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; @@ -48,16 +51,13 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO { private final UserActivityLogRecordMapper userLogRecordMapper; private final UserService userService; - private final PaginationService paginationService; public UserActivityLogDAOImpl( final UserActivityLogRecordMapper userLogRecordMapper, - final UserService userService, - final PaginationService paginationService) { + final UserService userService) { this.userLogRecordMapper = userLogRecordMapper; this.userService = userService; - this.paginationService = paginationService; } @Override @@ -208,6 +208,20 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO { }); } + @Override + @Transactional(readOnly = true) + public Result> allMatching(final FilterMap filterMap, + final Predicate predicate) { + return all( + filterMap.getInstitutionId(), + filterMap.getString(UserActivityLog.FILTER_ATTR_USER), + filterMap.getLong(UserActivityLog.FILTER_ATTR_FROM), + filterMap.getLong(UserActivityLog.FILTER_ATTR_TO), + filterMap.getString(UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES), + filterMap.getString(UserActivityLog.FILTER_ATTR_ENTITY_TYPES), + predicate); + } + @Override @Transactional(readOnly = true) public Result> all( @@ -215,10 +229,19 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO { final String userId, final Long from, final Long to, - final Predicate predicate) { + final String activityTypes, + final String entityTypes, + final Predicate predicate) { return Result.tryCatch(() -> { - final Predicate _predicate = (predicate != null) + final List _activityTypes = (activityTypes != null) + ? Arrays.asList(StringUtils.split(activityTypes, Constants.LIST_SEPARATOR)) + : null; + final List _entityTypes = (entityTypes != null) + ? Arrays.asList(StringUtils.split(entityTypes, Constants.LIST_SEPARATOR)) + : null; + + final Predicate _predicate = (predicate != null) ? predicate : model -> true; @@ -239,12 +262,18 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO { .and( UserActivityLogRecordDynamicSqlSupport.timestamp, SqlBuilder.isLessThanWhenPresent(to)) + .and( + UserActivityLogRecordDynamicSqlSupport.activityType, + SqlBuilder.isInCaseInsensitiveWhenPresent(_activityTypes)) + .and( + UserActivityLogRecordDynamicSqlSupport.entityType, + SqlBuilder.isInCaseInsensitiveWhenPresent(_entityTypes)) .build() .execute() .stream() - .filter(_predicate) .map(UserActivityLogDAOImpl::toDomainModel) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) + .filter(_predicate) .collect(Collectors.toList()); }); @@ -255,11 +284,6 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO { public Result> all(final Long institutionId) { return Result.tryCatch(() -> { - // first check if there is a page limitation set. Otherwise set the default - // to not pollute the memory with log data - this.paginationService.setDefaultLimitOfNotSet( - UserActivityLogRecordDynamicSqlSupport.userActivityLogRecord); - if (institutionId == null) { return this.userLogRecordMapper .selectByExample() diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserDaoImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserDaoImpl.java index e7770f51..e987e8e1 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserDaoImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/UserDaoImpl.java @@ -8,7 +8,6 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; -import static ch.ethz.seb.sebserver.gbl.util.Utils.toSQLWildcard; import static org.mybatis.dynamic.sql.SqlBuilder.*; import java.util.Collection; @@ -17,6 +16,7 @@ import java.util.List; import java.util.Locale; import java.util.Set; import java.util.UUID; +import java.util.function.Predicate; import java.util.stream.Collectors; import javax.validation.constraints.NotNull; @@ -36,7 +36,6 @@ import ch.ethz.seb.sebserver.gbl.model.APIMessage.APIMessageException; import ch.ethz.seb.sebserver.gbl.model.APIMessage.ErrorMessage; import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityType; -import ch.ethz.seb.sebserver.gbl.model.user.UserFilter; import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.util.Result; @@ -50,6 +49,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO; @@ -117,6 +117,7 @@ public class UserDaoImpl implements UserDAO { @Transactional(readOnly = true) public Result> all(final Long institutionId, final Boolean active) { return Result.tryCatch(() -> { + final List records = (active != null) ? this.userRecordMapper.selectByExample() .where( @@ -143,20 +144,33 @@ public class UserDaoImpl implements UserDAO { @Override @Transactional(readOnly = true) - public Result> allMatching(final UserFilter filter) { - return Result.tryCatch(() -> this.userRecordMapper.selectByExample().where( - UserRecordDynamicSqlSupport.active, - isEqualToWhenPresent(BooleanUtils.toIntegerObject(filter.active))) - .and(UserRecordDynamicSqlSupport.institutionId, isEqualToWhenPresent(filter.institutionId)) - .and(UserRecordDynamicSqlSupport.name, isLikeWhenPresent(toSQLWildcard(filter.name))) - .and(UserRecordDynamicSqlSupport.username, isLikeWhenPresent(toSQLWildcard(filter.username))) - .and(UserRecordDynamicSqlSupport.email, isLikeWhenPresent(toSQLWildcard(filter.email))) - .and(UserRecordDynamicSqlSupport.locale, isLikeWhenPresent(filter.locale)) + public Result> allMatching(final FilterMap filterMap, final Predicate predicate) { + return Result.tryCatch(() -> this.userRecordMapper + .selectByExample() + .where( + UserRecordDynamicSqlSupport.active, + isEqualToWhenPresent(filterMap.getActiveAsInt())) + .and( + UserRecordDynamicSqlSupport.institutionId, + isEqualToWhenPresent(filterMap.getInstitutionId())) + .and( + UserRecordDynamicSqlSupport.name, + isLikeWhenPresent(filterMap.getName())) + .and( + UserRecordDynamicSqlSupport.username, + isLikeWhenPresent(filterMap.getUserUsername())) + .and( + UserRecordDynamicSqlSupport.email, + isLikeWhenPresent(filterMap.getUserEmail())) + .and( + UserRecordDynamicSqlSupport.locale, + isLikeWhenPresent(filterMap.getUserLocale())) .build() .execute() .stream() .map(this::toDomainModel) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) + .filter(predicate) .collect(Collectors.toList())); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationException.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationException.java new file mode 100644 index 00000000..70cc394b --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationException.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.servicelayer.validation; + +import org.springframework.validation.BindingResult; +import org.springframework.validation.ObjectError; + +public class BeanValidationException extends RuntimeException { + + private static final long serialVersionUID = 3631243977662300454L; + + private final BindingResult bindingResult; + + public BeanValidationException(final BindingResult bindingResult) { + super(); + this.bindingResult = bindingResult; + } + + public BindingResult getBindingResult() { + return this.bindingResult; + } + + @Override + public String getMessage() { + final StringBuilder sb = new StringBuilder("Validation failed for "); + if (this.bindingResult.getErrorCount() > 1) { + sb.append(" with ").append(this.bindingResult.getErrorCount()).append(" errors"); + } + sb.append(": "); + for (final ObjectError error : this.bindingResult.getAllErrors()) { + sb.append("[").append(error).append("] "); + } + return sb.toString(); + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationService.java new file mode 100644 index 00000000..ecf6dab1 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/validation/BeanValidationService.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.servicelayer.validation; + +import java.util.Map; + +import org.springframework.stereotype.Service; +import org.springframework.validation.DirectFieldBindingResult; +import org.springframework.validation.Validator; + +import com.fasterxml.jackson.databind.ObjectReader; + +import ch.ethz.seb.sebserver.gbl.JSONMapper; +import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; + +@Service +@WebServiceProfile +public class BeanValidationService { + + private final Validator validator; + private final JSONMapper jsonMapper; + + public BeanValidationService( + final Validator validator, + final JSONMapper jsonMapper) { + + this.validator = validator; + this.jsonMapper = jsonMapper; + } + + public void validateBean(final T bean) { + final DirectFieldBindingResult errors = new DirectFieldBindingResult(bean, ""); + this.validator.validate(bean, errors); + if (errors.hasErrors()) { + throw new BeanValidationException(errors); + } + } + + public M validateNewBean(final Map params, final Class type) { + M result = null; + try { + final String stringValue = this.jsonMapper.writeValueAsString(params); + result = this.jsonMapper.readValue(stringValue, type); + } catch (final Exception e) { + throw new RuntimeException("Unexpected error: ", e); + } + + if (result != null) { + validateBean(result); + } + return result; + } + + public M validateModifiedBean(final T bean, final Map params, final Class type) { + + M result = null; + try { + final String stringValue = this.jsonMapper.writeValueAsString(bean); + final String paramsString = this.jsonMapper.writeValueAsString(params); + result = this.jsonMapper.readValue(stringValue, type); + final ObjectReader updater = this.jsonMapper.readerForUpdating(result); + result = updater.readValue(paramsString); + } catch (final Exception e) { + throw new RuntimeException("Unexpected error: ", e); + } + + if (result != null) { + validateBean(result); + } + return result; + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIExceptionHandler.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIExceptionHandler.java index 73830d6f..69fd632f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIExceptionHandler.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIExceptionHandler.java @@ -29,6 +29,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExcep import ch.ethz.seb.sebserver.gbl.model.APIMessage; import ch.ethz.seb.sebserver.gbl.model.APIMessage.APIMessageException; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PermissionDeniedException; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationException; @Order(Ordered.HIGHEST_PRECEDENCE) @ControllerAdvice @@ -44,9 +45,8 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler { final HttpStatus status, final WebRequest request) { - log.error("Unexpected internal error catched at the API endpoint: ", ex); - return APIMessage.ErrorMessage.UNEXPECTED - .createErrorResponse(ex.getMessage()); + log.error("Unexpected generic error catched at the API endpoint: ", ex); + return new ResponseEntity<>(APIMessage.ErrorMessage.GENERIC.of(ex.getMessage()), status); } @Override @@ -65,6 +65,20 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler { return new ResponseEntity<>(valErrors, HttpStatus.BAD_REQUEST); } + @ExceptionHandler(BeanValidationException.class) + public ResponseEntity handleBeanValidationException( + final BeanValidationException ex, + final WebRequest request) { + + final Collection valErrors = ex.getBindingResult() + .getFieldErrors() + .stream() + .map(field -> APIMessage.fieldValidationError(field)) + .collect(Collectors.toList()); + + return new ResponseEntity<>(valErrors, HttpStatus.BAD_REQUEST); + } + @ExceptionHandler(UsernameNotFoundException.class) public ResponseEntity handleUserNotFound( final UsernameNotFoundException ex, @@ -84,6 +98,16 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler { .createErrorResponse(ex.getMessage()); } + @ExceptionHandler(IllegalAPIArgumentException.class) + public ResponseEntity handleIllegalAPIArgumentException( + final IllegalAPIArgumentException ex, + final WebRequest request) { + + log.warn("Illegal API Argument Exception: ", ex); + return APIMessage.ErrorMessage.ILLEGAL_API_ARGUMENT + .createErrorResponse(ex.getMessage()); + } + @ExceptionHandler(Exception.class) public ResponseEntity handleUnexpected( final Exception ex, diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIParamsMap.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIParamsMap.java new file mode 100644 index 00000000..54272112 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/APIParamsMap.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.weblayer.api; + +import java.util.Locale; +import java.util.Map; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.LocaleUtils; + +import ch.ethz.seb.sebserver.gbl.util.Utils; + +public class APIParamsMap { + + public final Map params; + + public APIParamsMap(final Map params) { + super(); + this.params = Utils.immutableMapOf(params); + } + + public String getString(final String name) { + return this.params.get(name); + } + + public Long getLong(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return Long.parseLong(value); + } + + public Integer getInteger(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return Integer.parseInt(value); + } + + public Locale getLocale(final String name) { + final String value = this.params.get(name); + if (value == null) { + return null; + } + + return LocaleUtils.toLocale(name); + } + + public boolean getBoolean(final String name) { + return BooleanUtils.toBoolean(this.params.get(name)); + } + + public Boolean getBooleanObject(final String name) { + return BooleanUtils.toBooleanObject(this.params.get(name)); + } + + public Integer getBooleanAsInteger(final String name) { + final Boolean booleanObject = getBooleanObject(this.params.get(name)); + if (booleanObject == null) { + return null; + } + return BooleanUtils.toIntegerObject(booleanObject); + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ActivatableEntityController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ActivatableEntityController.java index 85040901..c593b842 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ActivatableEntityController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ActivatableEntityController.java @@ -8,8 +8,7 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; -import java.util.Collection; - +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -32,6 +31,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction.Type; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ActivatableEntityDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; public abstract class ActivatableEntityController extends EntityController { @@ -43,13 +43,23 @@ public abstract class ActivatableEntityController entityDAO, final UserActivityLogDAO userActivityLogDAO, - final PaginationService paginationService) { + final PaginationService paginationService, + final BeanValidationService beanValidationService) { - super(authorizationGrantService, bulkActionService, entityDAO, userActivityLogDAO, paginationService); + super(authorizationGrantService, + bulkActionService, + entityDAO, + userActivityLogDAO, + paginationService, + beanValidationService); this.activatableEntityDAO = entityDAO; } - @RequestMapping(path = "/active", method = RequestMethod.GET) + @RequestMapping( + path = "/all/active", + method = RequestMethod.GET, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) public Page allActive( @RequestParam( name = Entity.FILTER_ATTR_INSTITUTION, @@ -67,10 +77,14 @@ public abstract class ActivatableEntityController this.activatableEntityDAO.all(institutionId, true).getOrThrow()); + () -> this.activatableEntityDAO.all(institutionId, true)).getOrThrow(); } - @RequestMapping(path = "/inactive", method = RequestMethod.GET) + @RequestMapping( + path = "/all/inactive", + method = RequestMethod.GET, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) public Page allInactive( @RequestParam( name = Entity.FILTER_ATTR_INSTITUTION, @@ -88,31 +102,29 @@ public abstract class ActivatableEntityController this.activatableEntityDAO.all(institutionId, false).getOrThrow()); + () -> this.activatableEntityDAO.all(institutionId, false)).getOrThrow(); } - @RequestMapping(path = "/{id}/activate", method = RequestMethod.POST) + @RequestMapping( + path = "/{id}/activate", + method = RequestMethod.POST, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) public EntityProcessingReport activate(@PathVariable final String id) { return setActive(id, true) .getOrThrow(); } - @RequestMapping(value = "/{id}/deactivate", method = RequestMethod.POST) + @RequestMapping( + value = "/{id}/deactivate", + method = RequestMethod.POST, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) public EntityProcessingReport deactivate(@PathVariable final String id) { return setActive(id, false) .getOrThrow(); } - @RequestMapping(path = "/{id}/delete", method = RequestMethod.DELETE) - public EntityProcessingReport delete(@PathVariable final String id) { - return deactivate(id); - } - - @Override - protected Result> getAll(final Long institutionId, final Boolean active) { - return this.activatableEntityDAO.all(institutionId, active); - } - private Result setActive(final String id, final boolean active) { final EntityType entityType = this.entityDAO.entityType(); final BulkAction bulkAction = new BulkAction( diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java index afc4b3b2..8f40010c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java @@ -10,11 +10,17 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; import java.util.Arrays; import java.util.Collection; +import java.util.Map; +import java.util.function.Predicate; import java.util.stream.Collectors; import javax.validation.Valid; import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.SqlTable; +import org.springframework.http.MediaType; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,11 +28,13 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import ch.ethz.seb.sebserver.gbl.Constants; +import ch.ethz.seb.sebserver.gbl.model.Domain; import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKeyAndName; import ch.ethz.seb.sebserver.gbl.model.EntityProcessingReport; import ch.ethz.seb.sebserver.gbl.model.EntityType; +import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; @@ -37,8 +45,10 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction.Type; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.EntityDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.ActivityType; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; public abstract class EntityController { @@ -47,23 +57,81 @@ public abstract class EntityController entityDAO; protected final UserActivityLogDAO userActivityLogDAO; protected final PaginationService paginationService; + protected final BeanValidationService beanValidationService; protected EntityController( final AuthorizationGrantService authorizationGrantService, final BulkActionService bulkActionService, final EntityDAO entityDAO, final UserActivityLogDAO userActivityLogDAO, - final PaginationService paginationService) { + final PaginationService paginationService, + final BeanValidationService beanValidationService) { this.authorizationGrantService = authorizationGrantService; this.bulkActionService = bulkActionService; this.entityDAO = entityDAO; this.userActivityLogDAO = userActivityLogDAO; this.paginationService = paginationService; + this.beanValidationService = beanValidationService; + } + + @InitBinder + public void initBinder(final WebDataBinder binder) throws Exception { + this.authorizationGrantService + .getUserService() + .addUsersInstitutionDefaultPropertySupport(binder); + } + + @RequestMapping( + method = RequestMethod.GET, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) + public Page getAll( + @RequestParam( + name = Entity.FILTER_ATTR_INSTITUTION, + required = true, + defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, + @RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber, + @RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, + @RequestParam(name = Page.ATTR_SORT_BY, required = false) final String sortBy, + @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder, + @RequestParam final Map allRequestParams) { + + checkReadPrivilege(institutionId); + final FilterMap filterMap = new FilterMap(allRequestParams); + allRequestParams.putIfAbsent(Entity.FILTER_ATTR_INSTITUTION, String.valueOf(institutionId)); + + return this.paginationService.getPage( + pageNumber, + pageSize, + sortBy, + sortOrder, + getSQLTableOfEntity(), + () -> getAll(filterMap)).getOrThrow(); + } + + @RequestMapping(path = "/names", method = RequestMethod.GET) + public Collection getNames( + @RequestParam( + name = Entity.FILTER_ATTR_INSTITUTION, + required = true, + defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, + @RequestParam final Map allRequestParams) { + + checkReadPrivilege(institutionId); + final FilterMap filterMap = new FilterMap(allRequestParams); + allRequestParams.putIfAbsent(Entity.FILTER_ATTR_INSTITUTION, String.valueOf(institutionId)); + + return getAll(filterMap) + .getOrThrow() + .stream() + .map(Entity::toName) + .collect(Collectors.toList()); } @RequestMapping(path = "/{id}", method = RequestMethod.GET) - public T byId(@PathVariable final String id) { + public T getBy(@PathVariable final String id) { + return this.entityDAO .byModelId(id) .flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity( @@ -72,6 +140,104 @@ public abstract class EntityController allRequestParams, + @RequestParam( + name = Entity.FILTER_ATTR_INSTITUTION, + required = true, + defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId) { + + this.authorizationGrantService.checkHasAnyPrivilege( + EntityType.INSTITUTION, + PrivilegeType.WRITE); + + allRequestParams.putIfAbsent(Domain.ATTR_INSTITUTION_ID, String.valueOf(institutionId)); + final M modifyData = this.beanValidationService.validateNewBean( + allRequestParams, + modifiedDataType()); + + final M _modifyData = beforeSave(modifyData); + + return this.checkIsNew(modifyData) + .flatMap(entity -> this.entityDAO.save(_modifyData)) + .flatMap(entity -> this.userActivityLogDAO.log(ActivityType.CREATE, entity)) + .flatMap(entity -> notifySave(_modifyData, entity)) + .getOrThrow(); + } + + @RequestMapping( + method = RequestMethod.PUT, + consumes = MediaType.APPLICATION_JSON_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) + public T savePut(@Valid @RequestBody final M modifyData) { + + final M _modifyData = beforeSave(modifyData); + + return this.authorizationGrantService.checkGrantOnEntity(_modifyData, PrivilegeType.MODIFY) + .flatMap(entity -> this.entityDAO.save(_modifyData)) + .flatMap(entity -> this.userActivityLogDAO.log(ActivityType.MODIFY, entity)) + .flatMap(entity -> notifySave(_modifyData, entity)) + .getOrThrow(); + } + + protected M beforeSave(final M modifyData) { + return modifyData; + } + + @RequestMapping( + path = "/{id}", + method = RequestMethod.PATCH, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) + public T savePost( + @PathVariable final String id, + @RequestParam final Map allRequestParams, + @RequestParam( + name = Entity.FILTER_ATTR_INSTITUTION, + required = true, + defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId) { + + final T model = this.entityDAO + .byModelId(id) + .flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity( + entity, + PrivilegeType.MODIFY)) + .getOrThrow(); + + allRequestParams.putIfAbsent(Domain.ATTR_INSTITUTION_ID, String.valueOf(institutionId)); + final M modifyData = this.beanValidationService.validateModifiedBean( + model, + allRequestParams, + modifiedDataType()); + + final M _modifyData = beforeSave(modifyData); + + return this.entityDAO.save(_modifyData) + .flatMap(entity -> this.userActivityLogDAO.log(ActivityType.MODIFY, entity)) + .flatMap(entity -> notifySave(_modifyData, entity)) + .getOrThrow(); + } + + @RequestMapping(path = "/{id}", method = RequestMethod.DELETE) + public EntityProcessingReport hardDelete(@PathVariable final String id) { + final EntityType entityType = this.entityDAO.entityType(); + final BulkAction bulkAction = new BulkAction( + Type.HARD_DELETE, + entityType, + new EntityKey(id, entityType)); + + return this.entityDAO.byModelId(id) + .flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity( + entity, + PrivilegeType.WRITE)) + .flatMap(entity -> this.bulkActionService.createReport(bulkAction)) + .getOrThrow(); + } + @RequestMapping(path = "/in", method = RequestMethod.GET) public Collection getForIds(@RequestParam(name = "ids", required = true) final String ids) { return Result.tryCatch(() -> { @@ -87,56 +253,6 @@ public abstract class EntityController getNames( - @RequestParam( - name = Entity.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = Entity.FILTER_ATTR_ACTIVE, required = false) final Boolean active) { - - return getAll(institutionId, active) - .getOrThrow() - .stream() - .filter(entity -> this.authorizationGrantService.hasGrant(entity, PrivilegeType.READ_ONLY)) - .map(Entity::toName) - .collect(Collectors.toList()); - } - - @RequestMapping(path = "/{id}/hard-delete", method = RequestMethod.DELETE) - public EntityProcessingReport hardDelete(@PathVariable final String id) { - final EntityType entityType = this.entityDAO.entityType(); - final BulkAction bulkAction = new BulkAction( - Type.HARD_DELETE, - entityType, - new EntityKey(id, entityType)); - - return this.entityDAO.byModelId(id) - .flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity( - entity, - PrivilegeType.WRITE)) - .flatMap(entity -> this.bulkActionService.createReport(bulkAction)) - .getOrThrow(); - } - - @RequestMapping(path = "/create", method = RequestMethod.PUT) - public T create(@Valid @RequestBody final M modifyData) { - return this.authorizationGrantService.checkGrantOnEntity(modifyData, PrivilegeType.WRITE) - .flatMap(entity -> this.entityDAO.save(modifyData)) - .flatMap(entity -> this.userActivityLogDAO.log(ActivityType.CREATE, entity)) - .flatMap(entity -> notifySave(modifyData, entity)) - .getOrThrow(); - } - - @RequestMapping(path = "/save", method = RequestMethod.POST) - public T save(@Valid @RequestBody final M modifyData) { - return this.authorizationGrantService.checkGrantOnEntity(modifyData, PrivilegeType.MODIFY) - .flatMap(entity -> this.entityDAO.save(modifyData)) - .flatMap(entity -> this.userActivityLogDAO.log(ActivityType.MODIFY, entity)) - .flatMap(entity -> notifySave(modifyData, entity)) - .getOrThrow(); - } - protected Result notifySave(final M modifyData, final T entity) { return Result.of(entity); } @@ -148,7 +264,24 @@ public abstract class EntityController> getAll(final Long institutionId, final Boolean active) { - return this.entityDAO.all(institutionId); + protected Result> getAll(final FilterMap filterMap) { + final Predicate grantFilter = this.authorizationGrantService.getGrantFilter( + this.entityDAO.entityType(), + PrivilegeType.READ_ONLY); + + return this.entityDAO.allMatching(filterMap, grantFilter); + } + + protected abstract Class modifiedDataType(); + + protected abstract SqlTable getSQLTableOfEntity(); + + private Result checkIsNew(final M entity) { + if (entity.getModelId() == null) { + return Result.of(entity); + } else { + return Result + .ofError(new IllegalAPIArgumentException("Request model has already an identifier but should not")); + } } } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java index b6992312..54f1ec24 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java @@ -9,37 +9,25 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.validation.Valid; +import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.springframework.web.bind.WebDataBinder; -import org.springframework.web.bind.annotation.InitBinder; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; +import org.mybatis.dynamic.sql.SqlTable; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import ch.ethz.seb.sebserver.gbl.Constants; -import ch.ethz.seb.sebserver.gbl.model.EntityKey; +import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page.SortOrder; import ch.ethz.seb.sebserver.gbl.model.exam.Exam; -import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamStatus; -import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamType; -import ch.ethz.seb.sebserver.gbl.model.exam.Indicator; import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; -import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ExamRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; @@ -47,8 +35,10 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.IndicatorDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; @WebServiceProfile @RestController @@ -64,57 +54,45 @@ public class ExamAdministrationController extends ActivatableEntityController modifiedDataType() { + return Exam.class; } - @RequestMapping(method = RequestMethod.GET) - public Collection getAll( - @RequestParam( - name = Exam.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = Exam.FILTER_ATTR_LMS_SETUP, required = false) final Long lmsSetupId, - @RequestParam(name = Exam.FILTER_ATTR_ACTIVE, required = false) final Boolean active, - @RequestParam(name = Exam.FILTER_ATTR_NAME, required = false) final String name, - @RequestParam(name = Exam.FILTER_ATTR_FROM, required = false) final String from, - @RequestParam(name = Exam.FILTER_ATTR_STATUS, required = false) final ExamStatus status, - @RequestParam(name = Exam.FILTER_ATTR_TYPE, required = false) final ExamType type, - @RequestParam(name = Exam.FILTER_ATTR_OWNER, required = false) final String owner) { - - checkReadPrivilege(institutionId); - - this.paginationService.setDefaultLimit(ExamRecordDynamicSqlSupport.examRecord); - return getExams(institutionId, lmsSetupId, active, name, from, status, type, owner); + @Override + protected SqlTable getSQLTableOfEntity() { + return ExamRecordDynamicSqlSupport.examRecord; } - @RequestMapping(path = "/page", method = RequestMethod.GET) - public Page getPage( + @RequestMapping( + method = RequestMethod.GET, + consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) + @Override + public Page getAll( @RequestParam( - name = Exam.FILTER_ATTR_INSTITUTION, + name = Entity.FILTER_ATTR_INSTITUTION, required = true, defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = Exam.FILTER_ATTR_LMS_SETUP, required = false) final Long lmsSetupId, - @RequestParam(name = Exam.FILTER_ATTR_ACTIVE, required = false) final Boolean active, - @RequestParam(name = Exam.FILTER_ATTR_NAME, required = false) final String name, - @RequestParam(name = Exam.FILTER_ATTR_FROM, required = false) final String from, - @RequestParam(name = Exam.FILTER_ATTR_STATUS, required = false) final ExamStatus status, - @RequestParam(name = Exam.FILTER_ATTR_TYPE, required = false) final ExamType type, - @RequestParam(name = Exam.FILTER_ATTR_OWNER, required = false) final String owner, @RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber, @RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, @RequestParam(name = Page.ATTR_SORT_BY, required = false) final String sortBy, - @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder) { + @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder, + @RequestParam final Map allRequestParams) { checkReadPrivilege(institutionId); @@ -124,21 +102,20 @@ public class ExamAdministrationController extends ActivatableEntityController getExams(institutionId, lmsSetupId, active, name, from, status, type, owner)); + return super.getAll(institutionId, pageNumber, pageSize, sortBy, sortOrder, allRequestParams); } else { + this.authorizationGrantService.checkPrivilege( + EntityType.EXAM, + PrivilegeType.READ_ONLY, + institutionId); + final int pageNum = this.paginationService.getPageNumber(pageNumber); final int pSize = this.paginationService.getPageSize(pageSize); final List exams = new ArrayList<>( - getExams(institutionId, lmsSetupId, active, name, from, status, type, owner)); + this.examDAO.allMatching(new FilterMap(allRequestParams)).getOrThrow()); if (!StringUtils.isBlank(sortBy)) { if (sortBy.equals(QuizData.QUIZ_ATTR_NAME)) { @@ -162,108 +139,77 @@ public class ExamAdministrationController extends ActivatableEntityController getIndicatorOfExam(@PathVariable final Long examId) { - // check read-only grant on Exam - this.examDAO.byPK(examId) - .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.READ_ONLY)) - .getOrThrow(); - - return this.indicatorDAO.allForExam(examId) - .getOrThrow(); - } - - @RequestMapping(path = "/{examId}/indicator/delete/{indicatorId}", method = RequestMethod.DELETE) - public Collection deleteIndicatorOfExam( - @PathVariable final Long examId, - @PathVariable(required = false) final Long indicatorId) { - - // check write grant on Exam - this.examDAO.byPK(examId) - .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) - .getOrThrow(); - - final Set toDelete = (indicatorId != null) - ? this.indicatorDAO.allForExam(examId) - .getOrThrow() - .stream() - .map(ind -> new EntityKey(String.valueOf(ind.id), EntityType.INDICATOR)) - .collect(Collectors.toSet()) - : Utils.immutableSetOf(new EntityKey(String.valueOf(indicatorId), EntityType.INDICATOR)); - - this.indicatorDAO.delete(toDelete); - - return this.indicatorDAO.allForExam(examId) - .getOrThrow(); - } - - @RequestMapping(path = "/{examId}/indicator/new", method = RequestMethod.PUT) - public Indicator addNewIndicatorToExam( - @PathVariable final Long examId, - @Valid @RequestBody final Indicator indicator) { - - // check write grant on Exam - this.examDAO.byPK(examId) - .flatMap(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) - .getOrThrow(); - - if (indicator.id != null) { - return this.indicatorDAO.byPK(indicator.id) - .getOrThrow(); - } - - return this.indicatorDAO - .save(indicator) - .getOrThrow(); - } - - @RequestMapping(path = "/{examId}/indicator/save", method = RequestMethod.POST) - public Indicator saveIndicatorForExam( - @PathVariable final Long examId, - @Valid @RequestBody final Indicator indicator) { - - // check modify grant on Exam - this.examDAO.byPK(examId) - .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.MODIFY)) - .getOrThrow(); - - return this.indicatorDAO.save(new Indicator( - indicator.id, - examId, - indicator.name, - indicator.type, - indicator.defaultColor, - indicator.thresholds)).getOrThrow(); - } - - private Collection getExams( - final Long institutionId, - final Long lmsSetupId, - final Boolean active, - final String name, - final String from, - final ExamStatus status, - final ExamType type, - final String owner) { - - this.authorizationGrantService.checkPrivilege( - EntityType.EXAM, - PrivilegeType.READ_ONLY, - institutionId); - - final DateTime _from = (from != null) - ? DateTime.parse(from, Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS) - : null; - - return this.examDAO.allMatching( - institutionId, - lmsSetupId, - name, - status, - type, - _from, - owner, - active).getOrThrow(); - } - +// @RequestMapping(path = "/{examId}/indicator", method = RequestMethod.GET) +// public Collection getIndicatorOfExam(@PathVariable final Long examId) { +// // check read-only grant on Exam +// this.examDAO.byPK(examId) +// .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.READ_ONLY)) +// .getOrThrow(); +// +// return this.indicatorDAO.allForExam(examId) +// .getOrThrow(); +// } +// +// @RequestMapping(path = "/{examId}/indicator/delete/{indicatorId}", method = RequestMethod.DELETE) +// public Collection deleteIndicatorOfExam( +// @PathVariable final Long examId, +// @PathVariable(required = false) final Long indicatorId) { +// +// // check write grant on Exam +// this.examDAO.byPK(examId) +// .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) +// .getOrThrow(); +// +// final Set toDelete = (indicatorId != null) +// ? this.indicatorDAO.allForExam(examId) +// .getOrThrow() +// .stream() +// .map(ind -> new EntityKey(String.valueOf(ind.id), EntityType.INDICATOR)) +// .collect(Collectors.toSet()) +// : Utils.immutableSetOf(new EntityKey(String.valueOf(indicatorId), EntityType.INDICATOR)); +// +// this.indicatorDAO.delete(toDelete); +// +// return this.indicatorDAO.allForExam(examId) +// .getOrThrow(); +// } +// +// @RequestMapping(path = "/{examId}/indicator/new", method = RequestMethod.POST) +// public Indicator addNewIndicatorToExam( +// @PathVariable final Long examId, +// @Valid @RequestBody final Indicator indicator) { +// +// // check write grant on Exam +// this.examDAO.byPK(examId) +// .flatMap(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) +// .getOrThrow(); +// +// if (indicator.id != null) { +// return this.indicatorDAO.byPK(indicator.id) +// .getOrThrow(); +// } +// +// return this.indicatorDAO +// .save(indicator) +// .getOrThrow(); +// } +// +// @RequestMapping(path = "/{examId}/indicator/save", method = RequestMethod.PUT) +// public Indicator saveIndicatorForExam( +// @PathVariable final Long examId, +// @Valid @RequestBody final Indicator indicator) { +// +// // check modify grant on Exam +// this.examDAO.byPK(examId) +// .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.MODIFY)) +// .getOrThrow(); +// +// return this.indicatorDAO.save(new Indicator( +// indicator.id, +// examId, +// indicator.name, +// indicator.type, +// indicator.defaultColor, +// indicator.thresholds)).getOrThrow(); +// } } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IllegalAPIArgumentException.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IllegalAPIArgumentException.java new file mode 100644 index 00000000..5f767572 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IllegalAPIArgumentException.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.weblayer.api; + +public class IllegalAPIArgumentException extends RuntimeException { + + private static final long serialVersionUID = 3732727447520974727L; + + public IllegalAPIArgumentException() { + super(); + } + + public IllegalAPIArgumentException(final String message, final Throwable cause) { + super(message, cause); + } + + public IllegalAPIArgumentException(final String message) { + super(message); + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/InstitutionController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/InstitutionController.java index 55999752..82aa417d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/InstitutionController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/InstitutionController.java @@ -8,24 +8,21 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; -import java.util.Arrays; -import java.util.Collection; - +import org.mybatis.dynamic.sql.SqlTable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.institution.Institution; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; +import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; -import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.InstitutionDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; @WebServiceProfile @RestController @@ -39,12 +36,29 @@ public class InstitutionController extends ActivatableEntityController modifiedDataType() { + return Institution.class; + } + + @Override + protected SqlTable getSQLTableOfEntity() { + return InstitutionRecordDynamicSqlSupport.institutionRecord; + } + @RequestMapping(path = "/self", method = RequestMethod.GET) public Institution getOwn() { final SEBServerUser currentUser = this.authorizationGrantService @@ -55,19 +69,4 @@ public class InstitutionController extends ActivatableEntityController getAll( - @RequestParam(name = Institution.FILTER_ATTR_ACTIVE, required = false) final Boolean active) { - - if (!this.authorizationGrantService.hasBasePrivilege( - EntityType.INSTITUTION, - PrivilegeType.READ_ONLY)) { - - // User has only institutional privilege, can see only the institution he/she belongs to - return Arrays.asList(getOwn()); - } else { - return this.institutionDAO.all(null, active).getOrThrow(); - } - } - } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/LmsSetupController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/LmsSetupController.java index a398e96d..9d20855e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/LmsSetupController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/LmsSetupController.java @@ -9,40 +9,36 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; import java.io.InputStream; -import java.util.Collection; import javax.servlet.http.HttpServletResponse; import org.apache.tomcat.util.http.fileupload.IOUtils; +import org.mybatis.dynamic.sql.SqlTable; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.web.bind.WebDataBinder; -import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup; -import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; +import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.LmsSetupRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; -import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.LmsSetupDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; @WebServiceProfile @RestController @RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_LMS_SETUP) public class LmsSetupController extends ActivatableEntityController { - private final LmsSetupDAO lmsSetupDAO; private final LmsAPIService lmsAPIService; public LmsSetupController( @@ -51,40 +47,31 @@ public class LmsSetupController extends ActivatableEntityController modifiedDataType() { + return LmsSetup.class; } - @RequestMapping(method = RequestMethod.GET) - public Collection getAll( - @RequestParam( - name = LmsSetup.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = LmsSetup.FILTER_ATTR_NAME, required = false) final String name, - @RequestParam(name = LmsSetup.FILTER_ATTR_LMS_TYPE, required = false) final LmsType lmsType, - @RequestParam(name = LmsSetup.FILTER_ATTR_ACTIVE, required = false) final Boolean active) { - - checkReadPrivilege(institutionId); - - return this.lmsSetupDAO - .allMatching(institutionId, name, lmsType, active) - .getOrThrow(); + @Override + protected SqlTable getSQLTableOfEntity() { + return LmsSetupRecordDynamicSqlSupport.lmsSetupRecord; } @RequestMapping( - path = "/create_seb_config/{id}", + path = "/SEB_Configuration/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) // TODO check if this is the right format public void downloadSEBConfig( diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/QuizImportController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/QuizImportController.java index f4d877d8..94914047 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/QuizImportController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/QuizImportController.java @@ -8,34 +8,22 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.Domain.LMS_SETUP; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page.SortOrder; -import ch.ethz.seb.sebserver.gbl.model.exam.Exam; import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.ActivityType; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate.OrderBy; @@ -50,26 +38,20 @@ public class QuizImportController { private final LmsAPIService lmsAPIService; private final AuthorizationGrantService authorizationGrantService; - private final UserActivityLogDAO userActivityLogDAO; - private final ExamDAO examDAO; public QuizImportController( @Value("${sebserver.webservice.api.pagination.defaultPageSize:10}") final int defaultPageSize, @Value("${sebserver.webservice.api.pagination.maxPageSize:500}") final int maxPageSize, final LmsAPIService lmsAPIService, - final AuthorizationGrantService authorizationGrantService, - final UserActivityLogDAO userActivityLogDAO, - final ExamDAO examDAO) { + final AuthorizationGrantService authorizationGrantService) { this.defaultPageSize = defaultPageSize; this.maxPageSize = maxPageSize; this.lmsAPIService = lmsAPIService; this.authorizationGrantService = authorizationGrantService; - this.userActivityLogDAO = userActivityLogDAO; - this.examDAO = examDAO; } - @RequestMapping(path = "/search", method = RequestMethod.GET) + @RequestMapping(method = RequestMethod.GET) public Page search( @RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId, @RequestParam(name = QuizData.FILTER_ATTR_NAME, required = false) final String nameLike, @@ -105,31 +87,31 @@ public class QuizImportController { : this.defaultPageSize); } - @RequestMapping(path = "/import", method = RequestMethod.POST) - public Collection importExam( - @RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId, - @RequestParam(name = QuizData.QUIZ_ATTR_ID, required = true) final String quizId) { - - this.authorizationGrantService.checkHasAnyPrivilege( - EntityType.EXAM, - PrivilegeType.WRITE); - - final LmsAPITemplate lmsAPITemplate = this.lmsAPIService - .createLmsAPITemplate(lmsSetupId) - .getOrThrow(); - - final Set ids = new HashSet<>(Arrays.asList( - StringUtils.split(quizId, Constants.LIST_SEPARATOR_CHAR))); - - return lmsAPITemplate.getQuizzes(ids) - .stream() - .map(result -> result.flatMap(quiz -> this.examDAO.importFromQuizData( - lmsAPITemplate.lmsSetup().institutionId, - lmsSetupId, - quiz))) - .flatMap(Result::skipOnError) - .peek(exam -> this.userActivityLogDAO.log(ActivityType.IMPORT, exam)) - .collect(Collectors.toList()); - } +// @RequestMapping(path = "/import", method = RequestMethod.POST) +// public Collection importExam( +// @RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId, +// @RequestParam(name = QuizData.QUIZ_ATTR_ID, required = true) final String quizId) { +// +// this.authorizationGrantService.checkHasAnyPrivilege( +// EntityType.EXAM, +// PrivilegeType.WRITE); +// +// final LmsAPITemplate lmsAPITemplate = this.lmsAPIService +// .createLmsAPITemplate(lmsSetupId) +// .getOrThrow(); +// +// final Set ids = new HashSet<>(Arrays.asList( +// StringUtils.split(quizId, Constants.LIST_SEPARATOR_CHAR))); +// +// return lmsAPITemplate.getQuizzes(ids) +// .stream() +// .map(result -> result.flatMap(quiz -> this.examDAO.importFromQuizData( +// lmsAPITemplate.lmsSetup().institutionId, +// lmsSetupId, +// quiz))) +// .flatMap(Result::skipOnError) +// .peek(exam -> this.userActivityLogDAO.log(ActivityType.IMPORT, exam)) +// .collect(Collectors.toList()); +// } } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserAccountController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserAccountController.java index 129073a3..50a40172 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserAccountController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserAccountController.java @@ -8,21 +8,12 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; -import java.util.Collection; -import java.util.function.Predicate; -import java.util.stream.Collectors; - +import org.mybatis.dynamic.sql.SqlTable; import org.springframework.context.ApplicationEventPublisher; -import org.springframework.web.bind.WebDataBinder; -import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import ch.ethz.seb.sebserver.gbl.model.EntityType; -import ch.ethz.seb.sebserver.gbl.model.Page; -import ch.ethz.seb.sebserver.gbl.model.user.UserFilter; import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; @@ -30,12 +21,10 @@ import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; -import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantEntity; -import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; -import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO; +import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService; import ch.ethz.seb.sebserver.webservice.weblayer.oauth.RevokeTokenEndpoint; @WebServiceProfile @@ -43,7 +32,6 @@ import ch.ethz.seb.sebserver.webservice.weblayer.oauth.RevokeTokenEndpoint; @RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_USER_ACCOUNT) public class UserAccountController extends ActivatableEntityController { - private final UserDAO userDao; private final ApplicationEventPublisher applicationEventPublisher; public UserAccountController( @@ -52,66 +40,18 @@ public class UserAccountController extends ActivatableEntityController getAll( - @RequestParam( - name = UserFilter.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = UserFilter.FILTER_ATTR_ACTIVE, required = false) final Boolean active, - @RequestParam(name = UserFilter.FILTER_ATTR_NAME, required = false) final String name, - @RequestParam(name = UserFilter.FILTER_ATTR_USER_NAME, required = false) final String username, - @RequestParam(name = UserFilter.FILTER_ATTR_EMAIL, required = false) final String email, - @RequestParam(name = UserFilter.FILTER_ATTR_LOCALE, required = false) final String locale) { - - checkReadPrivilege(institutionId); - - this.paginationService.setDefaultLimit(UserRecordDynamicSqlSupport.userRecord); - return getAll(createUserFilter(institutionId, active, name, username, email, locale)); - } - - @RequestMapping(path = "/page", method = RequestMethod.GET) - public Page getPage( - @RequestParam( - name = UserFilter.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = UserFilter.FILTER_ATTR_ACTIVE, required = false) final Boolean active, - @RequestParam(name = UserFilter.FILTER_ATTR_NAME, required = false) final String name, - @RequestParam(name = UserFilter.FILTER_ATTR_USER_NAME, required = false) final String username, - @RequestParam(name = UserFilter.FILTER_ATTR_EMAIL, required = false) final String email, - @RequestParam(name = UserFilter.FILTER_ATTR_LOCALE, required = false) final String locale, - @RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber, - @RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, - @RequestParam(name = Page.ATTR_SORT_BY, required = false) final String sortBy, - @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder) { - - checkReadPrivilege(institutionId); - - return this.paginationService.getPage( - pageNumber, - pageSize, - sortBy, - sortOrder, - UserRecordDynamicSqlSupport.userRecord, - () -> getAll(createUserFilter(institutionId, active, name, username, email, locale))); - - } - @RequestMapping(path = "/me", method = RequestMethod.GET) public UserInfo loggedInUser() { return this.authorizationGrantService @@ -120,6 +60,16 @@ public class UserAccountController extends ActivatableEntityController modifiedDataType() { + return UserMod.class; + } + + @Override + protected SqlTable getSQLTableOfEntity() { + return UserRecordDynamicSqlSupport.userRecord; + } + @Override protected Result notifySave(final UserMod userData, final UserInfo userInfo) { // handle password change; revoke access tokens if password has changed @@ -130,42 +80,4 @@ public class UserAccountController extends ActivatableEntityController getAll(final UserFilter userFilter) { - if (this.authorizationGrantService.hasBasePrivilege( - EntityType.USER, - PrivilegeType.READ_ONLY)) { - - return this.userDao - .allMatching(userFilter) - .getOrThrow(); - - } else { - - final Predicate grantFilter = this.authorizationGrantService.getGrantFilter( - EntityType.USER, - PrivilegeType.READ_ONLY); - - return this.userDao - .allMatching(userFilter) - .getOrThrow() - .stream() - .filter(grantFilter) - .collect(Collectors.toList()); - } - } - - private UserFilter createUserFilter( - final Long institutionId, - final Boolean active, - final String name, - final String username, - final String email, - final String locale) { - - return (institutionId != null || active != null || name != null || - username != null || email != null || locale != null) - ? new UserFilter(institutionId, name, username, email, active, locale) - : null; - } - } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserActivityLogController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserActivityLogController.java index 3051af92..bc7d4e71 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserActivityLogController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/UserActivityLogController.java @@ -8,31 +8,22 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import java.util.function.Predicate; -import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; +import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserRecordDynamicSqlSupport; -import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserActivityLogRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; @@ -66,53 +57,12 @@ public class UserActivityLogController { } @RequestMapping(method = RequestMethod.GET) - public Collection getAll( - @RequestParam( - name = UserActivityLog.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_FROM, - required = false) final String from, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_TO, - required = false) final String to, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, - required = false) final String activityTypes, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_ENTITY_TYPES, - required = false) final String entityTypes) { - - checkBaseReadPrivilege(institutionId); - this.paginationService.setDefaultLimit(UserActivityLogRecordDynamicSqlSupport.userActivityLogRecord); - return _getAll(institutionId, null, from, to, activityTypes, entityTypes); - } - - @RequestMapping(path = "/{userId}", method = RequestMethod.GET) - public Collection getAllForUser( - @PathVariable final String userId, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = UserActivityLog.FILTER_ATTR_FROM, required = false) final String from, - @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, - @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, - required = false) final String activityTypes, - @RequestParam(name = UserActivityLog.FILTER_ATTR_ENTITY_TYPES, required = false) final String entityTypes) { - - checkBaseReadPrivilege(institutionId); - this.paginationService.setDefaultLimit(UserActivityLogRecordDynamicSqlSupport.userActivityLogRecord); - return _getAll(institutionId, userId, from, to, activityTypes, entityTypes); - } - - @RequestMapping(path = "/page", method = RequestMethod.GET) public Page getPage( @RequestParam( name = UserActivityLog.FILTER_ATTR_INSTITUTION, required = true, defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, + @RequestParam(name = UserActivityLog.FILTER_ATTR_USER, required = false) final String userId, @RequestParam(name = UserActivityLog.FILTER_ATTR_FROM, required = false) final String from, @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, @@ -130,37 +80,37 @@ public class UserActivityLogController { sortBy, sortOrder, UserRecordDynamicSqlSupport.userRecord, - () -> _getAll(institutionId, null, from, to, activityTypes, entityTypes)); + () -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes)).getOrThrow(); } - @RequestMapping(path = "/page/{userId}", method = RequestMethod.GET) - public Page getPageForUser( - @PathVariable final String userId, - @RequestParam( - name = UserActivityLog.FILTER_ATTR_INSTITUTION, - required = true, - defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, - @RequestParam(name = UserActivityLog.FILTER_ATTR_FROM, required = false) final String from, - @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, - @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, - required = false) final String activityTypes, - @RequestParam(name = UserActivityLog.FILTER_ATTR_ENTITY_TYPES, required = false) final String entityTypes, - @RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber, - @RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, - @RequestParam(name = Page.ATTR_SORT_BY, required = false) final String sortBy, - @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder) { +// @RequestMapping(path = "/page/{userId}", method = RequestMethod.GET) +// public Page getPageForUser( +// @PathVariable final String userId, +// @RequestParam( +// name = UserActivityLog.FILTER_ATTR_INSTITUTION, +// required = true, +// defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, +// @RequestParam(name = UserActivityLog.FILTER_ATTR_FROM, required = false) final String from, +// @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, +// @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, +// required = false) final String activityTypes, +// @RequestParam(name = UserActivityLog.FILTER_ATTR_ENTITY_TYPES, required = false) final String entityTypes, +// @RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber, +// @RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, +// @RequestParam(name = Page.ATTR_SORT_BY, required = false) final String sortBy, +// @RequestParam(name = Page.ATTR_SORT_ORDER, required = false) final Page.SortOrder sortOrder) { +// +// checkBaseReadPrivilege(institutionId); +// return this.paginationService.getPage( +// pageNumber, +// pageSize, +// sortBy, +// sortOrder, +// UserRecordDynamicSqlSupport.userRecord, +// () -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes)); +// } - checkBaseReadPrivilege(institutionId); - return this.paginationService.getPage( - pageNumber, - pageSize, - sortBy, - sortOrder, - UserRecordDynamicSqlSupport.userRecord, - () -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes)); - } - - private Collection _getAll( + private Result> _getAll( final Long institutionId, final String userId, final String from, @@ -168,34 +118,19 @@ public class UserActivityLogController { final String activityTypes, final String entityTypes) { - final Set _activityTypes = (activityTypes != null) - ? Collections.unmodifiableSet(new HashSet<>( - Arrays.asList(StringUtils.split(activityTypes, Constants.LIST_SEPARATOR)))) - : null; - final Set _entityTypes = (entityTypes != null) - ? Collections.unmodifiableSet(new HashSet<>( - Arrays.asList(StringUtils.split(entityTypes, Constants.LIST_SEPARATOR)))) - : null; + return Result.tryCatch(() -> { - final Predicate filter = (_activityTypes != null || _entityTypes != null) - ? record -> { - if (_activityTypes != null && !_activityTypes.contains(record.getActivityType())) { - return false; - } - if (_entityTypes != null && !_entityTypes.contains(record.getEntityType())) { - return false; - } + this.paginationService.setDefaultLimitIfNotSet(); - return true; - } - : record -> true; - - return this.userActivityLogDAO.all( - institutionId, - userId, - Utils.toMilliSeconds(from), - Utils.toMilliSeconds(to), - filter).getOrThrow(); + return this.userActivityLogDAO.all( + institutionId, + userId, + Utils.toMilliSeconds(from), + Utils.toMilliSeconds(to), + activityTypes, + entityTypes, + log -> true).getOrThrow(); + }); } private void checkBaseReadPrivilege(final Long institutionId) { diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/batis/JodaTimeTypeResolverTest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/batis/JodaTimeTypeResolverTest.java index 06f1f4cb..b92778a9 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/batis/JodaTimeTypeResolverTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/batis/JodaTimeTypeResolverTest.java @@ -11,9 +11,13 @@ package ch.ethz.seb.sebserver.webservice.batis; import static org.junit.Assert.*; import static org.mockito.Mockito.when; +import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; +import org.codehaus.jackson.JsonParseException; +import org.codehaus.jackson.map.JsonMappingException; +import org.codehaus.jackson.map.ObjectMapper; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Test; @@ -88,4 +92,10 @@ public class JodaTimeTypeResolverTest { assertEquals(pointInTime, nullableResult); } + @Test + public void test() throws JsonParseException, JsonMappingException, IOException { + final Boolean readValue = new ObjectMapper().readValue("true", Boolean.class); + assertTrue(readValue); + } + } diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdminAPITestController.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdminAPITestController.java similarity index 90% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdminAPITestController.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdminAPITestController.java index ecb40d52..bbb362e0 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdminAPITestController.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdminAPITestController.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.admin; import java.security.Principal; diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdministrationAPIIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdministrationAPIIntegrationTester.java similarity index 84% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdministrationAPIIntegrationTest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdministrationAPIIntegrationTester.java index ba5beb27..c4bb87a5 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/AdministrationAPIIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/AdministrationAPIIntegrationTester.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.admin; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; @@ -25,6 +25,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.security.web.FilterChainProxy; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @@ -48,7 +49,7 @@ import ch.ethz.seb.sebserver.gbl.JSONMapper; webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ActiveProfiles("test") @AutoConfigureMockMvc -public abstract class AdministrationAPIIntegrationTest { +public abstract class AdministrationAPIIntegrationTester { @Value("${sebserver.webservice.api.admin.clientId}") protected String clientId; @@ -115,6 +116,8 @@ public abstract class AdministrationAPIIntegrationTest { private String accessToken; private HttpStatus expectedStatus; private HttpMethod httpMethod = HttpMethod.GET; + private MediaType contentType = MediaType.APPLICATION_FORM_URLENCODED; + private String body = null; public RestAPITestHelper withAccessToken(final String accessToken) { this.accessToken = accessToken; @@ -141,9 +144,20 @@ public abstract class AdministrationAPIIntegrationTest { return this; } + public RestAPITestHelper withBodyJson(final Object object) throws Exception { + this.contentType = MediaType.APPLICATION_JSON_UTF8; + this.body = AdministrationAPIIntegrationTester.this.jsonMapper.writeValueAsString(object); + return this; + } + + public void checkStatus() throws Exception { + this.getAsString(); + } + public String getAsString() throws Exception { - final ResultActions action = AdministrationAPIIntegrationTest.this.mockMvc + final ResultActions action = AdministrationAPIIntegrationTester.this.mockMvc .perform(requestBuilder()); + if (this.expectedStatus != null) { action.andExpect(status().is(this.expectedStatus.value())); } @@ -155,13 +169,13 @@ public abstract class AdministrationAPIIntegrationTest { } public T getAsObject(final TypeReference ref) throws Exception { - final ResultActions action = AdministrationAPIIntegrationTest.this.mockMvc + final ResultActions action = AdministrationAPIIntegrationTester.this.mockMvc .perform(requestBuilder()); if (this.expectedStatus != null) { action.andExpect(status().is(this.expectedStatus.value())); } - return AdministrationAPIIntegrationTest.this.jsonMapper.readValue( + return AdministrationAPIIntegrationTester.this.jsonMapper.readValue( action .andReturn() .getResponse() @@ -191,12 +205,21 @@ public abstract class AdministrationAPIIntegrationTest { get(getFullPath()); break; } - return builder.header("Authorization", "Bearer " + this.accessToken); + builder.header("Authorization", "Bearer " + this.accessToken); + + if (this.contentType != null) { + builder.contentType(this.contentType); + } + if (this.body != null) { + builder.content(this.body); + } + + return builder; } private String getFullPath() { final StringBuilder sb = new StringBuilder(); - sb.append(AdministrationAPIIntegrationTest.this.endpoint); + sb.append(AdministrationAPIIntegrationTester.this.endpoint); sb.append(this.path); if (!this.queryAttrs.isEmpty()) { sb.append("?"); @@ -211,7 +234,6 @@ public abstract class AdministrationAPIIntegrationTest { } return sb.toString(); } - } } diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralAdminAPITest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/GeneralAdminAPITest.java similarity index 93% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralAdminAPITest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/GeneralAdminAPITest.java index 0a530954..3bf7727c 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralAdminAPITest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/GeneralAdminAPITest.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.admin; import static org.junit.Assert.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -16,7 +16,7 @@ import java.io.UnsupportedEncodingException; import org.junit.Test; -public class GeneralAdminAPITest extends AdministrationAPIIntegrationTest { +public class GeneralAdminAPITest extends AdministrationAPIIntegrationTester { @Test public void getHello_givenNoToken_thenRedirect() throws Exception { diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/InstitutionAPITest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/InstitutionAPITest.java new file mode 100644 index 00000000..f605b517 --- /dev/null +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/InstitutionAPITest.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.integration.api.admin; + +import static org.junit.Assert.*; + +import java.util.Collection; + +import org.junit.Test; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.test.context.jdbc.Sql; + +import com.fasterxml.jackson.core.type.TypeReference; + +import ch.ethz.seb.sebserver.gbl.model.APIMessage; +import ch.ethz.seb.sebserver.gbl.model.Page; +import ch.ethz.seb.sebserver.gbl.model.institution.Institution; +import ch.ethz.seb.sebserver.webservice.weblayer.api.RestAPI; + +@Sql(scripts = { "classpath:schema-test.sql", "classpath:data-test.sql" }) +public class InstitutionAPITest extends AdministrationAPIIntegrationTester { + + @Test + public void getInstitutions() throws Exception { + Page institutions = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference>() { + }); + + assertNotNull(institutions); + assertTrue(institutions.content.size() == 3); + assertContainsInstitution("Institution1", institutions.content); + assertContainsInstitution("Institution3", institutions.content); + + institutions = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withAttribute("active", "true") + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference>() { + }); + + assertNotNull(institutions); + assertTrue(institutions.content.size() == 2); + assertContainsInstitution("Institution1", institutions.content); + assertContainsInstitution("Institution2", institutions.content); + + institutions = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withAttribute("active", "false") + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference>() { + }); + + assertNotNull(institutions); + assertTrue(institutions.content.size() == 1); + assertContainsInstitution("Institution3", institutions.content); + + // institutional admin sees only his institution + institutions = new RestAPITestHelper() + .withAccessToken(getAdminInstitution1Access()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference>() { + }); + + assertNotNull(institutions); + assertTrue(institutions.content.size() == 1); + assertContainsInstitution("Institution1", institutions.content); + + final APIMessage errorMessage = new RestAPITestHelper() + .withAccessToken(getAdminInstitution1Access()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withAttribute("institution", "2") // try to hack + .withExpectedStatus(HttpStatus.FORBIDDEN) + .getAsObject(new TypeReference() { + }); + + assertNotNull(errorMessage); + assertEquals("1001", errorMessage.messageCode); + } + + @Test + public void getInstitutionById() throws Exception { + Institution institution = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION + "/1") + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference() { + }); + + assertNotNull(institution); + assertTrue(institution.id.longValue() == 1); + + // a seb-admin is also able to get an institution that is not the one he self belongs to + institution = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION + "/2") + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference() { + }); + + assertNotNull(institution); + assertTrue(institution.id.longValue() == 2); + + // but a institutional-admin is not able to get an institution that is not the one he self belongs to + new RestAPITestHelper() + .withAccessToken(getAdminInstitution1Access()) + .withPath(RestAPI.ENDPOINT_INSTITUTION + "/2") + .withExpectedStatus(HttpStatus.FORBIDDEN) + .getAsString(); + } + + @Test + public void createNewInstitution() throws Exception { + // create new institution with seb-admin + final Institution institution = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withMethod(HttpMethod.POST) + .withAttribute("name", "new institution") + .withAttribute("urlSuffix", "new_inst") + .withAttribute("active", "false") + .withExpectedStatus(HttpStatus.OK) + .getAsObject(new TypeReference() { + }); + + assertNotNull(institution); + assertNotNull(institution.id); + assertEquals("new institution", institution.name); + + // an institutional admin should not be allowed to create a new institution + APIMessage errorMessage = new RestAPITestHelper() + .withAccessToken(getAdminInstitution1Access()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withMethod(HttpMethod.POST) + .withAttribute("name", "new institution") + .withAttribute("urlSuffix", "new_inst") + .withAttribute("active", "false") + .withExpectedStatus(HttpStatus.FORBIDDEN) + .getAsObject(new TypeReference() { + }); + + // and predefined id should not be possible + errorMessage = new RestAPITestHelper() + .withAccessToken(getSebAdminAccess()) + .withPath(RestAPI.ENDPOINT_INSTITUTION) + .withMethod(HttpMethod.POST) + .withAttribute("id", "123") + .withAttribute("name", "new institution") + .withAttribute("urlSuffix", "new_inst") + .withAttribute("active", "false") + .withExpectedStatus(HttpStatus.BAD_REQUEST) + .getAsObject(new TypeReference() { + }); + + assertNotNull(errorMessage); + assertEquals("1010", errorMessage.messageCode); + } + +// @Test +// public void createActivateModifyDeactivateAndDeleteInstitution() throws Exception { +// final Institution institution = new RestAPITestHelper() +// .withAccessToken(getSebAdminAccess()) +// .withPath(RestAPI.ENDPOINT_INSTITUTION + "/create") +// .withMethod(HttpMethod.PUT) +// .withBodyJson(new Institution(null, )) +// .withExpectedStatus(HttpStatus.OK) +// +// .getAsObject(new TypeReference() { +// }); +// } + + static void assertContainsInstitution(final String name, final Collection institutions) { + assert institutions != null; + assert institutions.stream() + .filter(inst -> inst.name.equals(name)) + .findFirst() + .isPresent(); + } +} diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserAPITest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserAPITest.java similarity index 79% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserAPITest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserAPITest.java index a1f14f9e..5a326d94 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserAPITest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserAPITest.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.admin; import static org.junit.Assert.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; @@ -32,6 +32,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.APIMessage; +import ch.ethz.seb.sebserver.gbl.model.Domain; import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKeyAndName; import ch.ethz.seb.sebserver.gbl.model.EntityProcessingReport; @@ -44,7 +45,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.Acti import ch.ethz.seb.sebserver.webservice.weblayer.api.RestAPI; @Sql(scripts = { "classpath:schema-test.sql", "classpath:data-test.sql" }) -public class UserAPITest extends AdministrationAPIIntegrationTest { +public class UserAPITest extends AdministrationAPIIntegrationTester { @Test public void getMyUserInfo() throws Exception { @@ -130,35 +131,35 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { @Test public void getAllUserInfoNoFilter() throws Exception { - List userInfos = new RestAPITestHelper() + Page userInfos = new RestAPITestHelper() .withAccessToken(getSebAdminAccess()) .withPath(RestAPI.ENDPOINT_USER_ACCOUNT) .withExpectedStatus(HttpStatus.OK) - .getAsObject(new TypeReference>() { + .getAsObject(new TypeReference>() { }); // expecting all users for a SEBAdmin except inactive. assertNotNull(userInfos); - assertTrue(userInfos.size() == 3); - assertNotNull(getUserInfo("admin", userInfos)); - assertNotNull(getUserInfo("inst1Admin", userInfos)); - assertNotNull(getUserInfo("examSupporter", userInfos)); + assertTrue(userInfos.content.size() == 3); + assertNotNull(getUserInfo("admin", userInfos.content)); + assertNotNull(getUserInfo("inst1Admin", userInfos.content)); + assertNotNull(getUserInfo("examSupporter", userInfos.content)); userInfos = new RestAPITestHelper() .withAccessToken(getAdminInstitution2Access()) .withPath(RestAPI.ENDPOINT_USER_ACCOUNT) .withAttribute("institution", "2") .withExpectedStatus(HttpStatus.OK) - .getAsObject(new TypeReference>() { + .getAsObject(new TypeReference>() { }); // expecting all users of institution 2 also inactive when active flag is not set assertNotNull(userInfos); - assertTrue(userInfos.size() == 4); - assertNotNull(getUserInfo("inst2Admin", userInfos)); - assertNotNull(getUserInfo("examAdmin1", userInfos)); - assertNotNull(getUserInfo("deactivatedUser", userInfos)); - assertNotNull(getUserInfo("user1", userInfos)); + assertTrue(userInfos.content.size() == 4); + assertNotNull(getUserInfo("inst2Admin", userInfos.content)); + assertNotNull(getUserInfo("examAdmin1", userInfos.content)); + assertNotNull(getUserInfo("deactivatedUser", userInfos.content)); + assertNotNull(getUserInfo("user1", userInfos.content)); //.. and without inactive, if active flag is set to true userInfos = new RestAPITestHelper() @@ -167,14 +168,14 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { .withAttribute("institution", "2") .withAttribute("active", "true") .withExpectedStatus(HttpStatus.OK) - .getAsObject(new TypeReference>() { + .getAsObject(new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 3); - assertNotNull(getUserInfo("inst2Admin", userInfos)); - assertNotNull(getUserInfo("examAdmin1", userInfos)); - assertNotNull(getUserInfo("user1", userInfos)); + assertTrue(userInfos.content.size() == 3); + assertNotNull(getUserInfo("inst2Admin", userInfos.content)); + assertNotNull(getUserInfo("examAdmin1", userInfos.content)); + assertNotNull(getUserInfo("user1", userInfos.content)); //.. and only inactive, if active flag is set to false userInfos = new RestAPITestHelper() @@ -183,12 +184,12 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { .withAttribute("institution", "2") .withAttribute("active", "false") .withExpectedStatus(HttpStatus.OK) - .getAsObject(new TypeReference>() { + .getAsObject(new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 1); - assertNotNull(getUserInfo("deactivatedUser", userInfos)); + assertTrue(userInfos.content.size() == 1); + assertNotNull(getUserInfo("deactivatedUser", userInfos.content)); } @@ -199,7 +200,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final String token = getSebAdminAccess(); final Page userInfos = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/page") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -220,7 +222,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final String token = getSebAdminAccess(); final Page userInfos = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/page?institution=2") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -238,7 +241,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { public void getPageNoFilterNoPageAttributesDescendingOrder() throws Exception { final String token = getSebAdminAccess(); final Page userInfos = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/page?sort_order=DESCENDING") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?sort_order=DESCENDING") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -260,7 +264,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { Page userInfos = this.jsonMapper.readValue( this.mockMvc .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT - + "/page?page_number=1&page_size=3&institution=2") + + "?page_number=1&page_size=3&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -277,7 +282,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { userInfos = this.jsonMapper.readValue( this.mockMvc .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT - + "/page?page_number=2&page_size=3&institution=2") + + "?page_number=2&page_size=3&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -295,7 +301,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { userInfos = this.jsonMapper.readValue( this.mockMvc .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT - + "/page?page_number=3&page_size=3&institution=2") + + "?page_number=3&page_size=3&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -313,7 +320,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { userInfos = this.jsonMapper.readValue( this.mockMvc .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT - + "/page?page_number=1&page_size=3&sort_order=DESCENDING&institution=2") + + "?page_number=1&page_size=3&sort_order=DESCENDING&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -338,32 +346,34 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { @Test public void getAllUserInfo() throws Exception { final String token = getSebAdminAccess(); - final List userInfos = this.jsonMapper.readValue( + final Page userInfos = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 3); + assertTrue(userInfos.content.size() == 3); } @Test public void getAllUserInfoWithOnlyActive() throws Exception { final String token = getSebAdminAccess(); - final List userInfos = this.jsonMapper.readValue( + final Page userInfos = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?active=true&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 3); - assertNull(getUserInfo("deactivatedUser", userInfos)); + assertTrue(userInfos.content.size() == 3); + assertNull(getUserInfo("deactivatedUser", userInfos.content)); } @Test @@ -371,45 +381,48 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // expecting none for SEBAdmins institution final String token = getSebAdminAccess(); - List userInfos = this.jsonMapper.readValue( + Page userInfos = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?active=false") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 0); + assertTrue(userInfos.content.size() == 0); // expecting one for institution 2 userInfos = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?active=false&institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 1); - assertNotNull(getUserInfo("deactivatedUser", userInfos)); + assertTrue(userInfos.content.size() == 1); + assertNotNull(getUserInfo("deactivatedUser", userInfos.content)); } @Test public void getAllUserInfoWithSearchUsernameLike() throws Exception { final String token = getSebAdminAccess(); - final List userInfos = this.jsonMapper.readValue( + final Page userInfos = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "?username=exam") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userInfos); - assertTrue(userInfos.size() == 1); - assertNotNull(getUserInfo("examSupporter", userInfos)); + assertTrue(userInfos.content.size() == 1); + assertNotNull(getUserInfo("examSupporter", userInfos.content)); } @Test @@ -423,19 +436,15 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { @Test public void createUserTest() throws Exception { - final UserInfo userInfo = new UserInfo( - null, 1L, "NewTestUser", "NewTestUser", - "", true, Locale.CANADA, DateTimeZone.UTC, - new HashSet<>(Arrays.asList(UserRole.EXAM_ADMIN.name()))); - final UserMod newUser = new UserMod(userInfo, "12345678", "12345678"); - final String newUserJson = this.jsonMapper.writeValueAsString(newUser); final String token = getSebAdminAccess(); final UserInfo createdUser = this.jsonMapper.readValue( - this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/create") + this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + token) - .contentType(MediaType.APPLICATION_JSON_UTF8) - .content(newUserJson)) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param(Domain.USER.ATTR_NAME, "NewTestUser") + .param(UserMod.ATTR_NAME_NEW_PASSWORD, "12345678") + .param(UserMod.ATTR_NAME_RETYPED_NEW_PASSWORD, "12345678")) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), new TypeReference() { @@ -458,19 +467,20 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { assertFalse(createdUserGet.isActive()); // check user activity log for newly created user - final List logs = this.jsonMapper.readValue( + final Page logs = this.jsonMapper.readValue( this.mockMvc .perform( - get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user1?activity_types=CREATE") - .header("Authorization", "Bearer " + token)) + get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + + "?user=user1&activity_types=CREATE") + .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(1 == logs.size()); - final UserActivityLog userActivityLog = logs.get(0); + assertTrue(1 == logs.content.size()); + final UserActivityLog userActivityLog = logs.content.iterator().next(); assertEquals("user1", userActivityLog.userUUID); assertEquals("USER", userActivityLog.entityType.name()); assertEquals("CREATE", userActivityLog.activityType.name()); @@ -537,7 +547,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // } @Test - public void modifyUserTest() throws Exception { + public void modifyUserWithPUTMethod() throws Exception { final String token = getSebAdminAccess(); final UserInfo user = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user7") @@ -568,7 +578,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final String modifyUserJson = this.jsonMapper.writeValueAsString(modifyUser); UserInfo modifiedUserResult = this.jsonMapper.readValue( - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + token) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(modifyUserJson)) @@ -601,7 +611,41 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { } @Test - public void testOwnerModifyPossible() throws Exception { + public void modifyUserWithPOSTMethod() throws Exception { + final String token = getSebAdminAccess(); + + final UserInfo modifiedUser = this.jsonMapper.readValue( + this.mockMvc.perform(patch(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user4") + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param("name", "PostModifyTest")) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(), + new TypeReference() { + }); + + assertNotNull(modifiedUser); + assertEquals("PostModifyTest", modifiedUser.name); + + // check validation + final Collection errors = this.jsonMapper.readValue( + this.mockMvc.perform(patch(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user4") + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param("name", "P")) + .andExpect(status().isBadRequest()) + .andReturn().getResponse().getContentAsString(), + new TypeReference>() { + }); + + assertNotNull(errors); + assertFalse(errors.isEmpty()); + final APIMessage error = errors.iterator().next(); + assertEquals("1200", error.messageCode); + } + + @Test + public void testOwnerModifyPossibleForExamAdmin() throws Exception { final String examAdminToken1 = getExamAdmin1(); final UserInfo examAdmin = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/me") @@ -614,33 +658,43 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final UserMod modifiedUser = new UserMod(examAdmin, null, null); final String modifiedUserJson = this.jsonMapper.writeValueAsString(modifiedUser); - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + examAdminToken1) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(modifiedUserJson)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(); - } @Test public void institutionalAdminTryToCreateOrModifyUserForOtherInstituionNotPossible() throws Exception { + + final String token = getAdminInstitution1Access(); + this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param(Domain.USER.ATTR_INSTITUTION_ID, "2") + .param(Domain.USER.ATTR_NAME, "NewTestUser") + .param(UserMod.ATTR_NAME_NEW_PASSWORD, "12345678") + .param(UserMod.ATTR_NAME_RETYPED_NEW_PASSWORD, "12345678")) + .andExpect(status().isForbidden()) + .andReturn().getResponse().getContentAsString(); + + this.mockMvc.perform(patch(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user4") + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param(Domain.USER.ATTR_INSTITUTION_ID, "2") + .param(Domain.USER.ATTR_NAME, "NewTestUser")) + .andExpect(status().isForbidden()) + .andReturn().getResponse().getContentAsString(); + final UserInfo userInfo = new UserInfo( null, 2L, "NewTestUser", "NewTestUser", "", true, Locale.CANADA, DateTimeZone.UTC, new HashSet<>(Arrays.asList(UserRole.EXAM_ADMIN.name()))); final UserMod newUser = new UserMod(userInfo, "12345678", "12345678"); final String newUserJson = this.jsonMapper.writeValueAsString(newUser); - - final String token = getAdminInstitution1Access(); - this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/create") - .header("Authorization", "Bearer " + token) - .contentType(MediaType.APPLICATION_JSON_UTF8) - .content(newUserJson)) - .andExpect(status().isForbidden()) - .andReturn().getResponse().getContentAsString(); - - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + token) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(newUserJson)) @@ -650,22 +704,35 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { @Test public void unauthorizedAdminTryToCreateUserNotPossible() throws Exception { + + final String token = getExamAdmin1(); + this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param(Domain.USER.ATTR_INSTITUTION_ID, "2") + .param(Domain.USER.ATTR_NAME, "NewTestUser") + .param(UserMod.ATTR_NAME_NEW_PASSWORD, "12345678") + .param(UserMod.ATTR_NAME_RETYPED_NEW_PASSWORD, "12345678")) + .andExpect(status().isForbidden()) + .andReturn().getResponse().getContentAsString(); + + this.mockMvc.perform(patch(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user3") + .header("Authorization", "Bearer " + token) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .param(Domain.USER.ATTR_INSTITUTION_ID, "2") + .param(Domain.USER.ATTR_NAME, "NewTestUser") + .param(UserMod.ATTR_NAME_NEW_PASSWORD, "12345678") + .param(UserMod.ATTR_NAME_RETYPED_NEW_PASSWORD, "12345678")) + .andExpect(status().isForbidden()) + .andReturn().getResponse().getContentAsString(); + final UserInfo userInfo = new UserInfo( null, 2L, "NewTestUser", "NewTestUser", "", true, Locale.CANADA, DateTimeZone.UTC, new HashSet<>(Arrays.asList(UserRole.EXAM_ADMIN.name()))); final UserMod newUser = new UserMod(userInfo, "12345678", "12345678"); final String newUserJson = this.jsonMapper.writeValueAsString(newUser); - - final String token = getExamAdmin1(); - this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/create") - .header("Authorization", "Bearer " + token) - .contentType(MediaType.APPLICATION_JSON_UTF8) - .content(newUserJson)) - .andExpect(status().isForbidden()) - .andReturn().getResponse().getContentAsString(); - - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + token) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(newUserJson)) @@ -694,7 +761,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { "newPassword"); final String modifiedUserJson = this.jsonMapper.writeValueAsString(modifiedUser); - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + sebAdminToken) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(modifiedUserJson)) @@ -742,7 +809,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { String modifiedUserJson = this.jsonMapper.writeValueAsString(modifiedUser); List messages = this.jsonMapper.readValue( - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + sebAdminToken) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(modifiedUserJson)) @@ -764,7 +831,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { modifiedUserJson = this.jsonMapper.writeValueAsString(modifiedUser); messages = this.jsonMapper.readValue( - this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/save") + this.mockMvc.perform(put(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT) .header("Authorization", "Bearer " + sebAdminToken) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(modifiedUserJson)) @@ -784,6 +851,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // only a SEB Administrator or an Institutional administrator should be able to deactivate a user-account final String examAdminToken = getExamAdmin1(); this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user4/deactivate") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + examAdminToken)) .andExpect(status().isForbidden()); @@ -791,6 +859,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final String sebAdminToken = getSebAdminAccess(); final EntityProcessingReport report = this.jsonMapper.readValue( this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user4/deactivate") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -807,6 +876,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final EntityKey key = report.source.iterator().next(); final UserInfo user = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/" + key.modelId) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -817,17 +887,20 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { assertFalse(user.isActive()); // check also user activity log - final Collection userLogs = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user1?from=" + timeNow) - .header("Authorization", "Bearer " + sebAdminToken)) + final Page userLogs = this.jsonMapper.readValue( + this.mockMvc + .perform( + get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/?user=user1&from=" + timeNow) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) + .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userLogs); - assertTrue(userLogs.size() == 1); - final UserActivityLog userLog = userLogs.iterator().next(); + assertTrue(userLogs.content.size() == 1); + final UserActivityLog userLog = userLogs.content.iterator().next(); assertEquals(ActivityType.DEACTIVATE, userLog.activityType); assertEquals("user4", userLog.entityId); } @@ -838,6 +911,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // only a SEB Administrator or an Institutional administrator should be able to deactivate a user-account final String examAdminToken = getExamAdmin1(); this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user6/activate") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + examAdminToken)) .andExpect(status().isForbidden()); @@ -845,6 +919,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final String sebAdminToken = getSebAdminAccess(); final EntityProcessingReport report = this.jsonMapper.readValue( this.mockMvc.perform(post(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/user6/activate") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -861,6 +936,7 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { final EntityKey key = report.source.iterator().next(); final UserInfo user = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/" + key.modelId) + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -871,17 +947,18 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { assertTrue(user.isActive()); // check also user activity log - final Collection userLogs = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user1?from=" + timeNow) - .header("Authorization", "Bearer " + sebAdminToken)) + final Page userLogs = this.jsonMapper.readValue( + this.mockMvc + .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?user=user1&from=" + timeNow) + .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(userLogs); - assertTrue(userLogs.size() == 1); - final UserActivityLog userLog = userLogs.iterator().next(); + assertTrue(userLogs.content.size() == 1); + final UserActivityLog userLog = userLogs.content.iterator().next(); assertEquals(ActivityType.ACTIVATE, userLog.activityType); assertEquals("user6", userLog.entityId); } @@ -892,7 +969,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // all active for the own institution Page usersPage = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/active") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/all/active") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -905,7 +983,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // all inactive of the own institution usersPage = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/inactive") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/all/inactive") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -918,7 +997,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // all active of institution 2 usersPage = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/active?institution=2") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/all/active?institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), @@ -931,7 +1011,8 @@ public class UserAPITest extends AdministrationAPIIntegrationTest { // all inactive of institution 2 usersPage = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/inactive?institution=2") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACCOUNT + "/all/inactive?institution=2") + .contentType(MediaType.APPLICATION_FORM_URLENCODED) .header("Authorization", "Bearer " + sebAdminToken)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserActivityLogAPITest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserActivityLogAPITest.java similarity index 77% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserActivityLogAPITest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserActivityLogAPITest.java index ba47a9ff..a7d125cc 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/UserActivityLogAPITest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/admin/UserActivityLogAPITest.java @@ -6,14 +6,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.admin; import static org.junit.Assert.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import java.util.List; - import org.joda.time.DateTime; import org.junit.Test; import org.springframework.test.context.jdbc.Sql; @@ -21,53 +19,55 @@ import org.springframework.test.context.jdbc.Sql; import com.fasterxml.jackson.core.type.TypeReference; import ch.ethz.seb.sebserver.gbl.Constants; +import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog; import ch.ethz.seb.sebserver.webservice.weblayer.api.RestAPI; @Sql(scripts = { "classpath:schema-test.sql", "classpath:data-test.sql" }) -public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { +public class UserActivityLogAPITest extends AdministrationAPIIntegrationTester { @Test public void getAllAsSEBAdmin() throws Exception { final String token = getSebAdminAccess(); - final List logs = this.jsonMapper.readValue( + final Page logs = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); } @Test public void getAllAsSEBAdminForUser() throws Exception { final String token = getSebAdminAccess(); // for a user in another institution, the institution has to be defined - List logs = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user4?institution=2") - .header("Authorization", "Bearer " + token)) + Page logs = this.jsonMapper.readValue( + this.mockMvc + .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?user=user4&institution=2") + .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); // for a user in the same institution no institution is needed logs = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user2") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?user=user2") .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(1 == logs.size()); + assertTrue(1 == logs.content.size()); } @Test @@ -80,17 +80,17 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { final String sec6 = zeroDate.plus(6000).toString(Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS); final String token = getSebAdminAccess(); - List logs = this.jsonMapper.readValue( + Page logs = this.jsonMapper.readValue( this.mockMvc.perform( get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?institution=2&from=" + sec2) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(3 == logs.size()); + assertTrue(3 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -99,11 +99,11 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(1 == logs.size()); + assertTrue(1 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -112,11 +112,11 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -125,26 +125,26 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(3 == logs.size()); + assertTrue(3 == logs.content.size()); } @Test public void getAllAsSEBAdminForActivityType() throws Exception { final String token = getSebAdminAccess(); - List logs = this.jsonMapper.readValue( + Page logs = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?activity_types=CREATE") .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(1 == logs.size()); + assertTrue(1 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -154,11 +154,11 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); // for other institution (2) logs = this.jsonMapper.readValue( @@ -169,27 +169,27 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(3 == logs.size()); + assertTrue(3 == logs.content.size()); } @Test public void getAllAsSEBAdminForEntityType() throws Exception { final String token = getSebAdminAccess(); - List logs = this.jsonMapper.readValue( + Page logs = this.jsonMapper.readValue( this.mockMvc .perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?entity_types=INSTITUTION") .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(1 == logs.size()); + assertTrue(1 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -199,11 +199,11 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); logs = this.jsonMapper.readValue( this.mockMvc @@ -213,26 +213,26 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(3 == logs.size()); + assertTrue(3 == logs.content.size()); } @Test public void getAllAsInstitutionalAdmin() throws Exception { final String token = getAdminInstitution1Access(); - final List logs = this.jsonMapper.readValue( + final Page logs = this.jsonMapper.readValue( this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG) .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(2 == logs.size()); + assertTrue(2 == logs.content.size()); } @Test @@ -244,22 +244,22 @@ public class UserActivityLogAPITest extends AdministrationAPIIntegrationTest { .header("Authorization", "Bearer " + token)) .andExpect(status().isForbidden()); // no privilege at all - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user4") + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?user=user4") .header("Authorization", "Bearer " + token)) .andExpect(status().isForbidden()); // no privilege to query logs of users of other institution token = getAdminInstitution1Access(); - final List logs = this.jsonMapper.readValue( - this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "/user4") + final Page logs = this.jsonMapper.readValue( + this.mockMvc.perform(get(this.endpoint + RestAPI.ENDPOINT_USER_ACTIVITY_LOG + "?user=user4") .header("Authorization", "Bearer " + token)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(), - new TypeReference>() { + new TypeReference>() { }); assertNotNull(logs); - assertTrue(logs.isEmpty()); + assertTrue(logs.content.isEmpty()); } } diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPIIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPIIntegrationTester.java similarity index 94% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPIIntegrationTest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPIIntegrationTester.java index b99ce2ca..2cc5c2af 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPIIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPIIntegrationTester.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.exam; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -39,7 +39,7 @@ import ch.ethz.seb.sebserver.gbl.JSONMapper; webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ActiveProfiles("test") @AutoConfigureMockMvc -public abstract class ExamAPIIntegrationTest { +public abstract class ExamAPIIntegrationTester { @Value("${sebserver.webservice.api.exam.endpoint}") protected String endpoint; diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPITestController.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPITestController.java similarity index 92% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPITestController.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPITestController.java index 8d0c58eb..109ad986 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/ExamAPITestController.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamAPITestController.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.exam; import java.util.Set; diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralExamAPITest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/GeneralExamAPITest.java similarity index 91% rename from src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralExamAPITest.java rename to src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/GeneralExamAPITest.java index d6ef61f1..61bc4321 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/GeneralExamAPITest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/GeneralExamAPITest.java @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package ch.ethz.seb.sebserver.webservice.integration.api; +package ch.ethz.seb.sebserver.webservice.integration.api.exam; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -17,7 +17,7 @@ import java.io.UnsupportedEncodingException; import org.junit.Test; -public class GeneralExamAPITest extends ExamAPIIntegrationTest { +public class GeneralExamAPITest extends ExamAPIIntegrationTester { @Test public void getHello_givenNoToken_thenUnauthorized() throws Exception { diff --git a/src/test/resources/data-test.sql b/src/test/resources/data-test.sql index 9727c0a5..d347908b 100644 --- a/src/test/resources/data-test.sql +++ b/src/test/resources/data-test.sql @@ -1,6 +1,7 @@ INSERT INTO institution VALUES (1, 'Institution1', 'inst1', null, 1), - (2, 'Institution2', 'inst2', null, 1) + (2, 'Institution2', 'inst2', null, 1), + (3, 'Institution3', 'inst3', null, 0) ; INSERT INTO user VALUES