refactoring -> generalization of REST API and controller

This commit is contained in:
anhefti 2019-01-24 15:50:01 +01:00
parent f955377f48
commit f5d461157e
106 changed files with 2404 additions and 1807 deletions

View file

@ -27,8 +27,10 @@ public class APIMessage implements Serializable {
private static final long serialVersionUID = -6858683658311637361L; private static final long serialVersionUID = -6858683658311637361L;
public enum ErrorMessage { public enum ErrorMessage {
GENERIC("0", HttpStatus.INTERNAL_SERVER_ERROR, "Generic error message"),
UNAUTHORIZED("1000", HttpStatus.UNAUTHORIZED, "UNAUTHORIZED"), UNAUTHORIZED("1000", HttpStatus.UNAUTHORIZED, "UNAUTHORIZED"),
FORBIDDEN("1001", HttpStatus.FORBIDDEN, "FORBIDDEN"), 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"), UNEXPECTED("1100", HttpStatus.INTERNAL_SERVER_ERROR, "Unexpected intenral server-side error"),
FIELD_VALIDATION("1200", HttpStatus.BAD_REQUEST, "Field validation error"), FIELD_VALIDATION("1200", HttpStatus.BAD_REQUEST, "Field validation error"),
PASSWORD_MISSMATCH("1300", HttpStatus.BAD_REQUEST, "new password do not match retyped password") PASSWORD_MISSMATCH("1300", HttpStatus.BAD_REQUEST, "new password do not match retyped password")

View file

@ -8,8 +8,11 @@
package ch.ethz.seb.sebserver.gbl.model; package ch.ethz.seb.sebserver.gbl.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
public interface Activatable { public interface Activatable {
@JsonIgnore
boolean isActive(); boolean isActive();
} }

View file

@ -5,9 +5,10 @@ import javax.annotation.Generated;
/** Defines the global names of the domain model and domain model fields. /** 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 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.**/ * 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 { public interface Domain {
String ATTR_ID = "id"; String ATTR_ID = "id";
String ATTR_INSTITUTION_ID = "institutionId";
interface CONFIGURATION_ATTRIBUTE { interface CONFIGURATION_ATTRIBUTE {
String TYPE_NAME = "ConfigurationAttribute"; String TYPE_NAME = "ConfigurationAttribute";

View file

@ -8,13 +8,18 @@
package ch.ethz.seb.sebserver.gbl.model; package ch.ethz.seb.sebserver.gbl.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
public interface Entity extends ModelIdAware { public interface Entity extends ModelIdAware {
public static final String FILTER_ATTR_INSTITUTION = "institution"; public static final String FILTER_ATTR_INSTITUTION = "institution";
public static final String FILTER_ATTR_ACTIVE = "active"; public static final String FILTER_ATTR_ACTIVE = "active";
public static final String FILTER_ATTR_NAME = "name";
@JsonIgnore
EntityType entityType(); EntityType entityType();
@JsonIgnore
String getName(); String getName();
public static EntityKeyAndName toName(final Entity entity) { public static EntityKeyAndName toName(final Entity entity) {

View file

@ -2,7 +2,7 @@ package ch.ethz.seb.sebserver.gbl.model;
import javax.annotation.Generated; 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 { public enum EntityType {
CONFIGURATION_ATTRIBUTE, CONFIGURATION_ATTRIBUTE,
CONFIGURATION_VALUE, CONFIGURATION_VALUE,

View file

@ -8,8 +8,11 @@
package ch.ethz.seb.sebserver.gbl.model; package ch.ethz.seb.sebserver.gbl.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
public interface ModelIdAware { public interface ModelIdAware {
@JsonIgnore
String getModelId(); String getModelId();
} }

View file

@ -9,6 +9,7 @@
package ch.ethz.seb.sebserver.gbl.model; package ch.ethz.seb.sebserver.gbl.model;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -22,6 +23,7 @@ public final class Page<T> {
DESCENDING 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_NUMBER_OF_PAGES = "number_of_pages";
public static final String ATTR_PAGE_NUMBER = "page_number"; public static final String ATTR_PAGE_NUMBER = "page_number";
public static final String ATTR_PAGE_SIZE = "page_size"; public static final String ATTR_PAGE_SIZE = "page_size";
@ -41,7 +43,7 @@ public final class Page<T> {
public final SortOrder sortOrder; public final SortOrder sortOrder;
@JsonProperty(ATTR_CONTENT) @JsonProperty(ATTR_CONTENT)
public final Collection<T> content; public final List<T> content;
@JsonCreator @JsonCreator
public Page( public Page(
@ -53,7 +55,7 @@ public final class Page<T> {
this.numberOfPages = numberOfPages; this.numberOfPages = numberOfPages;
this.pageNumber = pageNumber; this.pageNumber = pageNumber;
this.content = Utils.immutableCollectionOf(content); this.content = Utils.immutableListOf(content);
this.pageSize = content.size(); this.pageSize = content.size();
this.sortBy = sortBy; this.sortBy = sortBy;
this.sortOrder = sortOrder; this.sortOrder = sortOrder;

View file

@ -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_TYPE = "type";
public static final String FILTER_ATTR_FROM = "from"; public static final String FILTER_ATTR_FROM = "from";
public static final String FILTER_ATTR_OWNER = "owner"; public static final String FILTER_ATTR_OWNER = "owner";
public static final String FILTER_ATTR_QUIZ_ID = "quiz";
public enum ExamStatus { public enum ExamStatus {
ON_CREATION, ON_CREATION,

View file

@ -16,13 +16,16 @@ import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; 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.INDICATOR;
import ch.ethz.seb.sebserver.gbl.model.Domain.THRESHOLD; 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.model.EntityType;
import ch.ethz.seb.sebserver.gbl.util.Utils; 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 { public enum IndicatorType {
UNDEFINED, UNDEFINED,
@ -33,6 +36,13 @@ public final class Indicator implements Entity {
@JsonProperty(INDICATOR.ATTR_ID) @JsonProperty(INDICATOR.ATTR_ID)
public final Long 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) @JsonProperty(INDICATOR.ATTR_EXAM_ID)
@NotNull @NotNull
public final Long examId; public final Long examId;
@ -55,6 +65,8 @@ public final class Indicator implements Entity {
@JsonCreator @JsonCreator
public Indicator( public Indicator(
@JsonProperty(INDICATOR.ATTR_ID) final Long id, @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_EXAM_ID) final Long examId,
@JsonProperty(INDICATOR.ATTR_NAME) final String name, @JsonProperty(INDICATOR.ATTR_NAME) final String name,
@JsonProperty(INDICATOR.ATTR_TYPE) final IndicatorType type, @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) { @JsonProperty(THRESHOLD.REFERENCE_NAME) final Collection<Threshold> thresholds) {
this.id = id; this.id = id;
this.institutionId = institutionId;
this.owner = owner;
this.examId = examId; this.examId = examId;
this.name = name; this.name = name;
this.type = type; this.type = type;
@ -88,6 +102,19 @@ public final class Indicator implements Entity {
return this.id; 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() { public Long getExamId() {
return this.examId; return this.examId;
} }

View file

@ -11,7 +11,6 @@ package ch.ethz.seb.sebserver.gbl.model.institution;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.model.Activatable; import ch.ethz.seb.sebserver.gbl.model.Activatable;
@ -55,7 +54,6 @@ public final class Institution implements GrantEntity, Activatable {
} }
@Override @Override
@JsonIgnore
public EntityType entityType() { public EntityType entityType() {
return EntityType.INSTITUTION; return EntityType.INSTITUTION;
} }
@ -68,7 +66,6 @@ public final class Institution implements GrantEntity, Activatable {
} }
@Override @Override
@JsonIgnore
public boolean isActive() { public boolean isActive() {
return this.active; return this.active;
} }

View file

@ -25,7 +25,6 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantEntity;
public final class LmsSetup implements GrantEntity, Activatable { 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 static final String FILTER_ATTR_LMS_TYPE = "lms_type";
public enum LmsType { public enum LmsType {

View file

@ -19,6 +19,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.Acti
public class UserActivityLog implements Entity { 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_FROM = "from";
public static final String FILTER_ATTR_TO = "to"; public static final String FILTER_ATTR_TO = "to";
public static final String FILTER_ATTR_ACTIVITY_TYPES = "activity_types"; public static final String FILTER_ATTR_ACTIVITY_TYPES = "activity_types";
@ -76,13 +77,11 @@ public class UserActivityLog implements Entity {
} }
@Override @Override
@JsonIgnore
public EntityType entityType() { public EntityType entityType() {
return EntityType.USER_ACTIVITY_LOG; return EntityType.USER_ACTIVITY_LOG;
} }
@Override @Override
@JsonIgnore
public String getModelId() { public String getModelId() {
return (this.id != null) return (this.id != null)
? String.valueOf(this.id) ? String.valueOf(this.id)
@ -90,7 +89,6 @@ public class UserActivityLog implements Entity {
} }
@Override @Override
@JsonIgnore
public String getName() { public String getName() {
return getModelId(); return getModelId();
} }

View file

@ -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 + "]";
}
}

View file

@ -16,7 +16,6 @@ import org.apache.commons.lang3.BooleanUtils;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.model.Activatable; 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; 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 */ /** The user's UUID */
@JsonProperty(USER.ATTR_UUID) @JsonProperty(USER.ATTR_UUID)
public final String uuid; public final String uuid;
@ -96,12 +99,10 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable {
} }
@Override @Override
@JsonIgnore
public EntityType entityType() { public EntityType entityType() {
return EntityType.USER; return EntityType.USER;
} }
@JsonIgnore
@Override @Override
public String getModelId() { public String getModelId() {
return this.uuid; return this.uuid;
@ -116,7 +117,6 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable {
return this.institutionId; return this.institutionId;
} }
@JsonIgnore
@Override @Override
public String getOwnerId() { public String getOwnerId() {
return this.uuid; return this.uuid;
@ -139,7 +139,6 @@ public final class UserInfo implements GrantEntity, Activatable, Serializable {
return this.active; return this.active;
} }
@JsonIgnore
@Override @Override
public boolean isActive() { public boolean isActive() {
return this.active; return this.active;

View file

@ -13,14 +13,13 @@ import java.util.Locale;
import java.util.Set; import java.util.Set;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import com.fasterxml.jackson.annotation.JsonCreator; 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 com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.model.Domain.USER; import ch.ethz.seb.sebserver.gbl.model.Domain.USER;
@ -47,7 +46,6 @@ public final class UserMod implements GrantEntity {
public final String name; public final String name;
/** The internal user name */ /** The internal user name */
@NotNull
@Size(min = 3, max = 255, message = "user:username:size:{min}:{max}:${validatedValue}") @Size(min = 3, max = 255, message = "user:username:size:{min}:{max}:${validatedValue}")
@JsonProperty(USER.ATTR_USERNAME) @JsonProperty(USER.ATTR_USERNAME)
public final String username; public final String username;
@ -58,18 +56,14 @@ public final class UserMod implements GrantEntity {
public final String email; public final String email;
/** The users locale */ /** The users locale */
@NotNull
@JsonProperty(USER.ATTR_LOCALE) @JsonProperty(USER.ATTR_LOCALE)
public final Locale locale; public final Locale locale;
/** The users time zone */ /** The users time zone */
@NotNull
@JsonProperty(USER.ATTR_TIMEZONE) @JsonProperty(USER.ATTR_TIMEZONE)
public final DateTimeZone timeZone; public final DateTimeZone timeZone;
/** The users roles in a unmodifiable set. Is never null */ /** The users roles in a unmodifiable set */
@NotNull
@NotEmpty(message = "user:roles:notEmpty:_:_:_")
@JsonProperty(USER_ROLE.REFERENCE_NAME) @JsonProperty(USER_ROLE.REFERENCE_NAME)
public final Set<String> roles; public final Set<String> roles;
@ -81,6 +75,7 @@ public final class UserMod implements GrantEntity {
private final String retypedNewPassword; private final String retypedNewPassword;
@JsonCreator @JsonCreator
@JsonIgnoreProperties(ignoreUnknown = true)
public UserMod( public UserMod(
@JsonProperty(USER.ATTR_UUID) final String uuid, @JsonProperty(USER.ATTR_UUID) final String uuid,
@JsonProperty(USER.ATTR_INSTITUTION_ID) final Long institutionId, @JsonProperty(USER.ATTR_INSTITUTION_ID) final Long institutionId,
@ -101,8 +96,8 @@ public final class UserMod implements GrantEntity {
this.name = name; this.name = name;
this.username = username; this.username = username;
this.email = email; this.email = email;
this.locale = locale; this.locale = (locale != null) ? locale : Locale.ROOT;
this.timeZone = timeZone; this.timeZone = (timeZone != null) ? timeZone : DateTimeZone.UTC;
this.roles = (roles != null) this.roles = (roles != null)
? Collections.unmodifiableSet(roles) ? Collections.unmodifiableSet(roles)
: Collections.emptySet(); : Collections.emptySet();
@ -122,25 +117,21 @@ public final class UserMod implements GrantEntity {
} }
@Override @Override
@JsonIgnore
public String getModelId() { public String getModelId() {
return this.uuid; return this.uuid;
} }
@Override @Override
@JsonIgnore
public EntityType entityType() { public EntityType entityType() {
return EntityType.USER; return EntityType.USER;
} }
@Override @Override
@JsonIgnore
public Long getInstitutionId() { public Long getInstitutionId() {
return this.institutionId; return this.institutionId;
} }
@Override @Override
@JsonIgnore
public String getOwnerId() { public String getOwnerId() {
return this.uuid; return this.uuid;
} }

View file

@ -26,6 +26,12 @@ import ch.ethz.seb.sebserver.gbl.Constants;
public final class Utils { 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) { public static <T> Collection<T> immutableCollectionOf(final Collection<T> collection) {
return (collection != null) return (collection != null)
? Collections.unmodifiableCollection(collection) ? Collections.unmodifiableCollection(collection)
@ -72,6 +78,12 @@ public final class Utils {
: Collections.emptyList(); : 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) { public static <T extends Enum<T>> Collection<Tuple<String>> createSelectionResource(final Class<T> enumClass) {
return Collections.unmodifiableCollection(Arrays.asList( return Collections.unmodifiableCollection(Arrays.asList(
enumClass.getEnumConstants()) enumClass.getEnumConstants())
@ -80,10 +92,6 @@ public final class Utils {
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
public static String toSQLWildcard(final String text) {
return (text == null) ? null : "%" + text + "%";
}
public static Result<Long> dateTimeStringToTimestamp(final String startTime) { public static Result<Long> dateTimeStringToTimestamp(final String startTime) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
return DateTime.parse(startTime, Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS).getMillis(); return DateTime.parse(startTime, Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS).getMillis();

View file

@ -12,11 +12,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
@Component
@WebServiceProfile @WebServiceProfile
public class WebServiceInit implements ApplicationListener<ApplicationReadyEvent> { 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 // TODO whatever has to be initialized for the web-service component right after startup comes here
} }
} }

View file

@ -63,24 +63,9 @@ public class JodaTimeTypeResolver extends BaseTypeHandler<DateTime> {
} }
private DateTime getDateTime(final SupplierSQLExceptionAware<String> supplier) throws SQLException { private DateTime getDateTime(final SupplierSQLExceptionAware<String> supplier) throws SQLException {
String dateFormattedString = supplier.get(); final String dateFormattedString = supplier.get();
try { try {
// cutting milliseconds if there are some. This is needed to be able to use a general pattern return getDateTime(supplier.get());
// 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;
} catch (final Exception e) { } catch (final Exception e) {
log.error("while trying to parse LocalDateTime; value: " + dateFormattedString + " format: " log.error("while trying to parse LocalDateTime; value: " + dateFormattedString + " format: "
+ Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS, e); + 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 @FunctionalInterface
private interface SupplierSQLExceptionAware<T> { public interface SupplierSQLExceptionAware<T> {
T get() throws SQLException; T get() throws SQLException;
} }

View file

@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ClientConnectionRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class ClientConnectionRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ClientConnectionRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ClientConnectionRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -59,7 +59,7 @@ public interface ClientConnectionRecordMapper {
}) })
ClientConnectionRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -73,22 +73,22 @@ public interface ClientConnectionRecordMapper {
}) })
List<ClientConnectionRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(clientConnectionRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord) return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -96,7 +96,7 @@ public interface ClientConnectionRecordMapper {
.execute(); .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) { default int insert(ClientConnectionRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(clientConnectionRecord) .into(clientConnectionRecord)
@ -111,7 +111,7 @@ public interface ClientConnectionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ClientConnectionRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(clientConnectionRecord) .into(clientConnectionRecord)
@ -126,19 +126,19 @@ public interface ClientConnectionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ClientConnectionRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) return SelectDSL.selectWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress)
.from(clientConnectionRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ClientConnectionRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress)
.from(clientConnectionRecord); .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_) { default ClientConnectionRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) return SelectDSL.selectWithMapper(this::selectOne, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress)
.from(clientConnectionRecord) .from(clientConnectionRecord)
@ -147,7 +147,7 @@ public interface ClientConnectionRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ClientConnectionRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -159,7 +159,7 @@ public interface ClientConnectionRecordMapper {
.set(virtualClientAddress).equalTo(record::getVirtualClientAddress); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ClientConnectionRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)
@ -171,7 +171,7 @@ public interface ClientConnectionRecordMapper {
.set(virtualClientAddress).equalToWhenPresent(record::getVirtualClientAddress); .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) { default int updateByPrimaryKey(ClientConnectionRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -186,7 +186,7 @@ public interface ClientConnectionRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ClientConnectionRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)

View file

@ -7,31 +7,31 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ClientEventRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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 static final class ClientEventRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -33,20 +33,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ClientEventRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ClientEventRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -59,7 +59,7 @@ public interface ClientEventRecordMapper {
}) })
ClientEventRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -72,22 +72,22 @@ public interface ClientEventRecordMapper {
}) })
List<ClientEventRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(clientEventRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord) return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -95,7 +95,7 @@ public interface ClientEventRecordMapper {
.execute(); .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) { default int insert(ClientEventRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(clientEventRecord) .into(clientEventRecord)
@ -109,7 +109,7 @@ public interface ClientEventRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ClientEventRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(clientEventRecord) .into(clientEventRecord)
@ -123,19 +123,19 @@ public interface ClientEventRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ClientEventRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) return SelectDSL.selectWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text)
.from(clientEventRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ClientEventRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text)
.from(clientEventRecord); .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_) { default ClientEventRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, connectionId, userIdentifier, type, timestamp, numericValue, text) return SelectDSL.selectWithMapper(this::selectOne, id, connectionId, userIdentifier, type, timestamp, numericValue, text)
.from(clientEventRecord) .from(clientEventRecord)
@ -144,7 +144,7 @@ public interface ClientEventRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ClientEventRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientEventRecord) return UpdateDSL.updateWithMapper(this::update, clientEventRecord)
.set(connectionId).equalTo(record::getConnectionId) .set(connectionId).equalTo(record::getConnectionId)
@ -155,7 +155,7 @@ public interface ClientEventRecordMapper {
.set(text).equalTo(record::getText); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ClientEventRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientEventRecord) return UpdateDSL.updateWithMapper(this::update, clientEventRecord)
.set(connectionId).equalToWhenPresent(record::getConnectionId) .set(connectionId).equalToWhenPresent(record::getConnectionId)
@ -166,7 +166,7 @@ public interface ClientEventRecordMapper {
.set(text).equalToWhenPresent(record::getText); .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) { default int updateByPrimaryKey(ClientEventRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientEventRecord) return UpdateDSL.updateWithMapper(this::update, clientEventRecord)
.set(connectionId).equalTo(record::getConnectionId) .set(connectionId).equalTo(record::getConnectionId)
@ -180,7 +180,7 @@ public interface ClientEventRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ClientEventRecord record) {
return UpdateDSL.updateWithMapper(this::update, clientEventRecord) return UpdateDSL.updateWithMapper(this::update, clientEventRecord)
.set(connectionId).equalToWhenPresent(record::getConnectionId) .set(connectionId).equalToWhenPresent(record::getConnectionId)

View file

@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ConfigurationAttributeRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class ConfigurationAttributeRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ConfigurationAttributeRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ConfigurationAttributeRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -59,7 +59,7 @@ public interface ConfigurationAttributeRecordMapper {
}) })
ConfigurationAttributeRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -73,22 +73,22 @@ public interface ConfigurationAttributeRecordMapper {
}) })
List<ConfigurationAttributeRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(configurationAttributeRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord) return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -96,7 +96,7 @@ public interface ConfigurationAttributeRecordMapper {
.execute(); .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) { default int insert(ConfigurationAttributeRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationAttributeRecord) .into(configurationAttributeRecord)
@ -111,7 +111,7 @@ public interface ConfigurationAttributeRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ConfigurationAttributeRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationAttributeRecord) .into(configurationAttributeRecord)
@ -126,19 +126,19 @@ public interface ConfigurationAttributeRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationAttributeRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) return SelectDSL.selectWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue)
.from(configurationAttributeRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationAttributeRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue)
.from(configurationAttributeRecord); .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_) { default ConfigurationAttributeRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, name, type, parentId, resources, validator, dependencies, defaultValue) return SelectDSL.selectWithMapper(this::selectOne, id, name, type, parentId, resources, validator, dependencies, defaultValue)
.from(configurationAttributeRecord) .from(configurationAttributeRecord)
@ -147,7 +147,7 @@ public interface ConfigurationAttributeRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ConfigurationAttributeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord)
.set(name).equalTo(record::getName) .set(name).equalTo(record::getName)
@ -159,7 +159,7 @@ public interface ConfigurationAttributeRecordMapper {
.set(defaultValue).equalTo(record::getDefaultValue); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ConfigurationAttributeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord)
.set(name).equalToWhenPresent(record::getName) .set(name).equalToWhenPresent(record::getName)
@ -171,7 +171,7 @@ public interface ConfigurationAttributeRecordMapper {
.set(defaultValue).equalToWhenPresent(record::getDefaultValue); .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) { default int updateByPrimaryKey(ConfigurationAttributeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord)
.set(name).equalTo(record::getName) .set(name).equalTo(record::getName)
@ -186,7 +186,7 @@ public interface ConfigurationAttributeRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ConfigurationAttributeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord)
.set(name).equalToWhenPresent(record::getName) .set(name).equalToWhenPresent(record::getName)

View file

@ -6,34 +6,34 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ConfigurationNodeRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class ConfigurationNodeRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ConfigurationNodeRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ConfigurationNodeRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -59,7 +59,7 @@ public interface ConfigurationNodeRecordMapper {
}) })
ConfigurationNodeRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -73,22 +73,22 @@ public interface ConfigurationNodeRecordMapper {
}) })
List<ConfigurationNodeRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(configurationNodeRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord) return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -96,7 +96,7 @@ public interface ConfigurationNodeRecordMapper {
.execute(); .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) { default int insert(ConfigurationNodeRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationNodeRecord) .into(configurationNodeRecord)
@ -111,7 +111,7 @@ public interface ConfigurationNodeRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ConfigurationNodeRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationNodeRecord) .into(configurationNodeRecord)
@ -126,19 +126,19 @@ public interface ConfigurationNodeRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationNodeRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active) return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active)
.from(configurationNodeRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationNodeRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template, active)
.from(configurationNodeRecord); .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_) { default ConfigurationNodeRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, owner, name, description, type, template, active) return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, owner, name, description, type, template, active)
.from(configurationNodeRecord) .from(configurationNodeRecord)
@ -147,7 +147,7 @@ public interface ConfigurationNodeRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ConfigurationNodeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -159,7 +159,7 @@ public interface ConfigurationNodeRecordMapper {
.set(active).equalTo(record::getActive); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ConfigurationNodeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)
@ -171,7 +171,7 @@ public interface ConfigurationNodeRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .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) { default int updateByPrimaryKey(ConfigurationNodeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -186,7 +186,7 @@ public interface ConfigurationNodeRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ConfigurationNodeRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)

View file

@ -7,25 +7,25 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ConfigurationRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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 static final class ConfigurationRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -34,20 +34,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ConfigurationRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ConfigurationRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -58,7 +58,7 @@ public interface ConfigurationRecordMapper {
}) })
ConfigurationRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -69,22 +69,22 @@ public interface ConfigurationRecordMapper {
}) })
List<ConfigurationRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(configurationRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord) return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -92,7 +92,7 @@ public interface ConfigurationRecordMapper {
.execute(); .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) { default int insert(ConfigurationRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationRecord) .into(configurationRecord)
@ -104,7 +104,7 @@ public interface ConfigurationRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ConfigurationRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationRecord) .into(configurationRecord)
@ -116,19 +116,19 @@ public interface ConfigurationRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) return SelectDSL.selectWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup)
.from(configurationRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup)
.from(configurationRecord); .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_) { default ConfigurationRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, configurationNodeId, version, versionDate, followup) return SelectDSL.selectWithMapper(this::selectOne, id, configurationNodeId, version, versionDate, followup)
.from(configurationRecord) .from(configurationRecord)
@ -137,7 +137,7 @@ public interface ConfigurationRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ConfigurationRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationRecord) return UpdateDSL.updateWithMapper(this::update, configurationRecord)
.set(configurationNodeId).equalTo(record::getConfigurationNodeId) .set(configurationNodeId).equalTo(record::getConfigurationNodeId)
@ -146,7 +146,7 @@ public interface ConfigurationRecordMapper {
.set(followup).equalTo(record::getFollowup); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ConfigurationRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationRecord) return UpdateDSL.updateWithMapper(this::update, configurationRecord)
.set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId)
@ -155,7 +155,7 @@ public interface ConfigurationRecordMapper {
.set(followup).equalToWhenPresent(record::getFollowup); .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) { default int updateByPrimaryKey(ConfigurationRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationRecord) return UpdateDSL.updateWithMapper(this::update, configurationRecord)
.set(configurationNodeId).equalTo(record::getConfigurationNodeId) .set(configurationNodeId).equalTo(record::getConfigurationNodeId)
@ -167,7 +167,7 @@ public interface ConfigurationRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ConfigurationRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationRecord) return UpdateDSL.updateWithMapper(this::update, configurationRecord)
.set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId)

View file

@ -6,28 +6,28 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ConfigurationValueRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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 static final class ConfigurationValueRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ConfigurationValueRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ConfigurationValueRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -57,7 +57,7 @@ public interface ConfigurationValueRecordMapper {
}) })
ConfigurationValueRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -69,22 +69,22 @@ public interface ConfigurationValueRecordMapper {
}) })
List<ConfigurationValueRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(configurationValueRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord) return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -92,7 +92,7 @@ public interface ConfigurationValueRecordMapper {
.execute(); .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) { default int insert(ConfigurationValueRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationValueRecord) .into(configurationValueRecord)
@ -105,7 +105,7 @@ public interface ConfigurationValueRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ConfigurationValueRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(configurationValueRecord) .into(configurationValueRecord)
@ -118,19 +118,19 @@ public interface ConfigurationValueRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationValueRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) return SelectDSL.selectWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text)
.from(configurationValueRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ConfigurationValueRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text)
.from(configurationValueRecord); .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_) { default ConfigurationValueRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, configurationId, configurationAttributeId, listIndex, value, text) return SelectDSL.selectWithMapper(this::selectOne, id, configurationId, configurationAttributeId, listIndex, value, text)
.from(configurationValueRecord) .from(configurationValueRecord)
@ -139,7 +139,7 @@ public interface ConfigurationValueRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ConfigurationValueRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) return UpdateDSL.updateWithMapper(this::update, configurationValueRecord)
.set(configurationId).equalTo(record::getConfigurationId) .set(configurationId).equalTo(record::getConfigurationId)
@ -149,7 +149,7 @@ public interface ConfigurationValueRecordMapper {
.set(text).equalTo(record::getText); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ConfigurationValueRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) return UpdateDSL.updateWithMapper(this::update, configurationValueRecord)
.set(configurationId).equalToWhenPresent(record::getConfigurationId) .set(configurationId).equalToWhenPresent(record::getConfigurationId)
@ -159,7 +159,7 @@ public interface ConfigurationValueRecordMapper {
.set(text).equalToWhenPresent(record::getText); .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) { default int updateByPrimaryKey(ConfigurationValueRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) return UpdateDSL.updateWithMapper(this::update, configurationValueRecord)
.set(configurationId).equalTo(record::getConfigurationId) .set(configurationId).equalTo(record::getConfigurationId)
@ -172,7 +172,7 @@ public interface ConfigurationValueRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ConfigurationValueRecord record) {
return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) return UpdateDSL.updateWithMapper(this::update, configurationValueRecord)
.set(configurationId).equalToWhenPresent(record::getConfigurationId) .set(configurationId).equalToWhenPresent(record::getConfigurationId)

View file

@ -6,22 +6,22 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ExamConfigurationMapRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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 static final class ExamConfigurationMapRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ExamConfigurationMapRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ExamConfigurationMapRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -55,7 +55,7 @@ public interface ExamConfigurationMapRecordMapper {
}) })
ExamConfigurationMapRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -65,22 +65,22 @@ public interface ExamConfigurationMapRecordMapper {
}) })
List<ExamConfigurationMapRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(examConfigurationMapRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord) return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -88,7 +88,7 @@ public interface ExamConfigurationMapRecordMapper {
.execute(); .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) { default int insert(ExamConfigurationMapRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(examConfigurationMapRecord) .into(examConfigurationMapRecord)
@ -99,7 +99,7 @@ public interface ExamConfigurationMapRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ExamConfigurationMapRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(examConfigurationMapRecord) .into(examConfigurationMapRecord)
@ -110,19 +110,19 @@ public interface ExamConfigurationMapRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamConfigurationMapRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) return SelectDSL.selectWithMapper(this::selectMany, id, examId, configurationNodeId, userNames)
.from(examConfigurationMapRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamConfigurationMapRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, configurationNodeId, userNames)
.from(examConfigurationMapRecord); .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_) { default ExamConfigurationMapRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, examId, configurationNodeId, userNames) return SelectDSL.selectWithMapper(this::selectOne, id, examId, configurationNodeId, userNames)
.from(examConfigurationMapRecord) .from(examConfigurationMapRecord)
@ -131,7 +131,7 @@ public interface ExamConfigurationMapRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ExamConfigurationMapRecord record) {
return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -139,7 +139,7 @@ public interface ExamConfigurationMapRecordMapper {
.set(userNames).equalTo(record::getUserNames); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ExamConfigurationMapRecord record) {
return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)
@ -147,7 +147,7 @@ public interface ExamConfigurationMapRecordMapper {
.set(userNames).equalToWhenPresent(record::getUserNames); .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) { default int updateByPrimaryKey(ExamConfigurationMapRecord record) {
return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -158,7 +158,7 @@ public interface ExamConfigurationMapRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ExamConfigurationMapRecord record) {
return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)

View file

@ -6,37 +6,37 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ExamRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class ExamRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ExamRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ExamRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -60,7 +60,7 @@ public interface ExamRecordMapper {
}) })
ExamRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -75,22 +75,22 @@ public interface ExamRecordMapper {
}) })
List<ExamRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(examRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, examRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, examRecord) return DeleteDSL.deleteFromWithMapper(this::delete, examRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -98,7 +98,7 @@ public interface ExamRecordMapper {
.execute(); .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) { default int insert(ExamRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(examRecord) .into(examRecord)
@ -114,7 +114,7 @@ public interface ExamRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ExamRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(examRecord) .into(examRecord)
@ -130,19 +130,19 @@ public interface ExamRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active)
.from(examRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active)
.from(examRecord); .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_) { default ExamRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active) return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, lmsSetupId, externalId, owner, supporter, type, status, active)
.from(examRecord) .from(examRecord)
@ -151,7 +151,7 @@ public interface ExamRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ExamRecord record) {
return UpdateDSL.updateWithMapper(this::update, examRecord) return UpdateDSL.updateWithMapper(this::update, examRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -164,7 +164,7 @@ public interface ExamRecordMapper {
.set(active).equalTo(record::getActive); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ExamRecord record) {
return UpdateDSL.updateWithMapper(this::update, examRecord) return UpdateDSL.updateWithMapper(this::update, examRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)
@ -177,7 +177,7 @@ public interface ExamRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .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) { default int updateByPrimaryKey(ExamRecord record) {
return UpdateDSL.updateWithMapper(this::update, examRecord) return UpdateDSL.updateWithMapper(this::update, examRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -193,7 +193,7 @@ public interface ExamRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ExamRecord record) {
return UpdateDSL.updateWithMapper(this::update, examRecord) return UpdateDSL.updateWithMapper(this::update, examRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)

View file

@ -6,25 +6,25 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class IndicatorRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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 static final class IndicatorRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface IndicatorRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<IndicatorRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -56,7 +56,7 @@ public interface IndicatorRecordMapper {
}) })
IndicatorRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -67,22 +67,22 @@ public interface IndicatorRecordMapper {
}) })
List<IndicatorRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(indicatorRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord) return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -90,7 +90,7 @@ public interface IndicatorRecordMapper {
.execute(); .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) { default int insert(IndicatorRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(indicatorRecord) .into(indicatorRecord)
@ -102,7 +102,7 @@ public interface IndicatorRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(IndicatorRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(indicatorRecord) .into(indicatorRecord)
@ -114,19 +114,19 @@ public interface IndicatorRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<IndicatorRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, examId, type, name, color) return SelectDSL.selectWithMapper(this::selectMany, id, examId, type, name, color)
.from(indicatorRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<IndicatorRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, type, name, color) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, type, name, color)
.from(indicatorRecord); .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_) { default IndicatorRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, examId, type, name, color) return SelectDSL.selectWithMapper(this::selectOne, id, examId, type, name, color)
.from(indicatorRecord) .from(indicatorRecord)
@ -135,7 +135,7 @@ public interface IndicatorRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(IndicatorRecord record) {
return UpdateDSL.updateWithMapper(this::update, indicatorRecord) return UpdateDSL.updateWithMapper(this::update, indicatorRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -144,7 +144,7 @@ public interface IndicatorRecordMapper {
.set(color).equalTo(record::getColor); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(IndicatorRecord record) {
return UpdateDSL.updateWithMapper(this::update, indicatorRecord) return UpdateDSL.updateWithMapper(this::update, indicatorRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)
@ -153,7 +153,7 @@ public interface IndicatorRecordMapper {
.set(color).equalToWhenPresent(record::getColor); .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) { default int updateByPrimaryKey(IndicatorRecord record) {
return UpdateDSL.updateWithMapper(this::update, indicatorRecord) return UpdateDSL.updateWithMapper(this::update, indicatorRecord)
.set(examId).equalTo(record::getExamId) .set(examId).equalTo(record::getExamId)
@ -165,7 +165,7 @@ public interface IndicatorRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(IndicatorRecord record) {
return UpdateDSL.updateWithMapper(this::update, indicatorRecord) return UpdateDSL.updateWithMapper(this::update, indicatorRecord)
.set(examId).equalToWhenPresent(record::getExamId) .set(examId).equalToWhenPresent(record::getExamId)

View file

@ -6,25 +6,25 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class InstitutionRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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 static final class InstitutionRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface InstitutionRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<InstitutionRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -56,7 +56,7 @@ public interface InstitutionRecordMapper {
}) })
InstitutionRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -67,22 +67,22 @@ public interface InstitutionRecordMapper {
}) })
List<InstitutionRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(institutionRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord) return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -90,7 +90,7 @@ public interface InstitutionRecordMapper {
.execute(); .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) { default int insert(InstitutionRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(institutionRecord) .into(institutionRecord)
@ -102,7 +102,7 @@ public interface InstitutionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(InstitutionRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(institutionRecord) .into(institutionRecord)
@ -114,19 +114,19 @@ public interface InstitutionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<InstitutionRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage) return SelectDSL.selectWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage)
.from(institutionRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<InstitutionRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, urlSuffix, active, logoImage)
.from(institutionRecord); .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_) { default InstitutionRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, name, urlSuffix, active, logoImage) return SelectDSL.selectWithMapper(this::selectOne, id, name, urlSuffix, active, logoImage)
.from(institutionRecord) .from(institutionRecord)
@ -135,7 +135,7 @@ public interface InstitutionRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(InstitutionRecord record) {
return UpdateDSL.updateWithMapper(this::update, institutionRecord) return UpdateDSL.updateWithMapper(this::update, institutionRecord)
.set(name).equalTo(record::getName) .set(name).equalTo(record::getName)
@ -144,7 +144,7 @@ public interface InstitutionRecordMapper {
.set(logoImage).equalTo(record::getLogoImage); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(InstitutionRecord record) {
return UpdateDSL.updateWithMapper(this::update, institutionRecord) return UpdateDSL.updateWithMapper(this::update, institutionRecord)
.set(name).equalToWhenPresent(record::getName) .set(name).equalToWhenPresent(record::getName)
@ -153,7 +153,7 @@ public interface InstitutionRecordMapper {
.set(logoImage).equalToWhenPresent(record::getLogoImage); .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) { default int updateByPrimaryKey(InstitutionRecord record) {
return UpdateDSL.updateWithMapper(this::update, institutionRecord) return UpdateDSL.updateWithMapper(this::update, institutionRecord)
.set(name).equalTo(record::getName) .set(name).equalTo(record::getName)
@ -165,7 +165,7 @@ public interface InstitutionRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(InstitutionRecord record) {
return UpdateDSL.updateWithMapper(this::update, institutionRecord) return UpdateDSL.updateWithMapper(this::update, institutionRecord)
.set(name).equalToWhenPresent(record::getName) .set(name).equalToWhenPresent(record::getName)

View file

@ -6,43 +6,43 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class LmsSetupRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class LmsSetupRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface LmsSetupRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<LmsSetupRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -62,7 +62,7 @@ public interface LmsSetupRecordMapper {
}) })
LmsSetupRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -79,22 +79,22 @@ public interface LmsSetupRecordMapper {
}) })
List<LmsSetupRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(lmsSetupRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, lmsSetupRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, lmsSetupRecord) return DeleteDSL.deleteFromWithMapper(this::delete, lmsSetupRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -102,7 +102,7 @@ public interface LmsSetupRecordMapper {
.execute(); .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) { default int insert(LmsSetupRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(lmsSetupRecord) .into(lmsSetupRecord)
@ -120,7 +120,7 @@ public interface LmsSetupRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(LmsSetupRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(lmsSetupRecord) .into(lmsSetupRecord)
@ -138,19 +138,19 @@ public interface LmsSetupRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<LmsSetupRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active)
.from(lmsSetupRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<LmsSetupRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active)
.from(lmsSetupRecord); .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_) { default LmsSetupRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active) return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret, active)
.from(lmsSetupRecord) .from(lmsSetupRecord)
@ -159,7 +159,7 @@ public interface LmsSetupRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(LmsSetupRecord record) {
return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -174,7 +174,7 @@ public interface LmsSetupRecordMapper {
.set(active).equalTo(record::getActive); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(LmsSetupRecord record) {
return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)
@ -189,7 +189,7 @@ public interface LmsSetupRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .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) { default int updateByPrimaryKey(LmsSetupRecord record) {
return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -207,7 +207,7 @@ public interface LmsSetupRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(LmsSetupRecord record) {
return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord) return UpdateDSL.updateWithMapper(this::update, lmsSetupRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)

View file

@ -6,37 +6,37 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class OrientationRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class OrientationRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface OrientationRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<OrientationRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -60,7 +60,7 @@ public interface OrientationRecordMapper {
}) })
OrientationRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -75,22 +75,22 @@ public interface OrientationRecordMapper {
}) })
List<OrientationRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(orientationRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord) return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -98,7 +98,7 @@ public interface OrientationRecordMapper {
.execute(); .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) { default int insert(OrientationRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(orientationRecord) .into(orientationRecord)
@ -114,7 +114,7 @@ public interface OrientationRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(OrientationRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(orientationRecord) .into(orientationRecord)
@ -130,19 +130,19 @@ public interface OrientationRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<OrientationRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) return SelectDSL.selectWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height)
.from(orientationRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<OrientationRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height)
.from(orientationRecord); .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_) { default OrientationRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) return SelectDSL.selectWithMapper(this::selectOne, id, configAttributeId, template, view, group, xPosition, yPosition, width, height)
.from(orientationRecord) .from(orientationRecord)
@ -151,7 +151,7 @@ public interface OrientationRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(OrientationRecord record) {
return UpdateDSL.updateWithMapper(this::update, orientationRecord) return UpdateDSL.updateWithMapper(this::update, orientationRecord)
.set(configAttributeId).equalTo(record::getConfigAttributeId) .set(configAttributeId).equalTo(record::getConfigAttributeId)
@ -164,7 +164,7 @@ public interface OrientationRecordMapper {
.set(height).equalTo(record::getHeight); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(OrientationRecord record) {
return UpdateDSL.updateWithMapper(this::update, orientationRecord) return UpdateDSL.updateWithMapper(this::update, orientationRecord)
.set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId)
@ -177,7 +177,7 @@ public interface OrientationRecordMapper {
.set(height).equalToWhenPresent(record::getHeight); .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) { default int updateByPrimaryKey(OrientationRecord record) {
return UpdateDSL.updateWithMapper(this::update, orientationRecord) return UpdateDSL.updateWithMapper(this::update, orientationRecord)
.set(configAttributeId).equalTo(record::getConfigAttributeId) .set(configAttributeId).equalTo(record::getConfigAttributeId)
@ -193,7 +193,7 @@ public interface OrientationRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(OrientationRecord record) {
return UpdateDSL.updateWithMapper(this::update, orientationRecord) return UpdateDSL.updateWithMapper(this::update, orientationRecord)
.set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId)

View file

@ -6,19 +6,19 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class RoleRecordDynamicSqlSupport { 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(); 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; 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; 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; 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 static final class RoleRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface RoleRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<RoleRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -54,7 +54,7 @@ public interface RoleRecordMapper {
}) })
RoleRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -63,22 +63,22 @@ public interface RoleRecordMapper {
}) })
List<RoleRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(roleRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord) return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -86,7 +86,7 @@ public interface RoleRecordMapper {
.execute(); .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) { default int insert(RoleRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(roleRecord) .into(roleRecord)
@ -96,7 +96,7 @@ public interface RoleRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(RoleRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(roleRecord) .into(roleRecord)
@ -106,19 +106,19 @@ public interface RoleRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<RoleRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, userId, roleName) return SelectDSL.selectWithMapper(this::selectMany, id, userId, roleName)
.from(roleRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<RoleRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userId, roleName) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userId, roleName)
.from(roleRecord); .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_) { default RoleRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, userId, roleName) return SelectDSL.selectWithMapper(this::selectOne, id, userId, roleName)
.from(roleRecord) .from(roleRecord)
@ -127,21 +127,21 @@ public interface RoleRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(RoleRecord record) {
return UpdateDSL.updateWithMapper(this::update, roleRecord) return UpdateDSL.updateWithMapper(this::update, roleRecord)
.set(userId).equalTo(record::getUserId) .set(userId).equalTo(record::getUserId)
.set(roleName).equalTo(record::getRoleName); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(RoleRecord record) {
return UpdateDSL.updateWithMapper(this::update, roleRecord) return UpdateDSL.updateWithMapper(this::update, roleRecord)
.set(userId).equalToWhenPresent(record::getUserId) .set(userId).equalToWhenPresent(record::getUserId)
.set(roleName).equalToWhenPresent(record::getRoleName); .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) { default int updateByPrimaryKey(RoleRecord record) {
return UpdateDSL.updateWithMapper(this::update, roleRecord) return UpdateDSL.updateWithMapper(this::update, roleRecord)
.set(userId).equalTo(record::getUserId) .set(userId).equalTo(record::getUserId)
@ -151,7 +151,7 @@ public interface RoleRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(RoleRecord record) {
return UpdateDSL.updateWithMapper(this::update, roleRecord) return UpdateDSL.updateWithMapper(this::update, roleRecord)
.set(userId).equalToWhenPresent(record::getUserId) .set(userId).equalToWhenPresent(record::getUserId)

View file

@ -7,22 +7,22 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class ThresholdRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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 static final class ThresholdRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -33,20 +33,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ThresholdRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<ThresholdRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -56,7 +56,7 @@ public interface ThresholdRecordMapper {
}) })
ThresholdRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -66,22 +66,22 @@ public interface ThresholdRecordMapper {
}) })
List<ThresholdRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(thresholdRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, thresholdRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, thresholdRecord) return DeleteDSL.deleteFromWithMapper(this::delete, thresholdRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -89,7 +89,7 @@ public interface ThresholdRecordMapper {
.execute(); .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) { default int insert(ThresholdRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(thresholdRecord) .into(thresholdRecord)
@ -100,7 +100,7 @@ public interface ThresholdRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(ThresholdRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(thresholdRecord) .into(thresholdRecord)
@ -111,19 +111,19 @@ public interface ThresholdRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ThresholdRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, indicatorId, value, color) return SelectDSL.selectWithMapper(this::selectMany, id, indicatorId, value, color)
.from(thresholdRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ThresholdRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, indicatorId, value, color) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, indicatorId, value, color)
.from(thresholdRecord); .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_) { default ThresholdRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, indicatorId, value, color) return SelectDSL.selectWithMapper(this::selectOne, id, indicatorId, value, color)
.from(thresholdRecord) .from(thresholdRecord)
@ -132,7 +132,7 @@ public interface ThresholdRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(ThresholdRecord record) {
return UpdateDSL.updateWithMapper(this::update, thresholdRecord) return UpdateDSL.updateWithMapper(this::update, thresholdRecord)
.set(indicatorId).equalTo(record::getIndicatorId) .set(indicatorId).equalTo(record::getIndicatorId)
@ -140,7 +140,7 @@ public interface ThresholdRecordMapper {
.set(color).equalTo(record::getColor); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(ThresholdRecord record) {
return UpdateDSL.updateWithMapper(this::update, thresholdRecord) return UpdateDSL.updateWithMapper(this::update, thresholdRecord)
.set(indicatorId).equalToWhenPresent(record::getIndicatorId) .set(indicatorId).equalToWhenPresent(record::getIndicatorId)
@ -148,7 +148,7 @@ public interface ThresholdRecordMapper {
.set(color).equalToWhenPresent(record::getColor); .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) { default int updateByPrimaryKey(ThresholdRecord record) {
return UpdateDSL.updateWithMapper(this::update, thresholdRecord) return UpdateDSL.updateWithMapper(this::update, thresholdRecord)
.set(indicatorId).equalTo(record::getIndicatorId) .set(indicatorId).equalTo(record::getIndicatorId)
@ -159,7 +159,7 @@ public interface ThresholdRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(ThresholdRecord record) {
return UpdateDSL.updateWithMapper(this::update, thresholdRecord) return UpdateDSL.updateWithMapper(this::update, thresholdRecord)
.set(indicatorId).equalToWhenPresent(record::getIndicatorId) .set(indicatorId).equalToWhenPresent(record::getIndicatorId)

View file

@ -6,31 +6,31 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class UserActivityLogRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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 static final class UserActivityLogRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface UserActivityLogRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<UserActivityLogRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -58,7 +58,7 @@ public interface UserActivityLogRecordMapper {
}) })
UserActivityLogRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -71,22 +71,22 @@ public interface UserActivityLogRecordMapper {
}) })
List<UserActivityLogRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(userActivityLogRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, userActivityLogRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, userActivityLogRecord) return DeleteDSL.deleteFromWithMapper(this::delete, userActivityLogRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -94,7 +94,7 @@ public interface UserActivityLogRecordMapper {
.execute(); .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) { default int insert(UserActivityLogRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userActivityLogRecord) .into(userActivityLogRecord)
@ -108,7 +108,7 @@ public interface UserActivityLogRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(UserActivityLogRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userActivityLogRecord) .into(userActivityLogRecord)
@ -122,19 +122,19 @@ public interface UserActivityLogRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserActivityLogRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message) return SelectDSL.selectWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message)
.from(userActivityLogRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserActivityLogRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userUuid, timestamp, activityType, entityType, entityId, message)
.from(userActivityLogRecord); .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_) { default UserActivityLogRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, userUuid, timestamp, activityType, entityType, entityId, message) return SelectDSL.selectWithMapper(this::selectOne, id, userUuid, timestamp, activityType, entityType, entityId, message)
.from(userActivityLogRecord) .from(userActivityLogRecord)
@ -143,7 +143,7 @@ public interface UserActivityLogRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(UserActivityLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord)
.set(userUuid).equalTo(record::getUserUuid) .set(userUuid).equalTo(record::getUserUuid)
@ -154,7 +154,7 @@ public interface UserActivityLogRecordMapper {
.set(message).equalTo(record::getMessage); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(UserActivityLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord)
.set(userUuid).equalToWhenPresent(record::getUserUuid) .set(userUuid).equalToWhenPresent(record::getUserUuid)
@ -165,7 +165,7 @@ public interface UserActivityLogRecordMapper {
.set(message).equalToWhenPresent(record::getMessage); .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) { default int updateByPrimaryKey(UserActivityLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord)
.set(userUuid).equalTo(record::getUserUuid) .set(userUuid).equalTo(record::getUserUuid)
@ -179,7 +179,7 @@ public interface UserActivityLogRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(UserActivityLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord) return UpdateDSL.updateWithMapper(this::update, userActivityLogRecord)
.set(userUuid).equalToWhenPresent(record::getUserUuid) .set(userUuid).equalToWhenPresent(record::getUserUuid)

View file

@ -6,40 +6,40 @@ import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.SqlTable;
public final class UserRecordDynamicSqlSupport { 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(); 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 static final class UserRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT); public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

View file

@ -32,20 +32,20 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface UserRecordMapper { 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
long count(SelectStatementProvider selectStatement); 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") @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
int delete(DeleteStatementProvider deleteStatement); 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") @InsertProvider(type=SqlProviderAdapter.class, method="insert")
@SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
int insert(InsertStatementProvider<UserRecord> insertStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -61,7 +61,7 @@ public interface UserRecordMapper {
}) })
UserRecord selectOne(SelectStatementProvider selectStatement); 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") @SelectProvider(type=SqlProviderAdapter.class, method="select")
@ConstructorArgs({ @ConstructorArgs({
@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true),
@ -77,22 +77,22 @@ public interface UserRecordMapper {
}) })
List<UserRecord> selectMany(SelectStatementProvider selectStatement); 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") @UpdateProvider(type=SqlProviderAdapter.class, method="update")
int update(UpdateStatementProvider updateStatement); 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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
.from(userRecord); .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() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, userRecord); 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_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, userRecord) return DeleteDSL.deleteFromWithMapper(this::delete, userRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -100,7 +100,7 @@ public interface UserRecordMapper {
.execute(); .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) { default int insert(UserRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userRecord) .into(userRecord)
@ -117,7 +117,7 @@ public interface UserRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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) { default int insertSelective(UserRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userRecord) .into(userRecord)
@ -134,19 +134,19 @@ public interface UserRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active) return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active)
.from(userRecord); .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() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, uuid, name, username, password, email, locale, timezone, active)
.from(userRecord); .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_) { default UserRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, uuid, name, username, password, email, locale, timezone, active) return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, uuid, name, username, password, email, locale, timezone, active)
.from(userRecord) .from(userRecord)
@ -155,7 +155,7 @@ public interface UserRecordMapper {
.execute(); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(UserRecord record) {
return UpdateDSL.updateWithMapper(this::update, userRecord) return UpdateDSL.updateWithMapper(this::update, userRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -169,7 +169,7 @@ public interface UserRecordMapper {
.set(active).equalTo(record::getActive); .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) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(UserRecord record) {
return UpdateDSL.updateWithMapper(this::update, userRecord) return UpdateDSL.updateWithMapper(this::update, userRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)
@ -183,7 +183,7 @@ public interface UserRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .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) { default int updateByPrimaryKey(UserRecord record) {
return UpdateDSL.updateWithMapper(this::update, userRecord) return UpdateDSL.updateWithMapper(this::update, userRecord)
.set(institutionId).equalTo(record::getInstitutionId) .set(institutionId).equalTo(record::getInstitutionId)
@ -200,7 +200,7 @@ public interface UserRecordMapper {
.execute(); .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) { default int updateByPrimaryKeySelective(UserRecord record) {
return UpdateDSL.updateWithMapper(this::update, userRecord) return UpdateDSL.updateWithMapper(this::update, userRecord)
.set(institutionId).equalToWhenPresent(record::getInstitutionId) .set(institutionId).equalToWhenPresent(record::getInstitutionId)

View file

@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ClientConnectionRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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) { public ClientConnectionRecord(Long id, Long examId, String status, String connectionToken, String userName, Boolean vdi, String clientAddress, String virtualClientAddress) {
this.id = id; this.id = id;
this.examId = examId; this.examId = examId;
@ -39,42 +39,42 @@ public class ClientConnectionRecord {
this.virtualClientAddress = virtualClientAddress; 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() { public Long getId() {
return id; 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() { public Long getExamId() {
return examId; 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() { public String getStatus() {
return status; 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() { public String getConnectionToken() {
return connectionToken; 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() { public String getUserName() {
return userName; 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() { public Boolean getVdi() {
return vdi; 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() { public String getClientAddress() {
return clientAddress; 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() { public String getVirtualClientAddress() {
return virtualClientAddress; return virtualClientAddress;
} }
@ -83,7 +83,7 @@ public class ClientConnectionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_connection * 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 @Override
public String toString() { public String toString() {
@ -107,7 +107,7 @@ public class ClientConnectionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_connection * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -135,7 +135,7 @@ public class ClientConnectionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_connection * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -4,28 +4,28 @@ import java.math.BigDecimal;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ClientEventRecord { 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; 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; 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; 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; 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; 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; 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; 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) { public ClientEventRecord(Long id, Long connectionId, String userIdentifier, Integer type, Long timestamp, BigDecimal numericValue, String text) {
this.id = id; this.id = id;
this.connectionId = connectionId; this.connectionId = connectionId;
@ -36,37 +36,37 @@ public class ClientEventRecord {
this.text = text; 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() { public Long getId() {
return id; 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() { public Long getConnectionId() {
return connectionId; 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() { public String getUserIdentifier() {
return userIdentifier; 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() { public Integer getType() {
return type; 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() { public Long getTimestamp() {
return timestamp; 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() { public BigDecimal getNumericValue() {
return numericValue; 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() { public String getText() {
return text; return text;
} }
@ -75,7 +75,7 @@ public class ClientEventRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_event * 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 @Override
public String toString() { public String toString() {
@ -98,7 +98,7 @@ public class ClientEventRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_event * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -125,7 +125,7 @@ public class ClientEventRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table client_event * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ConfigurationAttributeRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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) { public ConfigurationAttributeRecord(Long id, String name, String type, Long parentId, String resources, String validator, String dependencies, String defaultValue) {
this.id = id; this.id = id;
this.name = name; this.name = name;
@ -39,42 +39,42 @@ public class ConfigurationAttributeRecord {
this.defaultValue = defaultValue; 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() { public Long getId() {
return id; 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() { public String getName() {
return name; 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() { public String getType() {
return type; 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() { public Long getParentId() {
return parentId; 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() { public String getResources() {
return resources; 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() { public String getValidator() {
return validator; 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() { public String getDependencies() {
return dependencies; 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() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
@ -83,7 +83,7 @@ public class ConfigurationAttributeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_attribute * 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 @Override
public String toString() { public String toString() {
@ -107,7 +107,7 @@ public class ConfigurationAttributeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_attribute * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -135,7 +135,7 @@ public class ConfigurationAttributeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_attribute * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,31 +3,31 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ConfigurationNodeRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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) { public ConfigurationNodeRecord(Long id, Long institutionId, String owner, String name, String description, String type, String template, Integer active) {
this.id = id; this.id = id;
this.institutionId = institutionId; this.institutionId = institutionId;
@ -39,42 +39,42 @@ public class ConfigurationNodeRecord {
this.active = active; 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() { public Long getId() {
return id; 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() { public Long getInstitutionId() {
return institutionId; 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() { public String getOwner() {
return owner; 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() { public String getName() {
return name; 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() { public String getDescription() {
return description; 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() { public String getType() {
return type; 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() { public String getTemplate() {
return template; 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() { public Integer getActive() {
return active; return active;
} }
@ -83,7 +83,7 @@ public class ConfigurationNodeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_node * 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 @Override
public String toString() { public String toString() {
@ -107,7 +107,7 @@ public class ConfigurationNodeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_node * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -135,7 +135,7 @@ public class ConfigurationNodeRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_node * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -4,22 +4,22 @@ import javax.annotation.Generated;
import org.joda.time.DateTime; import org.joda.time.DateTime;
public class ConfigurationRecord { 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; 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; 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; 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; 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; 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) { public ConfigurationRecord(Long id, Long configurationNodeId, String version, DateTime versionDate, Integer followup) {
this.id = id; this.id = id;
this.configurationNodeId = configurationNodeId; this.configurationNodeId = configurationNodeId;
@ -28,27 +28,27 @@ public class ConfigurationRecord {
this.followup = followup; 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() { public Long getId() {
return id; 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() { public Long getConfigurationNodeId() {
return configurationNodeId; 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() { public String getVersion() {
return version; 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() { public DateTime getVersionDate() {
return versionDate; 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() { public Integer getFollowup() {
return followup; return followup;
} }
@ -57,7 +57,7 @@ public class ConfigurationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration * 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 @Override
public String toString() { public String toString() {
@ -78,7 +78,7 @@ public class ConfigurationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -103,7 +103,7 @@ public class ConfigurationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,25 +3,25 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ConfigurationValueRecord { 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; 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; 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; 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; 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; 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; 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) { public ConfigurationValueRecord(Long id, Long configurationId, Long configurationAttributeId, Integer listIndex, String value, String text) {
this.id = id; this.id = id;
this.configurationId = configurationId; this.configurationId = configurationId;
@ -31,32 +31,32 @@ public class ConfigurationValueRecord {
this.text = text; 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() { public Long getId() {
return id; 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() { public Long getConfigurationId() {
return configurationId; 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() { public Long getConfigurationAttributeId() {
return configurationAttributeId; 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() { public Integer getListIndex() {
return listIndex; 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() { public String getValue() {
return value; 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() { public String getText() {
return text; return text;
} }
@ -65,7 +65,7 @@ public class ConfigurationValueRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_value * 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 @Override
public String toString() { public String toString() {
@ -87,7 +87,7 @@ public class ConfigurationValueRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_value * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -113,7 +113,7 @@ public class ConfigurationValueRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table configuration_value * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,19 +3,19 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ExamConfigurationMapRecord { 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; 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; 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; 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; 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) { public ExamConfigurationMapRecord(Long id, Long examId, Long configurationNodeId, String userNames) {
this.id = id; this.id = id;
this.examId = examId; this.examId = examId;
@ -23,22 +23,22 @@ public class ExamConfigurationMapRecord {
this.userNames = userNames; 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() { public Long getId() {
return id; 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() { public Long getExamId() {
return examId; 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() { public Long getConfigurationNodeId() {
return configurationNodeId; 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() { public String getUserNames() {
return userNames; return userNames;
} }
@ -47,7 +47,7 @@ public class ExamConfigurationMapRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam_configuration_map * 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 @Override
public String toString() { public String toString() {
@ -67,7 +67,7 @@ public class ExamConfigurationMapRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam_configuration_map * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -91,7 +91,7 @@ public class ExamConfigurationMapRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam_configuration_map * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,34 +3,34 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ExamRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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; 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) { public ExamRecord(Long id, Long institutionId, Long lmsSetupId, String externalId, String owner, String supporter, String type, String status, Integer active) {
this.id = id; this.id = id;
this.institutionId = institutionId; this.institutionId = institutionId;
@ -43,47 +43,47 @@ public class ExamRecord {
this.active = active; 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() { public Long getId() {
return id; 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() { public Long getInstitutionId() {
return institutionId; 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() { public Long getLmsSetupId() {
return lmsSetupId; 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() { public String getExternalId() {
return externalId; 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() { public String getOwner() {
return owner; 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() { public String getSupporter() {
return supporter; 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() { public String getType() {
return type; 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() { public String getStatus() {
return status; 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() { public Integer getActive() {
return active; return active;
} }
@ -92,7 +92,7 @@ public class ExamRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam * 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 @Override
public String toString() { public String toString() {
@ -117,7 +117,7 @@ public class ExamRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -146,7 +146,7 @@ public class ExamRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table exam * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,22 +3,22 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class IndicatorRecord { 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; 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; 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; 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; 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; 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) { public IndicatorRecord(Long id, Long examId, String type, String name, String color) {
this.id = id; this.id = id;
this.examId = examId; this.examId = examId;
@ -27,27 +27,27 @@ public class IndicatorRecord {
this.color = color; 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() { public Long getId() {
return id; 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() { public Long getExamId() {
return examId; 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() { public String getType() {
return type; 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() { public String getName() {
return name; 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() { public String getColor() {
return color; return color;
} }
@ -56,7 +56,7 @@ public class IndicatorRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table indicator * 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 @Override
public String toString() { public String toString() {
@ -77,7 +77,7 @@ public class IndicatorRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table indicator * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -102,7 +102,7 @@ public class IndicatorRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table indicator * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,22 +3,22 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class InstitutionRecord { 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; 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; 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; 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; 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; 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) { public InstitutionRecord(Long id, String name, String urlSuffix, Integer active, String logoImage) {
this.id = id; this.id = id;
this.name = name; this.name = name;
@ -27,27 +27,27 @@ public class InstitutionRecord {
this.logoImage = logoImage; 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() { public Long getId() {
return id; 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() { public String getName() {
return name; 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() { public String getUrlSuffix() {
return urlSuffix; 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() { public Integer getActive() {
return active; 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() { public String getLogoImage() {
return logoImage; return logoImage;
} }
@ -56,7 +56,7 @@ public class InstitutionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table institution * 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 @Override
public String toString() { public String toString() {
@ -77,7 +77,7 @@ public class InstitutionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table institution * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -102,7 +102,7 @@ public class InstitutionRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table institution * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,40 +3,40 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class LmsSetupRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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) { 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.id = id;
this.institutionId = institutionId; this.institutionId = institutionId;
@ -51,57 +51,57 @@ public class LmsSetupRecord {
this.active = active; 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() { public Long getId() {
return id; 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() { public Long getInstitutionId() {
return institutionId; 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() { public String getName() {
return name; 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() { public String getLmsType() {
return lmsType; 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() { public String getLmsUrl() {
return lmsUrl; 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() { public String getLmsClientname() {
return lmsClientname; 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() { public String getLmsClientsecret() {
return lmsClientsecret; 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() { public String getLmsRestApiToken() {
return lmsRestApiToken; 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() { public String getSebClientname() {
return sebClientname; 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() { public String getSebClientsecret() {
return sebClientsecret; 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() { public Integer getActive() {
return active; return active;
} }
@ -110,7 +110,7 @@ public class LmsSetupRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table lms_setup * 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 @Override
public String toString() { public String toString() {
@ -137,7 +137,7 @@ public class LmsSetupRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table lms_setup * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -168,7 +168,7 @@ public class LmsSetupRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table lms_setup * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,34 +3,34 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class OrientationRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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; 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) { public OrientationRecord(Long id, Long configAttributeId, String template, String view, String group, Integer xPosition, Integer yPosition, Integer width, Integer height) {
this.id = id; this.id = id;
this.configAttributeId = configAttributeId; this.configAttributeId = configAttributeId;
@ -43,47 +43,47 @@ public class OrientationRecord {
this.height = height; 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() { public Long getId() {
return id; 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() { public Long getConfigAttributeId() {
return configAttributeId; 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() { public String getTemplate() {
return template; 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() { public String getView() {
return view; 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() { public String getGroup() {
return group; 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() { public Integer getxPosition() {
return xPosition; 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() { public Integer getyPosition() {
return yPosition; 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() { public Integer getWidth() {
return width; 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() { public Integer getHeight() {
return height; return height;
} }
@ -92,7 +92,7 @@ public class OrientationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table orientation * 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 @Override
public String toString() { public String toString() {
@ -117,7 +117,7 @@ public class OrientationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table orientation * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -146,7 +146,7 @@ public class OrientationRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table orientation * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,33 +3,33 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class RoleRecord { 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; 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; 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; 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) { public RoleRecord(Long id, Long userId, String roleName) {
this.id = id; this.id = id;
this.userId = userId; this.userId = userId;
this.roleName = roleName; 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() { public Long getId() {
return id; 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() { public Long getUserId() {
return userId; 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() { public String getRoleName() {
return roleName; return roleName;
} }
@ -38,7 +38,7 @@ public class RoleRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_role * 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 @Override
public String toString() { public String toString() {
@ -57,7 +57,7 @@ public class RoleRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_role * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -80,7 +80,7 @@ public class RoleRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_role * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -4,19 +4,19 @@ import java.math.BigDecimal;
import javax.annotation.Generated; import javax.annotation.Generated;
public class ThresholdRecord { 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; 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; 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; 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; 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) { public ThresholdRecord(Long id, Long indicatorId, BigDecimal value, String color) {
this.id = id; this.id = id;
this.indicatorId = indicatorId; this.indicatorId = indicatorId;
@ -24,22 +24,22 @@ public class ThresholdRecord {
this.color = color; 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() { public Long getId() {
return id; 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() { public Long getIndicatorId() {
return indicatorId; 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() { public BigDecimal getValue() {
return value; 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() { public String getColor() {
return color; return color;
} }
@ -48,7 +48,7 @@ public class ThresholdRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table threshold * 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 @Override
public String toString() { public String toString() {
@ -68,7 +68,7 @@ public class ThresholdRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table threshold * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -92,7 +92,7 @@ public class ThresholdRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table threshold * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,28 +3,28 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class UserActivityLogRecord { 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; 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; 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; 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; 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; 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; 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; 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) { public UserActivityLogRecord(Long id, String userUuid, Long timestamp, String activityType, String entityType, String entityId, String message) {
this.id = id; this.id = id;
this.userUuid = userUuid; this.userUuid = userUuid;
@ -35,37 +35,37 @@ public class UserActivityLogRecord {
this.message = message; 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() { public Long getId() {
return id; 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() { public String getUserUuid() {
return userUuid; 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() { public Long getTimestamp() {
return timestamp; 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() { public String getActivityType() {
return activityType; 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() { public String getEntityType() {
return entityType; 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() { public String getEntityId() {
return entityId; 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() { public String getMessage() {
return message; return message;
} }
@ -74,7 +74,7 @@ public class UserActivityLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_activity_log * 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 @Override
public String toString() { public String toString() {
@ -97,7 +97,7 @@ public class UserActivityLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_activity_log * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -124,7 +124,7 @@ public class UserActivityLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_activity_log * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -3,37 +3,37 @@ package ch.ethz.seb.sebserver.webservice.datalayer.batis.model;
import javax.annotation.Generated; import javax.annotation.Generated;
public class UserRecord { 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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) { 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.id = id;
this.institutionId = institutionId; this.institutionId = institutionId;
@ -47,52 +47,52 @@ public class UserRecord {
this.active = active; 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() { public Long getId() {
return id; 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() { public Long getInstitutionId() {
return institutionId; 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() { public String getUuid() {
return uuid; 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() { public String getName() {
return name; 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() { public String getUsername() {
return username; 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() { public String getPassword() {
return password; 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() { public String getEmail() {
return email; 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() { public String getLocale() {
return locale; 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() { public String getTimezone() {
return timezone; 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() { public Integer getActive() {
return active; return active;
} }
@ -101,7 +101,7 @@ public class UserRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user * 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 @Override
public String toString() { public String toString() {
@ -127,7 +127,7 @@ public class UserRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user * 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 @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -157,7 +157,7 @@ public class UserRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user * 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 @Override
public int hashCode() { public int hashCode() {

View file

@ -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.Entity;
import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.ExamRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordDynamicSqlSupport; 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.mapper.UserRecordDynamicSqlSupport;
@ -70,15 +71,17 @@ public class PaginationService {
return tableMap.containsKey(orderBy); 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) { if (PageHelper.getLocalPage() != null) {
return; 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) { public void setDefaultLimit() {
setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, table); setPagination(1, this.maxPageSize, null, Page.SortOrder.ASCENDING, null);
} }
public void setDefaultLimit(final String sortBy, final SqlTable table) { public void setDefaultLimit(final String sortBy, final SqlTable table) {
@ -113,29 +116,34 @@ public class PaginationService {
final com.github.pagehelper.Page<Object> startPage = final com.github.pagehelper.Page<Object> startPage =
PageHelper.startPage(getPageNumber(pageNumber), getPageSize(pageSize), true, true, false); PageHelper.startPage(getPageNumber(pageNumber), getPageSize(pageSize), true, true, false);
final String sortColumnName = verifySortColumnName(sortBy, table); if (table != null) {
if (StringUtils.isNoneBlank(sortColumnName)) { final String sortColumnName = verifySortColumnName(sortBy, table);
if (sortOrder == Page.SortOrder.DESCENDING) { if (StringUtils.isNoneBlank(sortColumnName)) {
PageHelper.orderBy(sortColumnName + " DESC"); if (sortOrder == Page.SortOrder.DESCENDING) {
} else { PageHelper.orderBy(sortColumnName + " DESC");
PageHelper.orderBy(sortColumnName); } else {
PageHelper.orderBy(sortColumnName);
}
} }
} }
return startPage; return startPage;
} }
public <T extends Entity> Page<T> getPage( public <T extends Entity> Result<Page<T>> getPage(
final Integer pageNumber, final Integer pageNumber,
final Integer pageSize, final Integer pageSize,
final String sortBy, final String sortBy,
final Page.SortOrder sortOrder, final Page.SortOrder sortOrder,
final SqlTable table, 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); return Result.tryCatch(() -> {
final Collection<T> pageList = delegate.get(); final com.github.pagehelper.Page<Object> page =
return new Page<>(page.getPages(), page.getPageNum(), sortBy, sortOrder, pageList); 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) { private String verifySortColumnName(final String sortBy, final SqlTable table) {

View file

@ -8,6 +8,8 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.authorization; package ch.ethz.seb.sebserver.webservice.servicelayer.authorization;
import com.fasterxml.jackson.annotation.JsonIgnore;
import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.Entity;
/** Interface of an entity that needs a grant for access. /** 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. * of the institution entity associated within this entity.
* *
* @return The institution association of a GrantEntity */ * @return The institution association of a GrantEntity */
@JsonIgnore
Long getInstitutionId(); Long getInstitutionId();
/** The institution association of a GrantEntity. This is the UUID of the owner-user /** The institution association of a GrantEntity. This is the UUID of the owner-user
* *
* @return The institution association of a GrantEntity */ * @return The institution association of a GrantEntity */
@JsonIgnore
String getOwnerId(); String getOwnerId();
} }

View file

@ -18,25 +18,33 @@ import ch.ethz.seb.sebserver.gbl.util.Result;
/** Interface of a DAO for an Entity that has activation feature. /** 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> { 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); Result<Collection<T>> all(Long institutionId, Boolean active);
default Result<Collection<T>> allOfInstitution(final long institutionId, final Boolean active) { /** Load all active entities of concrete type for the given institution
return all(institutionId, active); *
} * 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 @Override
default Result<Collection<T>> all(final Long institutionId) { default Result<Collection<T>> all(final Long institutionId) {
return all(institutionId, true); 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 /** Set all entities referred by the given Collection of EntityKey active / inactive
* *
* @param all The Collection of EntityKeys to set active or inactive * @param all The Collection of EntityKeys to set active or inactive

View file

@ -12,10 +12,9 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import ch.ethz.seb.sebserver.gbl.model.Entity; 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> { public interface EntityDAO<T extends Entity, M extends ModelIdAware> {
Logger log = LoggerFactory.getLogger(EntityDAO.class);
/** Get the entity type for a concrete EntityDAO implementation. /** Get the entity type for a concrete EntityDAO implementation.
* *
* @return The EntityType for a concrete EntityDAO implementation */ * @return The EntityType for a concrete EntityDAO implementation */
EntityType entityType(); 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 * @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 * @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 * @param id the model identifier
* @return Result refer the Entity instance with the specified model identifier or refer to an error if * @return Result refer the Entity instance with the specified model identifier or refer to an error if
* happened */ * happened */
@Transactional(readOnly = true)
default Result<T> byModelId(final String id) { default Result<T> byModelId(final String id) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
return Long.parseLong(id); return Long.parseLong(id);
}).flatMap(this::byPK); }).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 * NOTE: institutionId may be null. In that case this method uses a query to get all entities of
* tests then matching predicate. So predicate filtering is not really fast * concrete type from all institutions. Anyways, to not pollute the memory it is recommended to set a limit by
* If you need a fast filtering implement a specific filtering in SQL level * using the <code>PaginationService</code> before calling this method
* *
* @param predicate Predicate expecting instance of type specific entity type * @param institutionId the identifier of the institution.
* @param * @return Result of Collection of Entity of the given institution */
* @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 */
Result<Collection<T>> all(Long institutionId); 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); Result<Collection<T>> loadEntities(Collection<EntityKey> keys);
@Transactional(readOnly = true) @Transactional(readOnly = true)
@ -114,6 +96,13 @@ public interface EntityDAO<T extends Entity, M extends ModelIdAware> {
* happened */ * happened */
Result<Collection<EntityKey>> delete(Set<EntityKey> all); 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. /** 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 * 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 * to a ResourceNotFoundException if specified collection is null or empty or refer to a

View file

@ -8,29 +8,13 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao; 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.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; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO;
public interface ExamDAO extends ActivatableEntityDAO<Exam, Exam>, BulkActionSupportDAO<Exam> { public interface ExamDAO extends ActivatableEntityDAO<Exam, Exam>, BulkActionSupportDAO<Exam> {
Result<Exam> importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData); // Result<Exam> importFromQuizData(Long institutionId, Long lmsSetupId, QuizData quizData);
//
Result<Exam> byQuizId(String quizId); // 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);
} }

View file

@ -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 + "%";
}
}

View file

@ -8,15 +8,10 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao; 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.model.institution.Institution;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO;
public interface InstitutionDAO public interface InstitutionDAO
extends ActivatableEntityDAO<Institution, Institution>, BulkActionSupportDAO<Institution> { extends ActivatableEntityDAO<Institution, Institution>, BulkActionSupportDAO<Institution> {
Result<Collection<Institution>> allMatching(String name, Boolean active);
} }

View file

@ -8,22 +8,9 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao; 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;
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; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO;
public interface LmsSetupDAO extends ActivatableEntityDAO<LmsSetup, LmsSetup>, BulkActionSupportDAO<LmsSetup> { 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);
} }

View file

@ -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.EntityType;
import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog; import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog;
import ch.ethz.seb.sebserver.gbl.util.Result; 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; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser;
public interface UserActivityLogDAO public interface UserActivityLogDAO
@ -89,6 +88,8 @@ public interface UserActivityLogDAO
String userId, String userId,
Long from, Long from,
Long to, Long to,
Predicate<UserActivityLogRecord> predicate); String activityTypes,
String entityTypes,
Predicate<UserActivityLog> predicate);
} }

View file

@ -11,7 +11,6 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao;
import java.util.Collection; import java.util.Collection;
import ch.ethz.seb.sebserver.gbl.model.EntityKey; 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.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.model.user.UserMod;
import ch.ethz.seb.sebserver.gbl.util.Result; 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 */ * @return a Result of SEBServerUser for specified username. Or an exception result on error case */
Result<SEBServerUser> sebServerUserByUsername(String username); Result<SEBServerUser> sebServerUserByUsername(String username);
/** Use this to get a Collection of filtered UserInfo. The filter criteria // /** Use this to get a Collection of filtered UserInfo. The filter criteria
* from given UserFilter instance will be translated to SQL query and // * from given UserFilter instance will be translated to SQL query and
* the filtering happens on data-base level // * the filtering happens on data-base level
* // *
* @param filter The UserFilter instance containing all filter criteria // * @param filter The UserFilter instance containing all filter criteria
* @return a Result of Collection of filtered UserInfo. Or an exception result on error case */ // * @return a Result of Collection of filtered UserInfo. Or an exception result on error case */
Result<Collection<UserInfo>> allMatching(final UserFilter filter); // 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. /** Use this to get a Collection containing EntityKey's of all entities that belongs to a given User.
* *

View file

@ -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.authorization.UserService;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; 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.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.ResourceNotFoundException;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
@ -76,13 +77,6 @@ public class ExamDAOImpl implements ExamDAO {
.flatMap(this::toDomainModel); .flatMap(this::toDomainModel);
} }
@Override
@Transactional(readOnly = true)
public Result<Exam> byQuizId(final String quizId) {
return recordByQuizId(quizId)
.flatMap(this::toDomainModel);
}
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<Exam>> all(final Long institutionId, final Boolean active) { public Result<Collection<Exam>> all(final Long institutionId, final Boolean active) {
@ -106,18 +100,12 @@ public class ExamDAOImpl implements ExamDAO {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<Exam>> allMatching( public Result<Collection<Exam>> allMatching(final FilterMap filterMap, final Predicate<Exam> predicate) {
final Long institutionId,
final Long lmsSetupId,
final String name,
final ExamStatus status,
final ExamType type,
final DateTime from,
final String owner,
final Boolean active) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
final String name = filterMap.getName();
final DateTime from = filterMap.getExamFromTime();
final Predicate<Exam> quizDataFilter = exam -> { final Predicate<Exam> quizDataFilter = exam -> {
if (StringUtils.isNoneBlank(name)) { if (StringUtils.isNoneBlank(name)) {
if (!exam.name.contains(name)) { if (!exam.name.contains(name)) {
@ -137,108 +125,50 @@ public class ExamDAOImpl implements ExamDAO {
final List<ExamRecord> records = this.examRecordMapper.selectByExample() final List<ExamRecord> records = this.examRecordMapper.selectByExample()
.where( .where(
ExamRecordDynamicSqlSupport.active, ExamRecordDynamicSqlSupport.active,
isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) isEqualToWhenPresent(filterMap.getActiveAsInt()))
.and( .and(
ExamRecordDynamicSqlSupport.institutionId, ExamRecordDynamicSqlSupport.institutionId,
isEqualToWhenPresent(institutionId)) isEqualToWhenPresent(filterMap.getInstitutionId()))
.and(
ExamRecordDynamicSqlSupport.externalId,
isEqualToWhenPresent(filterMap.getExamQuizId()))
.and( .and(
ExamRecordDynamicSqlSupport.lmsSetupId, ExamRecordDynamicSqlSupport.lmsSetupId,
isEqualToWhenPresent(lmsSetupId)) isEqualToWhenPresent(filterMap.getExamLmsSetupId()))
.and( .and(
ExamRecordDynamicSqlSupport.status, ExamRecordDynamicSqlSupport.status,
isEqualToWhenPresent((status != null) ? status.name() : null)) isEqualToWhenPresent(filterMap.getExamStatus()))
.and( .and(
ExamRecordDynamicSqlSupport.type, ExamRecordDynamicSqlSupport.type,
isEqualToWhenPresent((type != null) ? type.name() : null)) isEqualToWhenPresent(filterMap.getExamType()))
.and( .and(
ExamRecordDynamicSqlSupport.owner, ExamRecordDynamicSqlSupport.owner,
isEqualToWhenPresent(owner)) isEqualToWhenPresent(filterMap.getExamOwner()))
.build() .build()
.execute(); .execute();
return this.toDomainModel(records) return this.toDomainModel(records)
.getOrThrow() .getOrThrow()
.stream() .stream()
.filter(quizDataFilter) .filter(quizDataFilter.and(predicate))
.collect(Collectors.toList()); .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 @Override
@Transactional @Transactional
public Result<Exam> save(final Exam exam) { public Result<Exam> save(final Exam exam) {
if (exam == null) { if (exam == null) {
return Result.ofError(new NullPointerException("exam has null-reference")); 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) return (exam.id == null)
.flatMap(this::toDomainModel) ? insert(exam)
.onErrorDo(TransactionHandler::rollback); .flatMap(this::toDomainModel)
} .onErrorDo(TransactionHandler::rollback)
: update(exam)
private Result<ExamRecord> update(final Exam exam) { .flatMap(this::toDomainModel)
return Result.tryCatch(() -> { .onErrorDo(TransactionHandler::rollback);
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);
});
} }
@Override @Override
@ -307,6 +237,54 @@ public class ExamDAOImpl implements ExamDAO {
}).flatMap(this::toDomainModel); }).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) { private Result<Collection<EntityKey>> allIdsOfInstitution(final EntityKey institutionKey) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
return this.examRecordMapper.selectIdsByExample() 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) { private Result<Exam> toDomainModel(final ExamRecord record) {
return toDomainModel( return toDomainModel(
record.getLmsSetupId(), record.getLmsSetupId(),

View file

@ -8,13 +8,13 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl;
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo; import static org.mybatis.dynamic.sql.SqlBuilder.*;
import static org.mybatis.dynamic.sql.SqlBuilder.isIn;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; 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.model.exam.Indicator.Threshold;
import ch.ethz.seb.sebserver.gbl.util.Result; 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.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.IndicatorRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.IndicatorRecordMapper; 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.ThresholdRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ThresholdRecordMapper; 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.IndicatorRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ThresholdRecord; 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.bulkaction.BulkAction;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; 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.IndicatorDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; 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.dao.TransactionHandler;
@ -48,13 +51,16 @@ public class IndicatorDAOImpl implements IndicatorDAO {
private final IndicatorRecordMapper indicatorRecordMapper; private final IndicatorRecordMapper indicatorRecordMapper;
private final ThresholdRecordMapper thresholdRecordMapper; private final ThresholdRecordMapper thresholdRecordMapper;
private final ExamRecordMapper examRecordMapper;
public IndicatorDAOImpl( public IndicatorDAOImpl(
final IndicatorRecordMapper indicatorRecordMapper, final IndicatorRecordMapper indicatorRecordMapper,
final ThresholdRecordMapper thresholdRecordMapper) { final ThresholdRecordMapper thresholdRecordMapper,
final ExamRecordMapper examRecordMapper) {
this.indicatorRecordMapper = indicatorRecordMapper; this.indicatorRecordMapper = indicatorRecordMapper;
this.thresholdRecordMapper = thresholdRecordMapper; this.thresholdRecordMapper = thresholdRecordMapper;
this.examRecordMapper = examRecordMapper;
} }
@Override @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 @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<Indicator>> loadEntities(final Collection<EntityKey> keys) { 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) { private Result<Indicator> toDomainModel(final IndicatorRecord record) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
final ExamRecord examRecord = this.examRecordMapper.selectByPrimaryKey(record.getExamId());
final List<Threshold> thresholds = this.thresholdRecordMapper.selectByExample() final List<Threshold> thresholds = this.thresholdRecordMapper.selectByExample()
.where(ThresholdRecordDynamicSqlSupport.indicatorId, isEqualTo(record.getId())) .where(ThresholdRecordDynamicSqlSupport.indicatorId, isEqualTo(record.getId()))
.build() .build()
@ -216,6 +252,8 @@ public class IndicatorDAOImpl implements IndicatorDAO {
return new Indicator( return new Indicator(
record.getId(), record.getId(),
examRecord.getInstitutionId(),
examRecord.getOwner(),
record.getExamId(), record.getExamId(),
record.getName(), record.getName(),
IndicatorType.valueOf(record.getType()), IndicatorType.valueOf(record.getType()),

View file

@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.BooleanUtils; 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.EntityType;
import ch.ethz.seb.sebserver.gbl.model.institution.Institution; import ch.ethz.seb.sebserver.gbl.model.institution.Institution;
import ch.ethz.seb.sebserver.gbl.util.Result; 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.InstitutionRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordMapper; 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.datalayer.batis.model.InstitutionRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; 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.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.InstitutionDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; 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.dao.TransactionHandler;
@ -89,20 +90,24 @@ public class InstitutionDAOImpl implements InstitutionDAO {
@Override @Override
@Transactional(readOnly = true) @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 return Result.tryCatch(() -> this.institutionRecordMapper
.selectByExample() .selectByExample()
.where( .where(
InstitutionRecordDynamicSqlSupport.active, InstitutionRecordDynamicSqlSupport.active,
SqlBuilder.isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) SqlBuilder.isEqualToWhenPresent(filterMap.getActiveAsInt()))
.and( .and(
InstitutionRecordDynamicSqlSupport.name, InstitutionRecordDynamicSqlSupport.name,
SqlBuilder.isEqualToWhenPresent(Utils.toSQLWildcard(name))) SqlBuilder.isEqualToWhenPresent(filterMap.getName()))
.build() .build()
.execute() .execute()
.stream() .stream()
.map(InstitutionDAOImpl::toDomainModel) .map(InstitutionDAOImpl::toDomainModel)
.flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip)
.filter(predicate)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }

View file

@ -8,13 +8,13 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; 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 static org.mybatis.dynamic.sql.SqlBuilder.*;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.BooleanUtils; 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.datalayer.batis.model.LmsSetupRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; 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.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.LmsSetupDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; 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.dao.TransactionHandler;
@ -89,33 +90,31 @@ public class LmsSetupDAOImpl implements LmsSetupDAO {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<LmsSetup>> allMatching( public Result<Collection<LmsSetup>> allMatching(
final Long institutionId, final FilterMap filterMap,
final String name, final Predicate<LmsSetup> predicate) {
final LmsType lmsType,
final Boolean active) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
final String _lmsType = (lmsType != null) ? lmsType.name() : null;
return this.lmsSetupRecordMapper return this.lmsSetupRecordMapper
.selectByExample() .selectByExample()
.where( .where(
LmsSetupRecordDynamicSqlSupport.institutionId, LmsSetupRecordDynamicSqlSupport.institutionId,
isEqualToWhenPresent(institutionId)) isEqualToWhenPresent(filterMap.getInstitutionId()))
.and( .and(
LmsSetupRecordDynamicSqlSupport.name, LmsSetupRecordDynamicSqlSupport.name,
isLikeWhenPresent(toSQLWildcard(name))) isLikeWhenPresent(filterMap.getLmsSetupName()))
.and( .and(
LmsSetupRecordDynamicSqlSupport.lmsType, LmsSetupRecordDynamicSqlSupport.lmsType,
isEqualToWhenPresent(_lmsType)) isEqualToWhenPresent(filterMap.getLmsSetupType()))
.and( .and(
LmsSetupRecordDynamicSqlSupport.active, LmsSetupRecordDynamicSqlSupport.active,
isEqualToWhenPresent(BooleanUtils.toIntegerObject(active))) isEqualToWhenPresent(filterMap.getActiveAsInt()))
.build() .build()
.execute() .execute()
.stream() .stream()
.map(LmsSetupDAOImpl::toDomainModel) .map(LmsSetupDAOImpl::toDomainModel)
.flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip)
.filter(predicate)
.collect(Collectors.toList()); .collect(Collectors.toList());
}); });
} }

View file

@ -10,12 +10,14 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl;
import static org.mybatis.dynamic.sql.SqlBuilder.isIn; import static org.mybatis.dynamic.sql.SqlBuilder.isIn;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.mybatis.dynamic.sql.SqlBuilder; import org.mybatis.dynamic.sql.SqlBuilder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -24,6 +26,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; 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.Entity;
import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.EntityType; 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.UserActivityLogRecordMapper;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserRecordDynamicSqlSupport; 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.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.SEBServerUser;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService; 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.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.TransactionHandler;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO;
@ -48,16 +51,13 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
private final UserActivityLogRecordMapper userLogRecordMapper; private final UserActivityLogRecordMapper userLogRecordMapper;
private final UserService userService; private final UserService userService;
private final PaginationService paginationService;
public UserActivityLogDAOImpl( public UserActivityLogDAOImpl(
final UserActivityLogRecordMapper userLogRecordMapper, final UserActivityLogRecordMapper userLogRecordMapper,
final UserService userService, final UserService userService) {
final PaginationService paginationService) {
this.userLogRecordMapper = userLogRecordMapper; this.userLogRecordMapper = userLogRecordMapper;
this.userService = userService; this.userService = userService;
this.paginationService = paginationService;
} }
@Override @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 @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<UserActivityLog>> all( public Result<Collection<UserActivityLog>> all(
@ -215,10 +229,19 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
final String userId, final String userId,
final Long from, final Long from,
final Long to, final Long to,
final Predicate<UserActivityLogRecord> predicate) { final String activityTypes,
final String entityTypes,
final Predicate<UserActivityLog> predicate) {
return Result.tryCatch(() -> { 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 ? predicate
: model -> true; : model -> true;
@ -239,12 +262,18 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
.and( .and(
UserActivityLogRecordDynamicSqlSupport.timestamp, UserActivityLogRecordDynamicSqlSupport.timestamp,
SqlBuilder.isLessThanWhenPresent(to)) SqlBuilder.isLessThanWhenPresent(to))
.and(
UserActivityLogRecordDynamicSqlSupport.activityType,
SqlBuilder.isInCaseInsensitiveWhenPresent(_activityTypes))
.and(
UserActivityLogRecordDynamicSqlSupport.entityType,
SqlBuilder.isInCaseInsensitiveWhenPresent(_entityTypes))
.build() .build()
.execute() .execute()
.stream() .stream()
.filter(_predicate)
.map(UserActivityLogDAOImpl::toDomainModel) .map(UserActivityLogDAOImpl::toDomainModel)
.flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip)
.filter(_predicate)
.collect(Collectors.toList()); .collect(Collectors.toList());
}); });
@ -255,11 +284,6 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
public Result<Collection<UserActivityLog>> all(final Long institutionId) { public Result<Collection<UserActivityLog>> all(final Long institutionId) {
return Result.tryCatch(() -> { 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) { if (institutionId == null) {
return this.userLogRecordMapper return this.userLogRecordMapper
.selectByExample() .selectByExample()

View file

@ -8,7 +8,6 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; 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 static org.mybatis.dynamic.sql.SqlBuilder.*;
import java.util.Collection; import java.util.Collection;
@ -17,6 +16,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.constraints.NotNull; 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.APIMessage.ErrorMessage;
import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.EntityType; 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.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.model.user.UserMod;
import ch.ethz.seb.sebserver.gbl.util.Result; 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.authorization.SEBServerUser;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkAction; 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.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.TransactionHandler;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO;
@ -117,6 +117,7 @@ public class UserDaoImpl implements UserDAO {
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<UserInfo>> all(final Long institutionId, final Boolean active) { public Result<Collection<UserInfo>> all(final Long institutionId, final Boolean active) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
final List<UserRecord> records = (active != null) final List<UserRecord> records = (active != null)
? this.userRecordMapper.selectByExample() ? this.userRecordMapper.selectByExample()
.where( .where(
@ -143,20 +144,33 @@ public class UserDaoImpl implements UserDAO {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<UserInfo>> allMatching(final UserFilter filter) { public Result<Collection<UserInfo>> allMatching(final FilterMap filterMap, final Predicate<UserInfo> predicate) {
return Result.tryCatch(() -> this.userRecordMapper.selectByExample().where( return Result.tryCatch(() -> this.userRecordMapper
UserRecordDynamicSqlSupport.active, .selectByExample()
isEqualToWhenPresent(BooleanUtils.toIntegerObject(filter.active))) .where(
.and(UserRecordDynamicSqlSupport.institutionId, isEqualToWhenPresent(filter.institutionId)) UserRecordDynamicSqlSupport.active,
.and(UserRecordDynamicSqlSupport.name, isLikeWhenPresent(toSQLWildcard(filter.name))) isEqualToWhenPresent(filterMap.getActiveAsInt()))
.and(UserRecordDynamicSqlSupport.username, isLikeWhenPresent(toSQLWildcard(filter.username))) .and(
.and(UserRecordDynamicSqlSupport.email, isLikeWhenPresent(toSQLWildcard(filter.email))) UserRecordDynamicSqlSupport.institutionId,
.and(UserRecordDynamicSqlSupport.locale, isLikeWhenPresent(filter.locale)) 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() .build()
.execute() .execute()
.stream() .stream()
.map(this::toDomainModel) .map(this::toDomainModel)
.flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip) .flatMap(DAOLoggingSupport::logUnexpectedErrorAndSkip)
.filter(predicate)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }

View file

@ -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();
}
}

View file

@ -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;
}
}

View file

@ -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;
import ch.ethz.seb.sebserver.gbl.model.APIMessage.APIMessageException; 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.authorization.PermissionDeniedException;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationException;
@Order(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE)
@ControllerAdvice @ControllerAdvice
@ -44,9 +45,8 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler {
final HttpStatus status, final HttpStatus status,
final WebRequest request) { final WebRequest request) {
log.error("Unexpected internal error catched at the API endpoint: ", ex); log.error("Unexpected generic error catched at the API endpoint: ", ex);
return APIMessage.ErrorMessage.UNEXPECTED return new ResponseEntity<>(APIMessage.ErrorMessage.GENERIC.of(ex.getMessage()), status);
.createErrorResponse(ex.getMessage());
} }
@Override @Override
@ -65,6 +65,20 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler {
return new ResponseEntity<>(valErrors, HttpStatus.BAD_REQUEST); 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) @ExceptionHandler(UsernameNotFoundException.class)
public ResponseEntity<Object> handleUserNotFound( public ResponseEntity<Object> handleUserNotFound(
final UsernameNotFoundException ex, final UsernameNotFoundException ex,
@ -84,6 +98,16 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler {
.createErrorResponse(ex.getMessage()); .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) @ExceptionHandler(Exception.class)
public ResponseEntity<Object> handleUnexpected( public ResponseEntity<Object> handleUnexpected(
final Exception ex, final Exception ex,

View file

@ -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);
}
}

View file

@ -8,8 +8,7 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; 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.bulkaction.BulkActionService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ActivatableEntityDAO; 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.dao.UserActivityLogDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService;
public abstract class ActivatableEntityController<T extends GrantEntity, M extends GrantEntity> public abstract class ActivatableEntityController<T extends GrantEntity, M extends GrantEntity>
extends EntityController<T, M> { extends EntityController<T, M> {
@ -43,13 +43,23 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
final BulkActionService bulkActionService, final BulkActionService bulkActionService,
final ActivatableEntityDAO<T, M> entityDAO, final ActivatableEntityDAO<T, M> entityDAO,
final UserActivityLogDAO userActivityLogDAO, 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; 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( public Page<T> allActive(
@RequestParam( @RequestParam(
name = Entity.FILTER_ATTR_INSTITUTION, name = Entity.FILTER_ATTR_INSTITUTION,
@ -67,10 +77,14 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
sortBy, sortBy,
sortOrder, sortOrder,
UserRecordDynamicSqlSupport.userRecord, 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( public Page<T> allInactive(
@RequestParam( @RequestParam(
name = Entity.FILTER_ATTR_INSTITUTION, name = Entity.FILTER_ATTR_INSTITUTION,
@ -88,31 +102,29 @@ public abstract class ActivatableEntityController<T extends GrantEntity, M exten
sortBy, sortBy,
sortOrder, sortOrder,
UserRecordDynamicSqlSupport.userRecord, 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) { public EntityProcessingReport activate(@PathVariable final String id) {
return setActive(id, true) return setActive(id, true)
.getOrThrow(); .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) { public EntityProcessingReport deactivate(@PathVariable final String id) {
return setActive(id, false) return setActive(id, false)
.getOrThrow(); .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) { private Result<EntityProcessingReport> setActive(final String id, final boolean active) {
final EntityType entityType = this.entityDAO.entityType(); final EntityType entityType = this.entityDAO.entityType();
final BulkAction bulkAction = new BulkAction( final BulkAction bulkAction = new BulkAction(

View file

@ -10,11 +10,17 @@ package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Map;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.Valid; import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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 org.springframework.web.bind.annotation.RequestParam;
import ch.ethz.seb.sebserver.gbl.Constants; 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.Entity;
import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.EntityKeyAndName; import ch.ethz.seb.sebserver.gbl.model.EntityKeyAndName;
import ch.ethz.seb.sebserver.gbl.model.EntityProcessingReport; import ch.ethz.seb.sebserver.gbl.model.EntityProcessingReport;
import ch.ethz.seb.sebserver.gbl.model.EntityType; 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.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; 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.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.BulkAction.Type;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; 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.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;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.ActivityType; 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> { 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 EntityDAO<T, M> entityDAO;
protected final UserActivityLogDAO userActivityLogDAO; protected final UserActivityLogDAO userActivityLogDAO;
protected final PaginationService paginationService; protected final PaginationService paginationService;
protected final BeanValidationService beanValidationService;
protected EntityController( protected EntityController(
final AuthorizationGrantService authorizationGrantService, final AuthorizationGrantService authorizationGrantService,
final BulkActionService bulkActionService, final BulkActionService bulkActionService,
final EntityDAO<T, M> entityDAO, final EntityDAO<T, M> entityDAO,
final UserActivityLogDAO userActivityLogDAO, final UserActivityLogDAO userActivityLogDAO,
final PaginationService paginationService) { final PaginationService paginationService,
final BeanValidationService beanValidationService) {
this.authorizationGrantService = authorizationGrantService; this.authorizationGrantService = authorizationGrantService;
this.bulkActionService = bulkActionService; this.bulkActionService = bulkActionService;
this.entityDAO = entityDAO; this.entityDAO = entityDAO;
this.userActivityLogDAO = userActivityLogDAO; this.userActivityLogDAO = userActivityLogDAO;
this.paginationService = paginationService; 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) @RequestMapping(path = "/{id}", method = RequestMethod.GET)
public T byId(@PathVariable final String id) { public T getBy(@PathVariable final String id) {
return this.entityDAO return this.entityDAO
.byModelId(id) .byModelId(id)
.flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity( .flatMap(entity -> this.authorizationGrantService.checkGrantOnEntity(
@ -72,6 +140,104 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
.getOrThrow(); .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) @RequestMapping(path = "/in", method = RequestMethod.GET)
public Collection<T> getForIds(@RequestParam(name = "ids", required = true) final String ids) { public Collection<T> getForIds(@RequestParam(name = "ids", required = true) final String ids) {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
@ -87,56 +253,6 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
.collect(Collectors.toList()); .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) { protected Result<T> notifySave(final M modifyData, final T entity) {
return Result.of(entity); return Result.of(entity);
} }
@ -148,7 +264,24 @@ public abstract class EntityController<T extends GrantEntity, M extends GrantEnt
institutionId); institutionId);
} }
protected Result<Collection<T>> getAll(final Long institutionId, final Boolean active) { protected Result<Collection<T>> getAll(final FilterMap filterMap) {
return this.entityDAO.all(institutionId); 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"));
}
} }
} }

View file

@ -9,37 +9,25 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Map;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.mybatis.dynamic.sql.SqlTable;
import org.springframework.web.bind.WebDataBinder; import org.springframework.http.MediaType;
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; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
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; import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.model.Page.SortOrder; 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;
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.model.exam.QuizData;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.datalayer.batis.mapper.ExamRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; 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.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.authorization.UserService;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; 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.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.IndicatorDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService;
@WebServiceProfile @WebServiceProfile
@RestController @RestController
@ -64,57 +54,45 @@ public class ExamAdministrationController extends ActivatableEntityController<Ex
final ExamDAO examDAO, final ExamDAO examDAO,
final PaginationService paginationService, final PaginationService paginationService,
final BulkActionService bulkActionService, 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.examDAO = examDAO;
this.indicatorDAO = indicatorDAO; this.indicatorDAO = indicatorDAO;
} }
@InitBinder @Override
public void initBinder(final WebDataBinder binder) throws Exception { protected Class<Exam> modifiedDataType() {
this.authorizationGrantService return Exam.class;
.getUserService()
.addUsersInstitutionDefaultPropertySupport(binder);
} }
@RequestMapping(method = RequestMethod.GET) @Override
public Collection<Exam> getAll( protected SqlTable getSQLTableOfEntity() {
@RequestParam( return ExamRecordDynamicSqlSupport.examRecord;
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);
} }
@RequestMapping(path = "/page", method = RequestMethod.GET) @RequestMapping(
public Page<Exam> getPage( method = RequestMethod.GET,
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
@Override
public Page<Exam> getAll(
@RequestParam( @RequestParam(
name = Exam.FILTER_ATTR_INSTITUTION, name = Entity.FILTER_ATTR_INSTITUTION,
required = true, required = true,
defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, 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_NUMBER, required = false) final Integer pageNumber,
@RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, @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_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); checkReadPrivilege(institutionId);
@ -124,21 +102,20 @@ public class ExamAdministrationController extends ActivatableEntityController<Ex
if (StringUtils.isBlank(sortBy) || if (StringUtils.isBlank(sortBy) ||
this.paginationService.isNativeSortingSupported(ExamRecordDynamicSqlSupport.examRecord, sortBy)) { this.paginationService.isNativeSortingSupported(ExamRecordDynamicSqlSupport.examRecord, sortBy)) {
return this.paginationService.getPage( return super.getAll(institutionId, pageNumber, pageSize, sortBy, sortOrder, allRequestParams);
pageNumber,
pageSize,
sortBy,
sortOrder,
ExamRecordDynamicSqlSupport.examRecord,
() -> getExams(institutionId, lmsSetupId, active, name, from, status, type, owner));
} else { } else {
this.authorizationGrantService.checkPrivilege(
EntityType.EXAM,
PrivilegeType.READ_ONLY,
institutionId);
final int pageNum = this.paginationService.getPageNumber(pageNumber); final int pageNum = this.paginationService.getPageNumber(pageNumber);
final int pSize = this.paginationService.getPageSize(pageSize); final int pSize = this.paginationService.getPageSize(pageSize);
final List<Exam> exams = new ArrayList<>( 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 (!StringUtils.isBlank(sortBy)) {
if (sortBy.equals(QuizData.QUIZ_ATTR_NAME)) { if (sortBy.equals(QuizData.QUIZ_ATTR_NAME)) {
@ -162,108 +139,77 @@ public class ExamAdministrationController extends ActivatableEntityController<Ex
} }
} }
@RequestMapping(path = "/{examId}/indicator", method = RequestMethod.GET) // @RequestMapping(path = "/{examId}/indicator", method = RequestMethod.GET)
public Collection<Indicator> getIndicatorOfExam(@PathVariable final Long examId) { // public Collection<Indicator> getIndicatorOfExam(@PathVariable final Long examId) {
// check read-only grant on Exam // // check read-only grant on Exam
this.examDAO.byPK(examId) // this.examDAO.byPK(examId)
.map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.READ_ONLY)) // .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.READ_ONLY))
.getOrThrow(); // .getOrThrow();
//
return this.indicatorDAO.allForExam(examId) // return this.indicatorDAO.allForExam(examId)
.getOrThrow(); // .getOrThrow();
} // }
//
@RequestMapping(path = "/{examId}/indicator/delete/{indicatorId}", method = RequestMethod.DELETE) // @RequestMapping(path = "/{examId}/indicator/delete/{indicatorId}", method = RequestMethod.DELETE)
public Collection<Indicator> deleteIndicatorOfExam( // public Collection<Indicator> deleteIndicatorOfExam(
@PathVariable final Long examId, // @PathVariable final Long examId,
@PathVariable(required = false) final Long indicatorId) { // @PathVariable(required = false) final Long indicatorId) {
//
// check write grant on Exam // // check write grant on Exam
this.examDAO.byPK(examId) // this.examDAO.byPK(examId)
.map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) // .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE))
.getOrThrow(); // .getOrThrow();
//
final Set<EntityKey> toDelete = (indicatorId != null) // final Set<EntityKey> toDelete = (indicatorId != null)
? this.indicatorDAO.allForExam(examId) // ? this.indicatorDAO.allForExam(examId)
.getOrThrow() // .getOrThrow()
.stream() // .stream()
.map(ind -> new EntityKey(String.valueOf(ind.id), EntityType.INDICATOR)) // .map(ind -> new EntityKey(String.valueOf(ind.id), EntityType.INDICATOR))
.collect(Collectors.toSet()) // .collect(Collectors.toSet())
: Utils.immutableSetOf(new EntityKey(String.valueOf(indicatorId), EntityType.INDICATOR)); // : Utils.immutableSetOf(new EntityKey(String.valueOf(indicatorId), EntityType.INDICATOR));
//
this.indicatorDAO.delete(toDelete); // this.indicatorDAO.delete(toDelete);
//
return this.indicatorDAO.allForExam(examId) // return this.indicatorDAO.allForExam(examId)
.getOrThrow(); // .getOrThrow();
} // }
//
@RequestMapping(path = "/{examId}/indicator/new", method = RequestMethod.PUT) // @RequestMapping(path = "/{examId}/indicator/new", method = RequestMethod.POST)
public Indicator addNewIndicatorToExam( // public Indicator addNewIndicatorToExam(
@PathVariable final Long examId, // @PathVariable final Long examId,
@Valid @RequestBody final Indicator indicator) { // @Valid @RequestBody final Indicator indicator) {
//
// check write grant on Exam // // check write grant on Exam
this.examDAO.byPK(examId) // this.examDAO.byPK(examId)
.flatMap(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE)) // .flatMap(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.WRITE))
.getOrThrow(); // .getOrThrow();
//
if (indicator.id != null) { // if (indicator.id != null) {
return this.indicatorDAO.byPK(indicator.id) // return this.indicatorDAO.byPK(indicator.id)
.getOrThrow(); // .getOrThrow();
} // }
//
return this.indicatorDAO // return this.indicatorDAO
.save(indicator) // .save(indicator)
.getOrThrow(); // .getOrThrow();
} // }
//
@RequestMapping(path = "/{examId}/indicator/save", method = RequestMethod.POST) // @RequestMapping(path = "/{examId}/indicator/save", method = RequestMethod.PUT)
public Indicator saveIndicatorForExam( // public Indicator saveIndicatorForExam(
@PathVariable final Long examId, // @PathVariable final Long examId,
@Valid @RequestBody final Indicator indicator) { // @Valid @RequestBody final Indicator indicator) {
//
// check modify grant on Exam // // check modify grant on Exam
this.examDAO.byPK(examId) // this.examDAO.byPK(examId)
.map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.MODIFY)) // .map(exam -> this.authorizationGrantService.checkGrantOnEntity(exam, PrivilegeType.MODIFY))
.getOrThrow(); // .getOrThrow();
//
return this.indicatorDAO.save(new Indicator( // return this.indicatorDAO.save(new Indicator(
indicator.id, // indicator.id,
examId, // examId,
indicator.name, // indicator.name,
indicator.type, // indicator.type,
indicator.defaultColor, // indicator.defaultColor,
indicator.thresholds)).getOrThrow(); // 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();
}
} }

View file

@ -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);
}
}

View file

@ -8,24 +8,21 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.util.Arrays; import org.mybatis.dynamic.sql.SqlTable;
import java.util.Collection;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.model.institution.Institution;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.PaginationService;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; 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.authorization.SEBServerUser;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionService; 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.InstitutionDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService;
@WebServiceProfile @WebServiceProfile
@RestController @RestController
@ -39,12 +36,29 @@ public class InstitutionController extends ActivatableEntityController<Instituti
final AuthorizationGrantService authorizationGrantService, final AuthorizationGrantService authorizationGrantService,
final UserActivityLogDAO userActivityLogDAO, final UserActivityLogDAO userActivityLogDAO,
final BulkActionService bulkActionService, 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; this.institutionDAO = institutionDAO;
} }
@Override
protected Class<Institution> modifiedDataType() {
return Institution.class;
}
@Override
protected SqlTable getSQLTableOfEntity() {
return InstitutionRecordDynamicSqlSupport.institutionRecord;
}
@RequestMapping(path = "/self", method = RequestMethod.GET) @RequestMapping(path = "/self", method = RequestMethod.GET)
public Institution getOwn() { public Institution getOwn() {
final SEBServerUser currentUser = this.authorizationGrantService final SEBServerUser currentUser = this.authorizationGrantService
@ -55,19 +69,4 @@ public class InstitutionController extends ActivatableEntityController<Instituti
return this.institutionDAO.byPK(institutionId).getOrThrow(); 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();
}
}
} }

View file

@ -9,40 +9,36 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.io.InputStream; import java.io.InputStream;
import java.util.Collection;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.tomcat.util.http.fileupload.IOUtils; import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.mybatis.dynamic.sql.SqlTable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import ch.ethz.seb.sebserver.gbl.model.EntityType; 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;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.PaginationService;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; 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.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.bulkaction.BulkActionService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.LmsSetupDAO; 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.dao.UserActivityLogDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService;
@WebServiceProfile @WebServiceProfile
@RestController @RestController
@RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_LMS_SETUP) @RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_LMS_SETUP)
public class LmsSetupController extends ActivatableEntityController<LmsSetup, LmsSetup> { public class LmsSetupController extends ActivatableEntityController<LmsSetup, LmsSetup> {
private final LmsSetupDAO lmsSetupDAO;
private final LmsAPIService lmsAPIService; private final LmsAPIService lmsAPIService;
public LmsSetupController( public LmsSetupController(
@ -51,40 +47,31 @@ public class LmsSetupController extends ActivatableEntityController<LmsSetup, Lm
final UserActivityLogDAO userActivityLogDAO, final UserActivityLogDAO userActivityLogDAO,
final BulkActionService bulkActionService, final BulkActionService bulkActionService,
final LmsAPIService lmsAPIService, 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; this.lmsAPIService = lmsAPIService;
} }
@InitBinder @Override
public void initBinder(final WebDataBinder binder) throws Exception { protected Class<LmsSetup> modifiedDataType() {
this.authorizationGrantService return LmsSetup.class;
.getUserService()
.addUsersInstitutionDefaultPropertySupport(binder);
} }
@RequestMapping(method = RequestMethod.GET) @Override
public Collection<LmsSetup> getAll( protected SqlTable getSQLTableOfEntity() {
@RequestParam( return LmsSetupRecordDynamicSqlSupport.lmsSetupRecord;
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();
} }
@RequestMapping( @RequestMapping(
path = "/create_seb_config/{id}", path = "/SEB_Configuration/{id}",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) // TODO check if this is the right format produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) // TODO check if this is the right format
public void downloadSEBConfig( public void downloadSEBConfig(

View file

@ -8,34 +8,22 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; 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.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.Domain.LMS_SETUP;
import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.model.Page.SortOrder; 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.model.exam.QuizData;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils; 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.AuthorizationGrantService;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PrivilegeType; 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.LmsAPIService;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate.OrderBy; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate.OrderBy;
@ -50,26 +38,20 @@ public class QuizImportController {
private final LmsAPIService lmsAPIService; private final LmsAPIService lmsAPIService;
private final AuthorizationGrantService authorizationGrantService; private final AuthorizationGrantService authorizationGrantService;
private final UserActivityLogDAO userActivityLogDAO;
private final ExamDAO examDAO;
public QuizImportController( public QuizImportController(
@Value("${sebserver.webservice.api.pagination.defaultPageSize:10}") final int defaultPageSize, @Value("${sebserver.webservice.api.pagination.defaultPageSize:10}") final int defaultPageSize,
@Value("${sebserver.webservice.api.pagination.maxPageSize:500}") final int maxPageSize, @Value("${sebserver.webservice.api.pagination.maxPageSize:500}") final int maxPageSize,
final LmsAPIService lmsAPIService, final LmsAPIService lmsAPIService,
final AuthorizationGrantService authorizationGrantService, final AuthorizationGrantService authorizationGrantService) {
final UserActivityLogDAO userActivityLogDAO,
final ExamDAO examDAO) {
this.defaultPageSize = defaultPageSize; this.defaultPageSize = defaultPageSize;
this.maxPageSize = maxPageSize; this.maxPageSize = maxPageSize;
this.lmsAPIService = lmsAPIService; this.lmsAPIService = lmsAPIService;
this.authorizationGrantService = authorizationGrantService; this.authorizationGrantService = authorizationGrantService;
this.userActivityLogDAO = userActivityLogDAO;
this.examDAO = examDAO;
} }
@RequestMapping(path = "/search", method = RequestMethod.GET) @RequestMapping(method = RequestMethod.GET)
public Page<QuizData> search( public Page<QuizData> search(
@RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId, @RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId,
@RequestParam(name = QuizData.FILTER_ATTR_NAME, required = false) final String nameLike, @RequestParam(name = QuizData.FILTER_ATTR_NAME, required = false) final String nameLike,
@ -105,31 +87,31 @@ public class QuizImportController {
: this.defaultPageSize); : this.defaultPageSize);
} }
@RequestMapping(path = "/import", method = RequestMethod.POST) // @RequestMapping(path = "/import", method = RequestMethod.POST)
public Collection<Exam> importExam( // public Collection<Exam> importExam(
@RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId, // @RequestParam(name = LMS_SETUP.ATTR_ID, required = true) final Long lmsSetupId,
@RequestParam(name = QuizData.QUIZ_ATTR_ID, required = true) final String quizId) { // @RequestParam(name = QuizData.QUIZ_ATTR_ID, required = true) final String quizId) {
//
this.authorizationGrantService.checkHasAnyPrivilege( // this.authorizationGrantService.checkHasAnyPrivilege(
EntityType.EXAM, // EntityType.EXAM,
PrivilegeType.WRITE); // PrivilegeType.WRITE);
//
final LmsAPITemplate lmsAPITemplate = this.lmsAPIService // final LmsAPITemplate lmsAPITemplate = this.lmsAPIService
.createLmsAPITemplate(lmsSetupId) // .createLmsAPITemplate(lmsSetupId)
.getOrThrow(); // .getOrThrow();
//
final Set<String> ids = new HashSet<>(Arrays.asList( // final Set<String> ids = new HashSet<>(Arrays.asList(
StringUtils.split(quizId, Constants.LIST_SEPARATOR_CHAR))); // StringUtils.split(quizId, Constants.LIST_SEPARATOR_CHAR)));
//
return lmsAPITemplate.getQuizzes(ids) // return lmsAPITemplate.getQuizzes(ids)
.stream() // .stream()
.map(result -> result.flatMap(quiz -> this.examDAO.importFromQuizData( // .map(result -> result.flatMap(quiz -> this.examDAO.importFromQuizData(
lmsAPITemplate.lmsSetup().institutionId, // lmsAPITemplate.lmsSetup().institutionId,
lmsSetupId, // lmsSetupId,
quiz))) // quiz)))
.flatMap(Result::skipOnError) // .flatMap(Result::skipOnError)
.peek(exam -> this.userActivityLogDAO.log(ActivityType.IMPORT, exam)) // .peek(exam -> this.userActivityLogDAO.log(ActivityType.IMPORT, exam))
.collect(Collectors.toList()); // .collect(Collectors.toList());
} // }
} }

View file

@ -8,21 +8,12 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.util.Collection; import org.mybatis.dynamic.sql.SqlTable;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.springframework.context.ApplicationEventPublisher; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserMod; import ch.ethz.seb.sebserver.gbl.model.user.UserMod;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.datalayer.batis.mapper.UserRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.PaginationService; 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.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.bulkaction.BulkActionService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO; 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.dao.UserDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.validation.BeanValidationService;
import ch.ethz.seb.sebserver.webservice.weblayer.oauth.RevokeTokenEndpoint; import ch.ethz.seb.sebserver.webservice.weblayer.oauth.RevokeTokenEndpoint;
@WebServiceProfile @WebServiceProfile
@ -43,7 +32,6 @@ import ch.ethz.seb.sebserver.webservice.weblayer.oauth.RevokeTokenEndpoint;
@RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_USER_ACCOUNT) @RequestMapping("/${sebserver.webservice.api.admin.endpoint}" + RestAPI.ENDPOINT_USER_ACCOUNT)
public class UserAccountController extends ActivatableEntityController<UserInfo, UserMod> { public class UserAccountController extends ActivatableEntityController<UserInfo, UserMod> {
private final UserDAO userDao;
private final ApplicationEventPublisher applicationEventPublisher; private final ApplicationEventPublisher applicationEventPublisher;
public UserAccountController( public UserAccountController(
@ -52,66 +40,18 @@ public class UserAccountController extends ActivatableEntityController<UserInfo,
final UserActivityLogDAO userActivityLogDAO, final UserActivityLogDAO userActivityLogDAO,
final PaginationService paginationService, final PaginationService paginationService,
final BulkActionService bulkActionService, final BulkActionService bulkActionService,
final ApplicationEventPublisher applicationEventPublisher) { final ApplicationEventPublisher applicationEventPublisher,
final BeanValidationService beanValidationService) {
super(authorizationGrantService, bulkActionService, userDao, userActivityLogDAO, paginationService); super(authorizationGrantService,
this.userDao = userDao; bulkActionService,
userDao,
userActivityLogDAO,
paginationService,
beanValidationService);
this.applicationEventPublisher = applicationEventPublisher; 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) @RequestMapping(path = "/me", method = RequestMethod.GET)
public UserInfo loggedInUser() { public UserInfo loggedInUser() {
return this.authorizationGrantService return this.authorizationGrantService
@ -120,6 +60,16 @@ public class UserAccountController extends ActivatableEntityController<UserInfo,
.getUserInfo(); .getUserInfo();
} }
@Override
protected Class<UserMod> modifiedDataType() {
return UserMod.class;
}
@Override
protected SqlTable getSQLTableOfEntity() {
return UserRecordDynamicSqlSupport.userRecord;
}
@Override @Override
protected Result<UserInfo> notifySave(final UserMod userData, final UserInfo userInfo) { protected Result<UserInfo> notifySave(final UserMod userData, final UserInfo userInfo) {
// handle password change; revoke access tokens if password has changed // handle password change; revoke access tokens if password has changed
@ -130,42 +80,4 @@ public class UserAccountController extends ActivatableEntityController<UserInfo,
return Result.of(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;
}
} }

View file

@ -8,31 +8,22 @@
package ch.ethz.seb.sebserver.webservice.weblayer.api; package ch.ethz.seb.sebserver.webservice.weblayer.api;
import java.util.Arrays;
import java.util.Collection; 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.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Page; import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog; import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; 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.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.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.PaginationService;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationGrantService; 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.PrivilegeType;
@ -66,53 +57,12 @@ public class UserActivityLogController {
} }
@RequestMapping(method = RequestMethod.GET) @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( public Page<UserActivityLog> getPage(
@RequestParam( @RequestParam(
name = UserActivityLog.FILTER_ATTR_INSTITUTION, name = UserActivityLog.FILTER_ATTR_INSTITUTION,
required = true, required = true,
defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, 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_FROM, required = false) final String from,
@RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to,
@RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES,
@ -130,37 +80,37 @@ public class UserActivityLogController {
sortBy, sortBy,
sortOrder, sortOrder,
UserRecordDynamicSqlSupport.userRecord, UserRecordDynamicSqlSupport.userRecord,
() -> _getAll(institutionId, null, from, to, activityTypes, entityTypes)); () -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes)).getOrThrow();
} }
@RequestMapping(path = "/page/{userId}", method = RequestMethod.GET) // @RequestMapping(path = "/page/{userId}", method = RequestMethod.GET)
public Page<UserActivityLog> getPageForUser( // public Page<UserActivityLog> getPageForUser(
@PathVariable final String userId, // @PathVariable final String userId,
@RequestParam( // @RequestParam(
name = UserActivityLog.FILTER_ATTR_INSTITUTION, // name = UserActivityLog.FILTER_ATTR_INSTITUTION,
required = true, // required = true,
defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId, // 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_FROM, required = false) final String from,
@RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to, // @RequestParam(name = UserActivityLog.FILTER_ATTR_TO, required = false) final String to,
@RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES, // @RequestParam(name = UserActivityLog.FILTER_ATTR_ACTIVITY_TYPES,
required = false) final String activityTypes, // required = false) final String activityTypes,
@RequestParam(name = UserActivityLog.FILTER_ATTR_ENTITY_TYPES, required = false) final String entityTypes, // @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_NUMBER, required = false) final Integer pageNumber,
@RequestParam(name = Page.ATTR_PAGE_SIZE, required = false) final Integer pageSize, // @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_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) {
//
// checkBaseReadPrivilege(institutionId);
// return this.paginationService.getPage(
// pageNumber,
// pageSize,
// sortBy,
// sortOrder,
// UserRecordDynamicSqlSupport.userRecord,
// () -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes));
// }
checkBaseReadPrivilege(institutionId); private Result<Collection<UserActivityLog>> _getAll(
return this.paginationService.getPage(
pageNumber,
pageSize,
sortBy,
sortOrder,
UserRecordDynamicSqlSupport.userRecord,
() -> _getAll(institutionId, userId, from, to, activityTypes, entityTypes));
}
private Collection<UserActivityLog> _getAll(
final Long institutionId, final Long institutionId,
final String userId, final String userId,
final String from, final String from,
@ -168,34 +118,19 @@ public class UserActivityLogController {
final String activityTypes, final String activityTypes,
final String entityTypes) { final String entityTypes) {
final Set<String> _activityTypes = (activityTypes != null) return Result.tryCatch(() -> {
? 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;
final Predicate<UserActivityLogRecord> filter = (_activityTypes != null || _entityTypes != null) this.paginationService.setDefaultLimitIfNotSet();
? record -> {
if (_activityTypes != null && !_activityTypes.contains(record.getActivityType())) {
return false;
}
if (_entityTypes != null && !_entityTypes.contains(record.getEntityType())) {
return false;
}
return true; return this.userActivityLogDAO.all(
} institutionId,
: record -> true; userId,
Utils.toMilliSeconds(from),
return this.userActivityLogDAO.all( Utils.toMilliSeconds(to),
institutionId, activityTypes,
userId, entityTypes,
Utils.toMilliSeconds(from), log -> true).getOrThrow();
Utils.toMilliSeconds(to), });
filter).getOrThrow();
} }
private void checkBaseReadPrivilege(final Long institutionId) { private void checkBaseReadPrivilege(final Long institutionId) {

View file

@ -11,9 +11,13 @@ package ch.ethz.seb.sebserver.webservice.batis;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import java.io.IOException;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; 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.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import org.junit.Test; import org.junit.Test;
@ -88,4 +92,10 @@ public class JodaTimeTypeResolverTest {
assertEquals(pointInTime, nullableResult); assertEquals(pointInTime, nullableResult);
} }
@Test
public void test() throws JsonParseException, JsonMappingException, IOException {
final Boolean readValue = new ObjectMapper().readValue("true", Boolean.class);
assertTrue(readValue);
}
} }

View file

@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * 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; import java.security.Principal;

View file

@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * 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.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; 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.boot.test.context.SpringBootTest;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.security.web.FilterChainProxy; import org.springframework.security.web.FilterChainProxy;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
@ -48,7 +49,7 @@ import ch.ethz.seb.sebserver.gbl.JSONMapper;
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("test") @ActiveProfiles("test")
@AutoConfigureMockMvc @AutoConfigureMockMvc
public abstract class AdministrationAPIIntegrationTest { public abstract class AdministrationAPIIntegrationTester {
@Value("${sebserver.webservice.api.admin.clientId}") @Value("${sebserver.webservice.api.admin.clientId}")
protected String clientId; protected String clientId;
@ -115,6 +116,8 @@ public abstract class AdministrationAPIIntegrationTest {
private String accessToken; private String accessToken;
private HttpStatus expectedStatus; private HttpStatus expectedStatus;
private HttpMethod httpMethod = HttpMethod.GET; private HttpMethod httpMethod = HttpMethod.GET;
private MediaType contentType = MediaType.APPLICATION_FORM_URLENCODED;
private String body = null;
public RestAPITestHelper withAccessToken(final String accessToken) { public RestAPITestHelper withAccessToken(final String accessToken) {
this.accessToken = accessToken; this.accessToken = accessToken;
@ -141,9 +144,20 @@ public abstract class AdministrationAPIIntegrationTest {
return this; 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 { public String getAsString() throws Exception {
final ResultActions action = AdministrationAPIIntegrationTest.this.mockMvc final ResultActions action = AdministrationAPIIntegrationTester.this.mockMvc
.perform(requestBuilder()); .perform(requestBuilder());
if (this.expectedStatus != null) { if (this.expectedStatus != null) {
action.andExpect(status().is(this.expectedStatus.value())); 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 { public <T> T getAsObject(final TypeReference<T> ref) throws Exception {
final ResultActions action = AdministrationAPIIntegrationTest.this.mockMvc final ResultActions action = AdministrationAPIIntegrationTester.this.mockMvc
.perform(requestBuilder()); .perform(requestBuilder());
if (this.expectedStatus != null) { if (this.expectedStatus != null) {
action.andExpect(status().is(this.expectedStatus.value())); action.andExpect(status().is(this.expectedStatus.value()));
} }
return AdministrationAPIIntegrationTest.this.jsonMapper.readValue( return AdministrationAPIIntegrationTester.this.jsonMapper.readValue(
action action
.andReturn() .andReturn()
.getResponse() .getResponse()
@ -191,12 +205,21 @@ public abstract class AdministrationAPIIntegrationTest {
get(getFullPath()); get(getFullPath());
break; 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() { private String getFullPath() {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append(AdministrationAPIIntegrationTest.this.endpoint); sb.append(AdministrationAPIIntegrationTester.this.endpoint);
sb.append(this.path); sb.append(this.path);
if (!this.queryAttrs.isEmpty()) { if (!this.queryAttrs.isEmpty()) {
sb.append("?"); sb.append("?");
@ -211,7 +234,6 @@ public abstract class AdministrationAPIIntegrationTest {
} }
return sb.toString(); return sb.toString();
} }
} }
} }

View file

@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * 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.junit.Assert.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@ -16,7 +16,7 @@ import java.io.UnsupportedEncodingException;
import org.junit.Test; import org.junit.Test;
public class GeneralAdminAPITest extends AdministrationAPIIntegrationTest { public class GeneralAdminAPITest extends AdministrationAPIIntegrationTester {
@Test @Test
public void getHello_givenNoToken_thenRedirect() throws Exception { public void getHello_givenNoToken_thenRedirect() throws Exception {

View file

@ -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