refactoring -> generalization of REST API and controller
This commit is contained in:
parent
f955377f48
commit
f5d461157e
106 changed files with 2404 additions and 1807 deletions
|
@ -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")
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
|
||||
package ch.ethz.seb.sebserver.gbl.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public interface Activatable {
|
||||
|
||||
@JsonIgnore
|
||||
boolean isActive();
|
||||
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
|
||||
package ch.ethz.seb.sebserver.gbl.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public interface ModelIdAware {
|
||||
|
||||
@JsonIgnore
|
||||
String getModelId();
|
||||
|
||||
}
|
||||
|
|
|
@ -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<T> {
|
|||
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<T> {
|
|||
public final SortOrder sortOrder;
|
||||
|
||||
@JsonProperty(ATTR_CONTENT)
|
||||
public final Collection<T> content;
|
||||
public final List<T> content;
|
||||
|
||||
@JsonCreator
|
||||
public Page(
|
||||
|
@ -53,7 +55,7 @@ public final class Page<T> {
|
|||
|
||||
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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<Threshold> 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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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<String> 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;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,12 @@ import ch.ethz.seb.sebserver.gbl.Constants;
|
|||
|
||||
public final class Utils {
|
||||
|
||||
public static <T> List<T> immutableListOf(final Collection<T> collection) {
|
||||
return (collection != null)
|
||||
? Collections.unmodifiableList(new ArrayList<>(collection))
|
||||
: Collections.emptyList();
|
||||
}
|
||||
|
||||
public static <T> Collection<T> immutableCollectionOf(final Collection<T> collection) {
|
||||
return (collection != null)
|
||||
? Collections.unmodifiableCollection(collection)
|
||||
|
@ -72,6 +78,12 @@ public final class Utils {
|
|||
: Collections.emptyList();
|
||||
}
|
||||
|
||||
public static Map<String, String> immutableMapOf(final Map<String, String> params) {
|
||||
return (params != null)
|
||||
? Collections.unmodifiableMap(params)
|
||||
: Collections.emptyMap();
|
||||
}
|
||||
|
||||
public static <T extends Enum<T>> Collection<Tuple<String>> createSelectionResource(final Class<T> 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<Long> dateTimeStringToTimestamp(final String startTime) {
|
||||
return Result.tryCatch(() -> {
|
||||
return DateTime.parse(startTime, Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS).getMillis();
|
||||
|
|
|
@ -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<ApplicationReadyEvent> {
|
||||
|
||||
|
@ -29,5 +27,4 @@ public class WebServiceInit implements ApplicationListener<ApplicationReadyEvent
|
|||
// TODO whatever has to be initialized for the web-service component right after startup comes here
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,24 +63,9 @@ public class JodaTimeTypeResolver extends BaseTypeHandler<DateTime> {
|
|||
}
|
||||
|
||||
private DateTime getDateTime(final SupplierSQLExceptionAware<String> 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<DateTime> {
|
|||
}
|
||||
}
|
||||
|
||||
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<T> {
|
||||
public interface SupplierSQLExceptionAware<T> {
|
||||
T get() throws SQLException;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<Boolean> 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<String> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ClientConnectionRecord> 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<ClientConnectionRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ClientConnectionRecord>>> 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<MyBatis3SelectModelAdapter<List<ClientConnectionRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<Integer> 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<Long> 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<BigDecimal> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ClientEventRecord> 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<ClientEventRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ClientEventRecord>>> 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<MyBatis3SelectModelAdapter<List<ClientEventRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<String> 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<String> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ConfigurationAttributeRecord> 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<ConfigurationAttributeRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ConfigurationAttributeRecord>>> 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<MyBatis3SelectModelAdapter<List<ConfigurationAttributeRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<String> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ConfigurationNodeRecord> 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<ConfigurationNodeRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ConfigurationNodeRecord>>> 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<MyBatis3SelectModelAdapter<List<ConfigurationNodeRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<DateTime> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ConfigurationRecord> 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<ConfigurationRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ConfigurationRecord>>> 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<MyBatis3SelectModelAdapter<List<ConfigurationRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<Long> 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<Integer> 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<String> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ConfigurationValueRecord> 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<ConfigurationValueRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ConfigurationValueRecord>>> 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<MyBatis3SelectModelAdapter<List<ConfigurationValueRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<Long> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ExamConfigurationMapRecord> 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<ExamConfigurationMapRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ExamConfigurationMapRecord>>> 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<MyBatis3SelectModelAdapter<List<ExamConfigurationMapRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<String> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ExamRecord> 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<ExamRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ExamRecord>>> 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<MyBatis3SelectModelAdapter<List<ExamRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<IndicatorRecord> 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<IndicatorRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<IndicatorRecord>>> 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<MyBatis3SelectModelAdapter<List<IndicatorRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<String> 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<String> 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<Integer> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<InstitutionRecord> 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<InstitutionRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<InstitutionRecord>>> 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<MyBatis3SelectModelAdapter<List<InstitutionRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<LmsSetupRecord> 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<LmsSetupRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<LmsSetupRecord>>> 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<MyBatis3SelectModelAdapter<List<LmsSetupRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<Integer> 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<Integer> 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<Integer> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<OrientationRecord> 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<OrientationRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<OrientationRecord>>> 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<MyBatis3SelectModelAdapter<List<OrientationRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<RoleRecord> 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<RoleRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<RoleRecord>>> 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<MyBatis3SelectModelAdapter<List<RoleRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<BigDecimal> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<ThresholdRecord> 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<ThresholdRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<ThresholdRecord>>> 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<MyBatis3SelectModelAdapter<List<ThresholdRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<String> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<UserActivityLogRecord> 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<UserActivityLogRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<UserActivityLogRecord>>> 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<MyBatis3SelectModelAdapter<List<UserActivityLogRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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<Long> 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<Long> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<Integer> 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<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
|
|
|
@ -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<UserRecord> 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<UserRecord> 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<MyBatis3SelectModelAdapter<Long>> 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<MyBatis3DeleteModelAdapter<Integer>> 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<MyBatis3SelectModelAdapter<List<UserRecord>>> 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<MyBatis3SelectModelAdapter<List<UserRecord>>> 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<MyBatis3UpdateModelAdapter<Integer>> 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<MyBatis3UpdateModelAdapter<Integer>> 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)
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<Object> 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 <T extends Entity> Page<T> getPage(
|
||||
public <T extends Entity> Result<Page<T>> getPage(
|
||||
final Integer pageNumber,
|
||||
final Integer pageSize,
|
||||
final String sortBy,
|
||||
final Page.SortOrder sortOrder,
|
||||
final SqlTable table,
|
||||
final Supplier<Collection<T>> delegate) {
|
||||
final Supplier<Result<Collection<T>>> delegate) {
|
||||
|
||||
final com.github.pagehelper.Page<Object> page = setPagination(pageNumber, pageSize, sortBy, sortOrder, table);
|
||||
final Collection<T> pageList = delegate.get();
|
||||
return new Page<>(page.getPages(), page.getPageNum(), sortBy, sortOrder, pageList);
|
||||
return Result.tryCatch(() -> {
|
||||
final com.github.pagehelper.Page<Object> page =
|
||||
setPagination(pageNumber, pageSize, sortBy, sortOrder, table);
|
||||
final Collection<T> pageList = delegate.get().getOrThrow();
|
||||
return new Page<>(page.getPages(), page.getPageNum(), sortBy, sortOrder, pageList);
|
||||
});
|
||||
}
|
||||
|
||||
private String verifySortColumnName(final String sortBy, final SqlTable table) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -18,25 +18,33 @@ import ch.ethz.seb.sebserver.gbl.util.Result;
|
|||
|
||||
/** Interface of a DAO for an Entity that has activation feature.
|
||||
*
|
||||
* @param <T> the concrete Entity type */
|
||||
* @param <T> the type of Entity */
|
||||
public interface ActivatableEntityDAO<T extends Entity, M extends ModelIdAware> extends EntityDAO<T, M> {
|
||||
|
||||
/** 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 <code>PaginationService</code> 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<Collection<T>> all(Long institutionId, Boolean active);
|
||||
|
||||
default Result<Collection<T>> 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 <code>PaginationService</code> before calling this method
|
||||
*
|
||||
* @param institutionId the identifier of the institution.
|
||||
* @return Result of Collection of Entity of the given institution */
|
||||
@Override
|
||||
default Result<Collection<T>> all(final Long institutionId) {
|
||||
return all(institutionId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
default Result<Collection<T>> 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
|
||||
|
|
|
@ -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<T extends Entity, M extends ModelIdAware> {
|
||||
|
||||
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<T extends Entity, M extends ModelIdAware> {
|
|||
* @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<T> 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 <code>PaginationService</code> 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<Collection<T>> 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<Collection<T>> allOfInstitution(final long institutionId) {
|
||||
return all(institutionId);
|
||||
}
|
||||
|
||||
Result<Collection<T>> loadEntities(Collection<EntityKey> keys);
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
|
@ -114,6 +96,13 @@ public interface EntityDAO<T extends Entity, M extends ModelIdAware> {
|
|||
* happened */
|
||||
Result<Collection<EntityKey>> delete(Set<EntityKey> all);
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
default Result<Collection<T>> allMatching(final FilterMap filterMap) {
|
||||
return allMatching(filterMap, e -> true);
|
||||
}
|
||||
|
||||
Result<Collection<T>> allMatching(FilterMap filterMap, Predicate<T> 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
|
||||
|
|
|
@ -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<Exam, Exam>, BulkActionSupportDAO<Exam> {
|
||||
|
||||
Result<Exam> importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData);
|
||||
|
||||
Result<Exam> byQuizId(String quizId);
|
||||
|
||||
Result<Collection<Exam>> allMatching(
|
||||
Long institutionId,
|
||||
Long lmsSetupId,
|
||||
String name,
|
||||
Exam.ExamStatus status,
|
||||
Exam.ExamType type,
|
||||
DateTime from,
|
||||
String owner,
|
||||
Boolean active);
|
||||
// Result<Exam> importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData);
|
||||
//
|
||||
// Result<Exam> byQuizId(String quizId);
|
||||
|
||||
}
|
||||
|
|
|
@ -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<String, String> params;
|
||||
|
||||
public FilterMap(final Map<String, String> 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 + "%";
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Institution, Institution>, BulkActionSupportDAO<Institution> {
|
||||
|
||||
Result<Collection<Institution>> allMatching(String name, Boolean active);
|
||||
|
||||
}
|
||||
|
|
|
@ -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<LmsSetup, LmsSetup>, BulkActionSupportDAO<LmsSetup> {
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
default Result<Collection<LmsSetup>> allOfInstitution(final Long institutionId, final Boolean active) {
|
||||
return allMatching(institutionId, null, null, active);
|
||||
}
|
||||
|
||||
Result<Collection<LmsSetup>> allMatching(Long institutionId, String name, LmsType lmsType, Boolean active);
|
||||
|
||||
}
|
||||
|
|
|
@ -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<UserActivityLogRecord> predicate);
|
||||
String activityTypes,
|
||||
String entityTypes,
|
||||
Predicate<UserActivityLog> predicate);
|
||||
|
||||
}
|
||||
|
|
|
@ -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<UserInfo, UserMod>, BulkAc
|
|||
* @return a Result of SEBServerUser for specified username. Or an exception result on error case */
|
||||
Result<SEBServerUser> 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<Collection<UserInfo>> 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<Collection<UserInfo>> allMatching(final UserFilter filter);
|
||||
|
||||
/** Use this to get a Collection containing EntityKey's of all entities that belongs to a given User.
|
||||
*
|
||||
|
|
|
@ -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<Exam> byQuizId(final String quizId) {
|
||||
return recordByQuizId(quizId)
|
||||
.flatMap(this::toDomainModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Result<Collection<Exam>> all(final Long institutionId, final Boolean active) {
|
||||
|
@ -106,18 +100,12 @@ public class ExamDAOImpl implements ExamDAO {
|
|||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Result<Collection<Exam>> 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<Collection<Exam>> allMatching(final FilterMap filterMap, final Predicate<Exam> predicate) {
|
||||
|
||||
return Result.tryCatch(() -> {
|
||||
|
||||
final String name = filterMap.getName();
|
||||
final DateTime from = filterMap.getExamFromTime();
|
||||
final Predicate<Exam> quizDataFilter = exam -> {
|
||||
if (StringUtils.isNoneBlank(name)) {
|
||||
if (!exam.name.contains(name)) {
|
||||
|
@ -137,108 +125,50 @@ public class ExamDAOImpl implements ExamDAO {
|
|||
final List<ExamRecord> 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<Exam> importFromQuizData(
|
||||
final Long institutionId,
|
||||
final Long lmsSetupId,
|
||||
final QuizData quizData) {
|
||||
|
||||
return Result.tryCatch(() -> {
|
||||
// fist check if it is not already existing
|
||||
final List<ExamRecord> 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<Exam> 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<ExamRecord> 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<ExamRecord> insert(final Exam exam) {
|
||||
return Result.tryCatch(() -> {
|
||||
|
||||
// fist check if it is not already existing
|
||||
final List<ExamRecord> 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<ExamRecord> 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<Collection<EntityKey>> allIdsOfInstitution(final EntityKey institutionKey) {
|
||||
return Result.tryCatch(() -> {
|
||||
return this.examRecordMapper.selectIdsByExample()
|
||||
|
@ -345,15 +323,6 @@ public class ExamDAOImpl implements ExamDAO {
|
|||
});
|
||||
}
|
||||
|
||||
private Result<ExamRecord> recordByQuizId(final String quizId) {
|
||||
return getSingleResource(
|
||||
quizId,
|
||||
this.examRecordMapper.selectByExample()
|
||||
.where(ExamRecordDynamicSqlSupport.externalId, isEqualTo(quizId))
|
||||
.build()
|
||||
.execute());
|
||||
}
|
||||
|
||||
private Result<Exam> toDomainModel(final ExamRecord record) {
|
||||
return toDomainModel(
|
||||
record.getLmsSetupId(),
|
||||
|
|
|
@ -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<Collection<Indicator>> allMatching(final FilterMap filterMap, final Predicate<Indicator> 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<Collection<Indicator>> loadEntities(final Collection<EntityKey> keys) {
|
||||
|
@ -202,6 +236,8 @@ public class IndicatorDAOImpl implements IndicatorDAO {
|
|||
private Result<Indicator> toDomainModel(final IndicatorRecord record) {
|
||||
return Result.tryCatch(() -> {
|
||||
|
||||
final ExamRecord examRecord = this.examRecordMapper.selectByPrimaryKey(record.getExamId());
|
||||
|
||||
final List<Threshold> 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()),
|
||||
|
|
|
@ -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<Collection<Institution>> allMatching(final String name, final Boolean active) {
|
||||
public Result<Collection<Institution>> allMatching(
|
||||
final FilterMap filterMap,
|
||||
final Predicate<Institution> 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()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Collection<LmsSetup>> allMatching(
|
||||
final Long institutionId,
|
||||
final String name,
|
||||
final LmsType lmsType,
|
||||
final Boolean active) {
|
||||
final FilterMap filterMap,
|
||||
final Predicate<LmsSetup> 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());
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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<Collection<UserActivityLog>> allMatching(final FilterMap filterMap,
|
||||
final Predicate<UserActivityLog> 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<Collection<UserActivityLog>> all(
|
||||
|
@ -215,10 +229,19 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
|
|||
final String userId,
|
||||
final Long from,
|
||||
final Long to,
|
||||
final Predicate<UserActivityLogRecord> predicate) {
|
||||
final String activityTypes,
|
||||
final String entityTypes,
|
||||
final Predicate<UserActivityLog> predicate) {
|
||||
|
||||
return Result.tryCatch(() -> {
|
||||
final Predicate<UserActivityLogRecord> _predicate = (predicate != null)
|
||||
final List<String> _activityTypes = (activityTypes != null)
|
||||
? Arrays.asList(StringUtils.split(activityTypes, Constants.LIST_SEPARATOR))
|
||||
: null;
|
||||
final List<String> _entityTypes = (entityTypes != null)
|
||||
? Arrays.asList(StringUtils.split(entityTypes, Constants.LIST_SEPARATOR))
|
||||
: null;
|
||||
|
||||
final Predicate<UserActivityLog> _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<Collection<UserActivityLog>> 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()
|
||||
|
|
|
@ -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<Collection<UserInfo>> all(final Long institutionId, final Boolean active) {
|
||||
return Result.tryCatch(() -> {
|
||||
|
||||
final List<UserRecord> records = (active != null)
|
||||
? this.userRecordMapper.selectByExample()
|
||||
.where(
|
||||
|
@ -143,20 +144,33 @@ public class UserDaoImpl implements UserDAO {
|
|||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Result<Collection<UserInfo>> 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<Collection<UserInfo>> allMatching(final FilterMap filterMap, final Predicate<UserInfo> 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()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
|
@ -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 <T> void validateBean(final T bean) {
|
||||
final DirectFieldBindingResult errors = new DirectFieldBindingResult(bean, "");
|
||||
this.validator.validate(bean, errors);
|
||||
if (errors.hasErrors()) {
|
||||
throw new BeanValidationException(errors);
|
||||
}
|
||||
}
|
||||
|
||||
public <T, M> M validateNewBean(final Map<String, String> params, final Class<M> 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 <T, M> M validateModifiedBean(final T bean, final Map<String, String> params, final Class<M> 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Object> handleBeanValidationException(
|
||||
final BeanValidationException ex,
|
||||
final WebRequest request) {
|
||||
|
||||
final Collection<APIMessage> 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<Object> handleUserNotFound(
|
||||
final UsernameNotFoundException ex,
|
||||
|
@ -84,6 +98,16 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler {
|
|||
.createErrorResponse(ex.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(IllegalAPIArgumentException.class)
|
||||
public ResponseEntity<Object> 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<Object> handleUnexpected(
|
||||
final Exception ex,
|
||||
|
|
|
@ -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<String, String> params;
|
||||
|
||||
public APIParamsMap(final Map<String, String> 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<T extends GrantEntity, M extends GrantEntity>
|
||||
extends EntityController<T, M> {
|
||||
|
@ -43,13 +43,23 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
|
|||
final BulkActionService bulkActionService,
|
||||
final ActivatableEntityDAO<T, M> 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<T> allActive(
|
||||
@RequestParam(
|
||||
name = Entity.FILTER_ATTR_INSTITUTION,
|
||||
|
@ -67,10 +77,14 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
|
|||
sortBy,
|
||||
sortOrder,
|
||||
UserRecordDynamicSqlSupport.userRecord,
|
||||
() -> 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<T> allInactive(
|
||||
@RequestParam(
|
||||
name = Entity.FILTER_ATTR_INSTITUTION,
|
||||
|
@ -88,31 +102,29 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
|
|||
sortBy,
|
||||
sortOrder,
|
||||
UserRecordDynamicSqlSupport.userRecord,
|
||||
() -> 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<Collection<T>> getAll(final Long institutionId, final Boolean active) {
|
||||
return this.activatableEntityDAO.all(institutionId, active);
|
||||
}
|
||||
|
||||
private Result<EntityProcessingReport> setActive(final String id, final boolean active) {
|
||||
final EntityType entityType = this.entityDAO.entityType();
|
||||
final BulkAction bulkAction = new BulkAction(
|
||||
|
|
|
@ -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<T extends GrantEntity, M extends GrantEntity> {
|
||||
|
||||
|
@ -47,23 +57,81 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
|
|||
protected final EntityDAO<T, M> entityDAO;
|
||||
protected final UserActivityLogDAO userActivityLogDAO;
|
||||
protected final PaginationService paginationService;
|
||||
protected final BeanValidationService beanValidationService;
|
||||
|
||||
protected EntityController(
|
||||
final AuthorizationGrantService authorizationGrantService,
|
||||
final BulkActionService bulkActionService,
|
||||
final EntityDAO<T, M> 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<T> 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<String, String> 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<EntityKeyAndName> getNames(
|
||||
@RequestParam(
|
||||
name = Entity.FILTER_ATTR_INSTITUTION,
|
||||
required = true,
|
||||
defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId,
|
||||
@RequestParam final Map<String, String> 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<T extends GrantEntity, M extends GrantEnt
|
|||
.getOrThrow();
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public T create(
|
||||
@RequestParam final Map<String, String> 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<String, String> 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<T> getForIds(@RequestParam(name = "ids", required = true) final String ids) {
|
||||
return Result.tryCatch(() -> {
|
||||
|
@ -87,56 +253,6 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/names", method = RequestMethod.GET)
|
||||
public Collection<EntityKeyAndName> 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<T> notifySave(final M modifyData, final T entity) {
|
||||
return Result.of(entity);
|
||||
}
|
||||
|
@ -148,7 +264,24 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
|
|||
institutionId);
|
||||
}
|
||||
|
||||
protected Result<Collection<T>> getAll(final Long institutionId, final Boolean active) {
|
||||
return this.entityDAO.all(institutionId);
|
||||
protected Result<Collection<T>> getAll(final FilterMap filterMap) {
|
||||
final Predicate<T> grantFilter = this.authorizationGrantService.getGrantFilter(
|
||||
this.entityDAO.entityType(),
|
||||
PrivilegeType.READ_ONLY);
|
||||
|
||||
return this.entityDAO.allMatching(filterMap, grantFilter);
|
||||
}
|
||||
|
||||
protected abstract Class<M> modifiedDataType();
|
||||
|
||||
protected abstract SqlTable getSQLTableOfEntity();
|
||||
|
||||
private Result<M> 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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Ex
|
|||
final ExamDAO examDAO,
|
||||
final PaginationService paginationService,
|
||||
final BulkActionService bulkActionService,
|
||||
final IndicatorDAO indicatorDAO) {
|
||||
final IndicatorDAO indicatorDAO,
|
||||
final BeanValidationService beanValidationService) {
|
||||
|
||||
super(authorizationGrantService,
|
||||
bulkActionService,
|
||||
examDAO,
|
||||
userActivityLogDAO,
|
||||
paginationService,
|
||||
beanValidationService);
|
||||
|
||||
super(authorizationGrantService, bulkActionService, examDAO, userActivityLogDAO, paginationService);
|
||||
this.examDAO = examDAO;
|
||||
this.indicatorDAO = indicatorDAO;
|
||||
}
|
||||
|
||||
@InitBinder
|
||||
public void initBinder(final WebDataBinder binder) throws Exception {
|
||||
this.authorizationGrantService
|
||||
.getUserService()
|
||||
.addUsersInstitutionDefaultPropertySupport(binder);
|
||||
@Override
|
||||
protected Class<Exam> modifiedDataType() {
|
||||
return Exam.class;
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
public Collection<Exam> 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<Exam> getPage(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Override
|
||||
public Page<Exam> 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<String, String> allRequestParams) {
|
||||
|
||||
checkReadPrivilege(institutionId);
|
||||
|
||||
|
@ -124,21 +102,20 @@ public class ExamAdministrationController extends ActivatableEntityController<Ex
|
|||
if (StringUtils.isBlank(sortBy) ||
|
||||
this.paginationService.isNativeSortingSupported(ExamRecordDynamicSqlSupport.examRecord, sortBy)) {
|
||||
|
||||
return this.paginationService.getPage(
|
||||
pageNumber,
|
||||
pageSize,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
ExamRecordDynamicSqlSupport.examRecord,
|
||||
() -> 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<Exam> 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<Ex
|
|||
}
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/{examId}/indicator", method = RequestMethod.GET)
|
||||
public Collection<Indicator> 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<Indicator> 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<EntityKey> 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<Exam> 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<Indicator> 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<Indicator> 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<EntityKey> 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();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Instituti
|
|||
final AuthorizationGrantService authorizationGrantService,
|
||||
final UserActivityLogDAO userActivityLogDAO,
|
||||
final BulkActionService bulkActionService,
|
||||
final PaginationService paginationService) {
|
||||
final PaginationService paginationService,
|
||||
final BeanValidationService beanValidationService) {
|
||||
|
||||
super(authorizationGrantService,
|
||||
bulkActionService,
|
||||
institutionDAO,
|
||||
userActivityLogDAO,
|
||||
paginationService,
|
||||
beanValidationService);
|
||||
|
||||
super(authorizationGrantService, bulkActionService, institutionDAO, userActivityLogDAO, paginationService);
|
||||
this.institutionDAO = institutionDAO;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<Institution> 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<Instituti
|
|||
return this.institutionDAO.byPK(institutionId).getOrThrow();
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
public Collection<Institution> 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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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<LmsSetup, LmsSetup> {
|
||||
|
||||
private final LmsSetupDAO lmsSetupDAO;
|
||||
private final LmsAPIService lmsAPIService;
|
||||
|
||||
public LmsSetupController(
|
||||
|
@ -51,40 +47,31 @@ public class LmsSetupController extends ActivatableEntityController<LmsSetup, Lm
|
|||
final UserActivityLogDAO userActivityLogDAO,
|
||||
final BulkActionService bulkActionService,
|
||||
final LmsAPIService lmsAPIService,
|
||||
final PaginationService paginationService) {
|
||||
final PaginationService paginationService,
|
||||
final BeanValidationService beanValidationService) {
|
||||
|
||||
super(authorizationGrantService, bulkActionService, lmsSetupDAO, userActivityLogDAO, paginationService);
|
||||
super(authorizationGrantService,
|
||||
bulkActionService,
|
||||
lmsSetupDAO,
|
||||
userActivityLogDAO,
|
||||
paginationService,
|
||||
beanValidationService);
|
||||
|
||||
this.lmsSetupDAO = lmsSetupDAO;
|
||||
this.lmsAPIService = lmsAPIService;
|
||||
}
|
||||
|
||||
@InitBinder
|
||||
public void initBinder(final WebDataBinder binder) throws Exception {
|
||||
this.authorizationGrantService
|
||||
.getUserService()
|
||||
.addUsersInstitutionDefaultPropertySupport(binder);
|
||||
@Override
|
||||
protected Class<LmsSetup> modifiedDataType() {
|
||||
return LmsSetup.class;
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
public Collection<LmsSetup> 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(
|
||||
|
|
|
@ -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<QuizData> 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<Exam> 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<String> 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<Exam> 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<String> 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());
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -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<UserInfo, UserMod> {
|
||||
|
||||
private final UserDAO userDao;
|
||||
private final ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
public UserAccountController(
|
||||
|
@ -52,66 +40,18 @@ public class UserAccountController extends ActivatableEntityController<UserInfo,
|
|||
final UserActivityLogDAO userActivityLogDAO,
|
||||
final PaginationService paginationService,
|
||||
final BulkActionService bulkActionService,
|
||||
final ApplicationEventPublisher applicationEventPublisher) {
|
||||
final ApplicationEventPublisher applicationEventPublisher,
|
||||
final BeanValidationService beanValidationService) {
|
||||
|
||||
super(authorizationGrantService, bulkActionService, userDao, userActivityLogDAO, paginationService);
|
||||
this.userDao = userDao;
|
||||
super(authorizationGrantService,
|
||||
bulkActionService,
|
||||
userDao,
|
||||
userActivityLogDAO,
|
||||
paginationService,
|
||||
beanValidationService);
|
||||
this.applicationEventPublisher = applicationEventPublisher;
|
||||
}
|
||||
|
||||
@InitBinder
|
||||
public void initBinder(final WebDataBinder binder) throws Exception {
|
||||
this.authorizationGrantService
|
||||
.getUserService()
|
||||
.addUsersInstitutionDefaultPropertySupport(binder);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
public Collection<UserInfo> 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<UserInfo> 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<UserInfo,
|
|||
.getUserInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<UserMod> modifiedDataType() {
|
||||
return UserMod.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SqlTable getSQLTableOfEntity() {
|
||||
return UserRecordDynamicSqlSupport.userRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Result<UserInfo> 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<UserInfo,
|
|||
return Result.of(userInfo);
|
||||
}
|
||||
|
||||
private Collection<UserInfo> getAll(final UserFilter userFilter) {
|
||||
if (this.authorizationGrantService.hasBasePrivilege(
|
||||
EntityType.USER,
|
||||
PrivilegeType.READ_ONLY)) {
|
||||
|
||||
return this.userDao
|
||||
.allMatching(userFilter)
|
||||
.getOrThrow();
|
||||
|
||||
} else {
|
||||
|
||||
final Predicate<GrantEntity> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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<UserActivityLog> 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<UserActivityLog> 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<UserActivityLog> 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<UserActivityLog> 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<UserActivityLog> 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<UserActivityLog> _getAll(
|
||||
private Result<Collection<UserActivityLog>> _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<String> _activityTypes = (activityTypes != null)
|
||||
? Collections.unmodifiableSet(new HashSet<>(
|
||||
Arrays.asList(StringUtils.split(activityTypes, Constants.LIST_SEPARATOR))))
|
||||
: null;
|
||||
final Set<String> _entityTypes = (entityTypes != null)
|
||||
? Collections.unmodifiableSet(new HashSet<>(
|
||||
Arrays.asList(StringUtils.split(entityTypes, Constants.LIST_SEPARATOR))))
|
||||
: null;
|
||||
return Result.tryCatch(() -> {
|
||||
|
||||
final Predicate<UserActivityLogRecord> 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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
@ -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> T getAsObject(final TypeReference<T> 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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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 {
|
|
@ -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<Institution> institutions = new RestAPITestHelper()
|
||||
.withAccessToken(getSebAdminAccess())
|
||||
.withPath(RestAPI.ENDPOINT_INSTITUTION)
|
||||
.withExpectedStatus(HttpStatus.OK)
|
||||
.getAsObject(new TypeReference<Page<Institution>>() {
|
||||
});
|
||||
|
||||
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<Page<Institution>>() {
|
||||
});
|
||||
|
||||
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<Page<Institution>>() {
|
||||
});
|
||||
|
||||
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<Page<Institution>>() {
|
||||
});
|
||||
|
||||
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<APIMessage>() {
|
||||
});
|
||||
|
||||
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<Institution>() {
|
||||
});
|
||||
|
||||
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<Institution>() {
|
||||
});
|
||||
|
||||
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<Institution>() {
|
||||
});
|
||||
|
||||
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<APIMessage>() {
|
||||
});
|
||||
|
||||
// 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<APIMessage>() {
|
||||
});
|
||||
|
||||
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<Institution>() {
|
||||
// });
|
||||
// }
|
||||
|
||||
static void assertContainsInstitution(final String name, final Collection<Institution> institutions) {
|
||||
assert institutions != null;
|
||||
assert institutions.stream()
|
||||
.filter(inst -> inst.name.equals(name))
|
||||
.findFirst()
|
||||
.isPresent();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue