SEBSERV-8 #added UserAPIController and tests

This commit is contained in:
anhefti 2018-12-06 17:00:49 +01:00
parent d829233662
commit 4d61b9ed3d
79 changed files with 2315 additions and 1135 deletions

View file

@ -5,7 +5,7 @@ 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="2018-12-03T12:08:56.919+01:00") @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2018-12-06T10:32:55.602+01:00")
public interface Domain { public interface Domain {
interface CONFIGURATION_ATTRIBUTE { interface CONFIGURATION_ATTRIBUTE {
@ -74,6 +74,7 @@ public interface Domain {
interface EXAM { interface EXAM {
String TYPE_NAME = "Exam"; String TYPE_NAME = "Exam";
String REFERENCE_NAME = "exams"; String REFERENCE_NAME = "exams";
String ATTR_INSTITUTION_ID = "institutionId";
String ATTR_LMS_SETUP_ID = "lmsSetupId"; String ATTR_LMS_SETUP_ID = "lmsSetupId";
String ATTR_EXTERNAL_UUID = "externalUuid"; String ATTR_EXTERNAL_UUID = "externalUuid";
String ATTR_OWNER = "owner"; String ATTR_OWNER = "owner";

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="2018-12-03T12:08:57.003+01:00") @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2018-12-06T10:32:55.684+01:00")
public enum EntityType { public enum EntityType {
CONFIGURATION_ATTRIBUTE, CONFIGURATION_ATTRIBUTE,
CONFIGURATION_VALUE, CONFIGURATION_VALUE,

View file

@ -0,0 +1,86 @@
/*
* 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 com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.ActionType;
public class UserActivityLog implements Entity {
@JsonProperty("userId")
public final String userId;
@JsonProperty("timestamp")
public final Long timestamp;
@JsonProperty("actionType")
public final ActionType actionType;
@JsonProperty("entityType")
public final EntityType entityType;
@JsonProperty("entityId")
public final String entityId;
@JsonProperty("message")
public final String message;
public UserActivityLog(
@JsonProperty("userId") final String userId,
@JsonProperty("timestamp") final Long timestamp,
@JsonProperty("actionType") final ActionType actionType,
@JsonProperty("entityType") final EntityType entityType,
@JsonProperty("entityId") final String entityId,
@JsonProperty("message") final String message) {
this.userId = userId;
this.timestamp = timestamp;
this.actionType = actionType;
this.entityType = entityType;
this.entityId = entityId;
this.message = message;
}
@Override
@JsonIgnore
public EntityType entityType() {
return EntityType.USER_LOG;
}
public String getUserId() {
return this.userId;
}
public Long getTimestamp() {
return this.timestamp;
}
public ActionType getActionType() {
return this.actionType;
}
public EntityType getEntityType() {
return this.entityType;
}
public String getEntityId() {
return this.entityId;
}
public String getMessage() {
return this.message;
}
@Override
public String toString() {
return "UserActivityLog [userId=" + this.userId + ", timestamp=" + this.timestamp + ", actionType="
+ this.actionType
+ ", entityType=" + this.entityType + ", entityId=" + this.entityId + ", message=" + this.message + "]";
}
}

View file

@ -8,6 +8,8 @@
package ch.ethz.seb.sebserver.gbl.model.user; package ch.ethz.seb.sebserver.gbl.model.user;
import javax.validation.constraints.NotNull;
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;
@ -74,4 +76,12 @@ public final class UserFilter {
+ this.email + ", active=" + this.active + ", locale=" + this.locale + "]"; + this.email + ", active=" + this.active + ", locale=" + this.locale + "]";
} }
public static UserFilter ofActive() {
return new UserFilter(null, null, null, null, true, null);
}
public static UserFilter ofInstitution(@NotNull final Long institutionId) {
return new UserFilter(institutionId, null, null, null, true, null);
}
} }

View file

@ -9,13 +9,12 @@
package ch.ethz.seb.sebserver.gbl.model.user; package ch.ethz.seb.sebserver.gbl.model.user;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
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;
@ -23,14 +22,13 @@ 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.Domain.USER; import ch.ethz.seb.sebserver.gbl.model.Domain.USER;
import ch.ethz.seb.sebserver.gbl.model.Domain.USER_ROLE; import ch.ethz.seb.sebserver.gbl.model.Domain.USER_ROLE;
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.webservice.datalayer.batis.model.RoleRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantEntity;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserRecord;
/** The user info domain model contains primary user information /** The user info domain model contains primary user information
* *
@ -38,7 +36,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserRecord;
* to and from JSON within the Jackson library. * to and from JSON within the Jackson library.
* *
* This domain model is immutable and thread-save */ * This domain model is immutable and thread-save */
public final class UserInfo implements Entity, Serializable { public final class UserInfo implements GrantEntity, Serializable {
private static final long serialVersionUID = 2526446136264377808L; private static final long serialVersionUID = 2526446136264377808L;
@ -85,6 +83,7 @@ public final class UserInfo implements Entity, Serializable {
/** The users roles in a unmodifiable set. Is never null */ /** The users roles in a unmodifiable set. Is never null */
@NotNull @NotNull
@NotEmpty(message = "userInfo:roles:notEmpty:_:_:_")
@JsonProperty(USER_ROLE.REFERENCE_NAME) @JsonProperty(USER_ROLE.REFERENCE_NAME)
public final Set<String> roles; public final Set<String> roles;
@ -114,6 +113,7 @@ public final class UserInfo implements Entity, Serializable {
} }
@Override @Override
@JsonIgnore
public EntityType entityType() { public EntityType entityType() {
return EntityType.USER; return EntityType.USER;
} }
@ -122,10 +122,17 @@ public final class UserInfo implements Entity, Serializable {
return this.uuid; return this.uuid;
} }
@Override
public Long getInstitutionId() { public Long getInstitutionId() {
return this.institutionId; return this.institutionId;
} }
@JsonIgnore
@Override
public String getOwnerUUID() {
return null;
}
public String getName() { public String getName() {
return this.name; return this.name;
} }
@ -210,33 +217,4 @@ public final class UserInfo implements Entity, Serializable {
userInfo.roles); userInfo.roles);
} }
/** Creates a UserInfo model object from given UserRecord and given collection of RoleRecord.
*
* @param record The UserRecord instance to create a UserInfo instance from
* @param roles Collection of RoleRecords. This can be empty or even null
* @return UserInfo instance from given UserRecord and RoleRecords data */
public static final UserInfo fromRecord(
final UserRecord record,
final Collection<RoleRecord> roles) {
Set<String> userRoles = Collections.emptySet();
if (roles != null) {
userRoles = roles
.stream()
.map(r -> r.getRoleName())
.collect(Collectors.toSet());
}
return new UserInfo(
record.getUuid(),
record.getInstitutionId(),
record.getName(),
record.getUserName(),
record.getEmail(),
BooleanUtils.toBooleanObject(record.getActive()),
Locale.forLanguageTag(record.getLocale()),
DateTimeZone.forID(record.getTimezone()),
userRoles);
}
} }

View file

@ -11,6 +11,7 @@ package ch.ethz.seb.sebserver.gbl.util;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Stream;
/** A result of a computation that can either be the resulting value of the computation /** A result of a computation that can either be the resulting value of the computation
* or an error if an exception/error has been thrown during the computation. * or an error if an exception/error has been thrown during the computation.
@ -131,6 +132,14 @@ public final class Result<T> {
} }
} }
public Stream<T> stream() {
if (this.error != null) {
return Stream.empty();
} else {
return Stream.of(this.value);
}
}
/** Use this to get the resulting value. In an error case, a given error handling /** Use this to get the resulting value. In an error case, a given error handling
* function is used that receives the error and returns a resulting value instead * function is used that receives the error and returns a resulting value instead
* (or throw some error instead) * (or throw some error instead)
@ -154,6 +163,18 @@ public final class Result<T> {
return this.value; return this.value;
} }
public T getOrThrow() {
if (this.error != null) {
if (this.error instanceof RuntimeException) {
throw (RuntimeException) this.error;
} else {
throw new RuntimeException("RuntimeExceptionWrapper cause: ", this.error);
}
}
return this.value;
}
/** Use this to create a Result of a given resulting value. /** Use this to create a Result of a given resulting value.
* *
* @param value resulting value * @param value resulting value

View file

@ -13,6 +13,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.gbl.util.Utils;
@ -22,17 +24,25 @@ public class APIMessage implements Serializable {
private static final long serialVersionUID = -6858683658311637361L; private static final long serialVersionUID = -6858683658311637361L;
public enum ErrorMessage { public enum ErrorMessage {
UNEXPECTED("1000", "Unexpected intenral server-side error"), UNAUTHORIZED("1000", HttpStatus.UNAUTHORIZED, "UNAUTHORIZED"),
FIELD_VALIDATION("1500", "Field validation error"), FORBIDDEN("1001", HttpStatus.FORBIDDEN, "FORBIDDEN"),
PASSWORD_MISSMATCH("2000", "new password do not match retyped password") UNEXPECTED("1100", HttpStatus.INTERNAL_SERVER_ERROR, "Unexpected intenral server-side error"),
FIELD_VALIDATION("1200", HttpStatus.BAD_REQUEST, "Field validation error"),
PASSWORD_MISSMATCH("1300", HttpStatus.BAD_REQUEST, "new password do not match retyped password")
; ;
public final String messageCode; public final String messageCode;
public final HttpStatus httpStatus;
public final String systemMessage; public final String systemMessage;
private ErrorMessage(final String messageCode, final String systemMessage) { private ErrorMessage(
final String messageCode,
final HttpStatus httpStatus,
final String systemMessage) {
this.messageCode = messageCode; this.messageCode = messageCode;
this.httpStatus = httpStatus;
this.systemMessage = systemMessage; this.systemMessage = systemMessage;
} }
@ -55,6 +65,14 @@ public class APIMessage implements Serializable {
public APIMessage of(final Throwable error) { public APIMessage of(final Throwable error) {
return new APIMessage(this.messageCode, this.systemMessage, error.getMessage()); return new APIMessage(this.messageCode, this.systemMessage, error.getMessage());
} }
public ResponseEntity<APIMessage> createErrorResponse() {
return new ResponseEntity<>(of(), this.httpStatus);
}
public ResponseEntity<Object> createErrorResponse(final String details, final String... attributes) {
return new ResponseEntity<>(of(details, attributes), this.httpStatus);
}
} }
public final String messageCode; public final String messageCode;

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="2018-12-03T12:08:57.150+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.836+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="2018-12-03T12:08:57.153+01:00", comments="Source field: client_connection.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.837+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="2018-12-03T12:08:57.153+01:00", comments="Source field: client_connection.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.837+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="2018-12-03T12:08:57.153+01:00", comments="Source field: client_connection.status") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.837+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="2018-12-03T12:08:57.153+01:00", comments="Source field: client_connection.connection_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.838+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="2018-12-03T12:08:57.154+01:00", comments="Source field: client_connection.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.838+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="2018-12-03T12:08:57.155+01:00", comments="Source field: client_connection.vdi") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.838+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="2018-12-03T12:08:57.155+01:00", comments="Source field: client_connection.client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.838+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="2018-12-03T12:08:57.156+01:00", comments="Source field: client_connection.virtual_client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.839+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="2018-12-03T12:08:57.150+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.837+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="2018-12-03T12:08:57.156+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.839+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="2018-12-03T12:08:57.157+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.839+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="2018-12-03T12:08:57.158+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.839+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="2018-12-03T12:08:57.159+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.840+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.840+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.840+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.161+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.841+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.842+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.842+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="2018-12-03T12:08:57.162+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.842+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="2018-12-03T12:08:57.166+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.845+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="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.168+01:00", comments="Source field: client_event.connection_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.168+01:00", comments="Source field: client_event.user_identifier") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.169+01:00", comments="Source field: client_event.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.169+01:00", comments="Source field: client_event.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.169+01:00", comments="Source field: client_event.numeric_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.169+01:00", comments="Source field: client_event.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.166+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.846+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="2018-12-03T12:08:57.169+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.847+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.170+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:57.171+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.848+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="2018-12-03T12:08:56.874+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.560+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="2018-12-03T12:08:56.877+01:00", comments="Source field: configuration_attribute.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.563+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="2018-12-03T12:08:56.878+01:00", comments="Source field: configuration_attribute.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.564+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="2018-12-03T12:08:56.878+01:00", comments="Source field: configuration_attribute.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.878+01:00", comments="Source field: configuration_attribute.parent_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.878+01:00", comments="Source field: configuration_attribute.resources") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.879+01:00", comments="Source field: configuration_attribute.validator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.879+01:00", comments="Source field: configuration_attribute.dependencies") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.879+01:00", comments="Source field: configuration_attribute.default_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.565+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="2018-12-03T12:08:56.877+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.563+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="2018-12-03T12:08:56.881+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.567+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="2018-12-03T12:08:56.883+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.568+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="2018-12-03T12:08:56.884+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.569+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="2018-12-03T12:08:56.886+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.570+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="2018-12-03T12:08:56.890+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.571+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="2018-12-03T12:08:56.891+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.572+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="2018-12-03T12:08:56.893+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.573+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="2018-12-03T12:08:56.894+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.574+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="2018-12-03T12:08:56.895+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.575+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="2018-12-03T12:08:56.896+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.576+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="2018-12-03T12:08:56.899+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.577+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="2018-12-03T12:08:56.900+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.579+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="2018-12-03T12:08:56.902+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.580+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="2018-12-03T12:08:56.903+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.581+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="2018-12-03T12:08:56.904+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.582+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="2018-12-03T12:08:56.905+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.584+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="2018-12-03T12:08:56.907+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.585+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="2018-12-03T12:08:56.908+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.586+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="2018-12-03T12:08:57.125+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.800+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="2018-12-03T12:08:57.125+01:00", comments="Source field: configuration_node.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.800+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="2018-12-03T12:08:57.125+01:00", comments="Source field: configuration_node.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.800+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.description") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.126+01:00", comments="Source field: configuration_node.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.801+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="2018-12-03T12:08:57.125+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.800+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.127+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.802+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.128+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.129+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.803+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="2018-12-03T12:08:57.129+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.804+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="2018-12-03T12:08:57.129+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.804+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="2018-12-03T12:08:57.129+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.804+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="2018-12-03T12:08:57.130+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.804+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="2018-12-03T12:08:57.130+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.804+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="2018-12-03T12:08:57.115+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.792+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="2018-12-03T12:08:57.116+01:00", comments="Source field: configuration.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.117+01:00", comments="Source field: configuration.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.118+01:00", comments="Source field: configuration.version") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.119+01:00", comments="Source field: configuration.version_date") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.119+01:00", comments="Source field: configuration.followup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.116+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.792+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.793+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.794+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.794+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.794+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="2018-12-03T12:08:57.120+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.794+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="2018-12-03T12:08:57.121+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.794+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="2018-12-03T12:08:57.121+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.795+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.795+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.795+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.795+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.796+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.796+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.797+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.797+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="2018-12-03T12:08:57.122+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.797+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="2018-12-03T12:08:57.123+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.797+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="2018-12-03T12:08:57.123+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.797+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="2018-12-03T12:08:57.096+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.777+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.configuration_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.777+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.configuration_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.782+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.list_index") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.782+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.782+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="2018-12-03T12:08:57.097+01:00", comments="Source field: configuration_value.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.782+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="2018-12-03T12:08:57.097+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.777+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.098+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.783+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.099+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.100+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.100+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.101+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.101+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.784+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="2018-12-03T12:08:57.135+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.135+01:00", comments="Source field: exam_configuration_map.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.135+01:00", comments="Source field: exam_configuration_map.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.135+01:00", comments="Source field: exam_configuration_map.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.136+01:00", comments="Source field: exam_configuration_map.user_names") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.135+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.808+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="2018-12-03T12:08:57.136+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.809+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="2018-12-03T12:08:57.136+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.809+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="2018-12-03T12:08:57.136+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.809+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="2018-12-03T12:08:57.136+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.809+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="2018-12-03T12:08:57.136+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.809+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.810+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="2018-12-03T12:08:57.137+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.812+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="2018-12-03T12:08:57.138+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.812+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="2018-12-03T12:08:57.138+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.813+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="2018-12-03T12:08:57.138+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.813+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="2018-12-03T12:08:57.138+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.813+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,34 +6,39 @@ 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="2018-12-03T12:08:57.141+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+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="2018-12-03T12:08:57.142+01:00", comments="Source field: exam.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+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="2018-12-03T12:08:57.142+01:00", comments="Source field: exam.lms_setup_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.830+01:00", comments="Source field: exam.institution_id")
public static final SqlColumn<Long> institutionId = examRecord.institutionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.830+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="2018-12-03T12:08:57.142+01:00", comments="Source field: exam.external_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+01:00", comments="Source field: exam.external_uuid")
public static final SqlColumn<String> externalUuid = examRecord.externalUuid; public static final SqlColumn<String> externalUuid = examRecord.externalUuid;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.142+01:00", comments="Source field: exam.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+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="2018-12-03T12:08:57.143+01:00", comments="Source field: exam.supporter") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+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="2018-12-03T12:08:57.143+01:00", comments="Source field: exam.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+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="2018-12-03T12:08:57.143+01:00", comments="Source field: exam.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+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="2018-12-03T12:08:57.142+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+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);
public final SqlColumn<Long> institutionId = column("institution_id", JDBCType.BIGINT);
public final SqlColumn<Long> lmsSetupId = column("lms_setup_id", JDBCType.BIGINT); public final SqlColumn<Long> lmsSetupId = column("lms_setup_id", JDBCType.BIGINT);
public final SqlColumn<String> externalUuid = column("external_uuid", JDBCType.VARCHAR); public final SqlColumn<String> externalUuid = column("external_uuid", JDBCType.VARCHAR);

View file

@ -32,23 +32,24 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@Mapper @Mapper
public interface ExamRecordMapper { public interface ExamRecordMapper {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.143+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.831+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="2018-12-03T12:08:57.143+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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="2018-12-03T12:08:57.143+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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="2018-12-03T12:08:57.143+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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),
@Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT),
@Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), @Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT),
@Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), @Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR),
@Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR),
@ -58,10 +59,11 @@ public interface ExamRecordMapper {
}) })
ExamRecord selectOne(SelectStatementProvider selectStatement); ExamRecord selectOne(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.143+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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),
@Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT),
@Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), @Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT),
@Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), @Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR),
@Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR),
@ -71,22 +73,22 @@ public interface ExamRecordMapper {
}) })
List<ExamRecord> selectMany(SelectStatementProvider selectStatement); List<ExamRecord> selectMany(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.832+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="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+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_))
@ -94,10 +96,11 @@ public interface ExamRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+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)
.map(institutionId).toProperty("institutionId")
.map(lmsSetupId).toProperty("lmsSetupId") .map(lmsSetupId).toProperty("lmsSetupId")
.map(externalUuid).toProperty("externalUuid") .map(externalUuid).toProperty("externalUuid")
.map(owner).toProperty("owner") .map(owner).toProperty("owner")
@ -108,10 +111,11 @@ public interface ExamRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+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)
.map(institutionId).toPropertyWhenPresent("institutionId", record::getInstitutionId)
.map(lmsSetupId).toPropertyWhenPresent("lmsSetupId", record::getLmsSetupId) .map(lmsSetupId).toPropertyWhenPresent("lmsSetupId", record::getLmsSetupId)
.map(externalUuid).toPropertyWhenPresent("externalUuid", record::getExternalUuid) .map(externalUuid).toPropertyWhenPresent("externalUuid", record::getExternalUuid)
.map(owner).toPropertyWhenPresent("owner", record::getOwner) .map(owner).toPropertyWhenPresent("owner", record::getOwner)
@ -122,30 +126,31 @@ public interface ExamRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+01:00", comments="Source Table: exam")
default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectByExample() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, lmsSetupId, externalUuid, owner, supporter, type, active) return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalUuid, owner, supporter, type, active)
.from(examRecord); .from(examRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+01:00", comments="Source Table: exam")
default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectDistinctByExample() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<ExamRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, lmsSetupId, externalUuid, owner, supporter, type, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, lmsSetupId, externalUuid, owner, supporter, type, active)
.from(examRecord); .from(examRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+01:00", comments="Source Table: exam")
default ExamRecord selectByPrimaryKey(Long id_) { default ExamRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, lmsSetupId, externalUuid, owner, supporter, type, active) return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, lmsSetupId, externalUuid, owner, supporter, type, active)
.from(examRecord) .from(examRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
.build() .build()
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.144+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+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(lmsSetupId).equalTo(record::getLmsSetupId) .set(lmsSetupId).equalTo(record::getLmsSetupId)
.set(externalUuid).equalTo(record::getExternalUuid) .set(externalUuid).equalTo(record::getExternalUuid)
.set(owner).equalTo(record::getOwner) .set(owner).equalTo(record::getOwner)
@ -154,9 +159,10 @@ public interface ExamRecordMapper {
.set(active).equalTo(record::getActive); .set(active).equalTo(record::getActive);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.145+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.833+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(lmsSetupId).equalToWhenPresent(record::getLmsSetupId) .set(lmsSetupId).equalToWhenPresent(record::getLmsSetupId)
.set(externalUuid).equalToWhenPresent(record::getExternalUuid) .set(externalUuid).equalToWhenPresent(record::getExternalUuid)
.set(owner).equalToWhenPresent(record::getOwner) .set(owner).equalToWhenPresent(record::getOwner)
@ -165,9 +171,10 @@ public interface ExamRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .set(active).equalToWhenPresent(record::getActive);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.145+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.834+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(lmsSetupId).equalTo(record::getLmsSetupId) .set(lmsSetupId).equalTo(record::getLmsSetupId)
.set(externalUuid).equalTo(record::getExternalUuid) .set(externalUuid).equalTo(record::getExternalUuid)
.set(owner).equalTo(record::getOwner) .set(owner).equalTo(record::getOwner)
@ -179,9 +186,10 @@ public interface ExamRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.145+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.834+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(lmsSetupId).equalToWhenPresent(record::getLmsSetupId) .set(lmsSetupId).equalToWhenPresent(record::getLmsSetupId)
.set(externalUuid).equalToWhenPresent(record::getExternalUuid) .set(externalUuid).equalToWhenPresent(record::getExternalUuid)
.set(owner).equalToWhenPresent(record::getOwner) .set(owner).equalToWhenPresent(record::getOwner)

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="2018-12-03T12:08:57.175+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.851+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="2018-12-03T12:08:57.175+01:00", comments="Source field: indicator.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.851+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="2018-12-03T12:08:57.175+01:00", comments="Source field: indicator.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.175+01:00", comments="Source field: indicator.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.175+01:00", comments="Source field: indicator.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source field: indicator.color") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.175+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.851+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.852+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="2018-12-03T12:08:57.176+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.178+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.178+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.178+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.178+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.178+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.853+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.854+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.854+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.854+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="2018-12-03T12:08:57.179+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.854+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,22 +6,22 @@ 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="2018-12-03T12:08:57.182+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+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="2018-12-03T12:08:57.183+01:00", comments="Source field: institution.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source field: institution.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source field: institution.authtype") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+01:00", comments="Source field: institution.authtype")
public static final SqlColumn<String> authtype = institutionRecord.authtype; public static final SqlColumn<String> authtype = institutionRecord.authtype;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.183+01:00", comments="Source field: institution.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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="2018-12-03T12:08:57.183+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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),
@ -55,7 +55,7 @@ public interface InstitutionRecordMapper {
}) })
InstitutionRecord selectOne(SelectStatementProvider selectStatement); InstitutionRecord selectOne(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.856+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),
@ -65,22 +65,22 @@ public interface InstitutionRecordMapper {
}) })
List<InstitutionRecord> selectMany(SelectStatementProvider selectStatement); List<InstitutionRecord> selectMany(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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_))
@ -88,7 +88,7 @@ public interface InstitutionRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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)
@ -99,7 +99,7 @@ public interface InstitutionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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)
@ -110,19 +110,19 @@ public interface InstitutionRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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, authtype, active) return SelectDSL.selectWithMapper(this::selectMany, id, name, authtype, active)
.from(institutionRecord); .from(institutionRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.184+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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, authtype, active) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, authtype, active)
.from(institutionRecord); .from(institutionRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.185+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+01:00", comments="Source Table: institution")
default InstitutionRecord selectByPrimaryKey(Long id_) { default InstitutionRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, name, authtype, active) return SelectDSL.selectWithMapper(this::selectOne, id, name, authtype, active)
.from(institutionRecord) .from(institutionRecord)
@ -131,7 +131,7 @@ public interface InstitutionRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.185+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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)
@ -139,7 +139,7 @@ public interface InstitutionRecordMapper {
.set(active).equalTo(record::getActive); .set(active).equalTo(record::getActive);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.185+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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)
@ -147,7 +147,7 @@ public interface InstitutionRecordMapper {
.set(active).equalToWhenPresent(record::getActive); .set(active).equalToWhenPresent(record::getActive);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.186+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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)
@ -158,7 +158,7 @@ public interface InstitutionRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.186+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.857+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="2018-12-03T12:08:57.188+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.lms_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.lms_url") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.lms_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.860+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.lms_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.860+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.lms_rest_api_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.860+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="2018-12-03T12:08:57.189+01:00", comments="Source field: lms_setup.seb_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source field: lms_setup.seb_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source field: lms_setup.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.189+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.190+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.861+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="2018-12-03T12:08:57.190+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.862+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.863+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.863+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.863+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="2018-12-03T12:08:57.191+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.863+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="2018-12-03T12:08:57.192+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.864+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="2018-12-03T12:08:57.192+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.864+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="2018-12-03T12:08:57.105+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.106+01:00", comments="Source field: orientation.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.106+01:00", comments="Source field: orientation.config_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.107+01:00", comments="Source field: orientation.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.107+01:00", comments="Source field: orientation.view") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.107+01:00", comments="Source field: orientation.group") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.107+01:00", comments="Source field: orientation.x_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.108+01:00", comments="Source field: orientation.y_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.108+01:00", comments="Source field: orientation.width") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.108+01:00", comments="Source field: orientation.height") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.106+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.787+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.788+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.109+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.110+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.110+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.110+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.110+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.110+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.789+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="2018-12-03T12:08:57.111+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.111+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.111+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.111+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.111+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.112+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.790+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="2018-12-03T12:08:57.226+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.892+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="2018-12-03T12:08:57.227+01:00", comments="Source field: user_role.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source field: user_role.user_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source field: user_role.role_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.226+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.893+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="2018-12-03T12:08:57.227+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.894+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

@ -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 UserLogRecordDynamicSqlSupport { public final class UserLogRecordDynamicSqlSupport {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.897+01:00", comments="Source Table: user_log")
public static final UserLogRecord userLogRecord = new UserLogRecord(); public static final UserLogRecord userLogRecord = new UserLogRecord();
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.897+01:00", comments="Source field: user_log.id")
public static final SqlColumn<Long> id = userLogRecord.id; public static final SqlColumn<Long> id = userLogRecord.id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.user_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.897+01:00", comments="Source field: user_log.user_uuid")
public static final SqlColumn<String> userUuid = userLogRecord.userUuid; public static final SqlColumn<String> userUuid = userLogRecord.userUuid;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source field: user_log.timestamp")
public static final SqlColumn<Long> timestamp = userLogRecord.timestamp; public static final SqlColumn<Long> timestamp = userLogRecord.timestamp;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.action_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source field: user_log.action_type")
public static final SqlColumn<String> actionType = userLogRecord.actionType; public static final SqlColumn<String> actionType = userLogRecord.actionType;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.entity_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source field: user_log.entity_type")
public static final SqlColumn<String> entityType = userLogRecord.entityType; public static final SqlColumn<String> entityType = userLogRecord.entityType;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.entity_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source field: user_log.entity_id")
public static final SqlColumn<String> entityId = userLogRecord.entityId; public static final SqlColumn<String> entityId = userLogRecord.entityId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source field: user_log.message") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source field: user_log.message")
public static final SqlColumn<String> message = userLogRecord.message; public static final SqlColumn<String> message = userLogRecord.message;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.897+01:00", comments="Source Table: user_log")
public static final class UserLogRecord extends SqlTable { public static final class UserLogRecord 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 UserLogRecordMapper { public interface UserLogRecordMapper {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source Table: user_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="2018-12-03T12:08:57.230+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source Table: user_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="2018-12-03T12:08:57.230+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.898+01:00", comments="Source Table: user_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<UserLogRecord> insertStatement); int insert(InsertStatementProvider<UserLogRecord> insertStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.230+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_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 UserLogRecordMapper {
}) })
UserLogRecord selectOne(SelectStatementProvider selectStatement); UserLogRecord selectOne(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_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 UserLogRecordMapper {
}) })
List<UserLogRecord> selectMany(SelectStatementProvider selectStatement); List<UserLogRecord> selectMany(SelectStatementProvider selectStatement);
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_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="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_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(userLogRecord); .from(userLogRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() { default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
return DeleteDSL.deleteFromWithMapper(this::delete, userLogRecord); return DeleteDSL.deleteFromWithMapper(this::delete, userLogRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default int deleteByPrimaryKey(Long id_) { default int deleteByPrimaryKey(Long id_) {
return DeleteDSL.deleteFromWithMapper(this::delete, userLogRecord) return DeleteDSL.deleteFromWithMapper(this::delete, userLogRecord)
.where(id, isEqualTo(id_)) .where(id, isEqualTo(id_))
@ -94,7 +94,7 @@ public interface UserLogRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default int insert(UserLogRecord record) { default int insert(UserLogRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userLogRecord) .into(userLogRecord)
@ -108,7 +108,7 @@ public interface UserLogRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default int insertSelective(UserLogRecord record) { default int insertSelective(UserLogRecord record) {
return insert(SqlBuilder.insert(record) return insert(SqlBuilder.insert(record)
.into(userLogRecord) .into(userLogRecord)
@ -122,19 +122,19 @@ public interface UserLogRecordMapper {
.render(RenderingStrategy.MYBATIS3)); .render(RenderingStrategy.MYBATIS3));
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserLogRecord>>> selectByExample() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserLogRecord>>> selectByExample() {
return SelectDSL.selectWithMapper(this::selectMany, id, userUuid, timestamp, actionType, entityType, entityId, message) return SelectDSL.selectWithMapper(this::selectMany, id, userUuid, timestamp, actionType, entityType, entityId, message)
.from(userLogRecord); .from(userLogRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserLogRecord>>> selectDistinctByExample() { default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<UserLogRecord>>> selectDistinctByExample() {
return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userUuid, timestamp, actionType, entityType, entityId, message) return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userUuid, timestamp, actionType, entityType, entityId, message)
.from(userLogRecord); .from(userLogRecord);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default UserLogRecord selectByPrimaryKey(Long id_) { default UserLogRecord selectByPrimaryKey(Long id_) {
return SelectDSL.selectWithMapper(this::selectOne, id, userUuid, timestamp, actionType, entityType, entityId, message) return SelectDSL.selectWithMapper(this::selectOne, id, userUuid, timestamp, actionType, entityType, entityId, message)
.from(userLogRecord) .from(userLogRecord)
@ -143,7 +143,7 @@ public interface UserLogRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(UserLogRecord record) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(UserLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userLogRecord) return UpdateDSL.updateWithMapper(this::update, userLogRecord)
.set(userUuid).equalTo(record::getUserUuid) .set(userUuid).equalTo(record::getUserUuid)
@ -154,7 +154,7 @@ public interface UserLogRecordMapper {
.set(message).equalTo(record::getMessage); .set(message).equalTo(record::getMessage);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.899+01:00", comments="Source Table: user_log")
default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(UserLogRecord record) { default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(UserLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userLogRecord) return UpdateDSL.updateWithMapper(this::update, userLogRecord)
.set(userUuid).equalToWhenPresent(record::getUserUuid) .set(userUuid).equalToWhenPresent(record::getUserUuid)
@ -165,7 +165,7 @@ public interface UserLogRecordMapper {
.set(message).equalToWhenPresent(record::getMessage); .set(message).equalToWhenPresent(record::getMessage);
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.231+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.900+01:00", comments="Source Table: user_log")
default int updateByPrimaryKey(UserLogRecord record) { default int updateByPrimaryKey(UserLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userLogRecord) return UpdateDSL.updateWithMapper(this::update, userLogRecord)
.set(userUuid).equalTo(record::getUserUuid) .set(userUuid).equalTo(record::getUserUuid)
@ -179,7 +179,7 @@ public interface UserLogRecordMapper {
.execute(); .execute();
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.232+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.901+01:00", comments="Source Table: user_log")
default int updateByPrimaryKeySelective(UserLogRecord record) { default int updateByPrimaryKeySelective(UserLogRecord record) {
return UpdateDSL.updateWithMapper(this::update, userLogRecord) return UpdateDSL.updateWithMapper(this::update, userLogRecord)
.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="2018-12-03T12:08:57.195+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.883+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="2018-12-03T12:08:57.195+01:00", comments="Source field: user.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.884+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="2018-12-03T12:08:57.195+01:00", comments="Source field: user.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.884+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="2018-12-03T12:08:57.195+01:00", comments="Source field: user.uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.884+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.885+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.885+01:00", comments="Source field: user.user_name")
public static final SqlColumn<String> userName = userRecord.userName; public static final SqlColumn<String> userName = userRecord.userName;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.196+01:00", comments="Source field: user.password") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.885+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.email") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.885+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.locale") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.885+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.timezone") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.196+01:00", comments="Source field: user.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.195+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.883+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.886+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.197+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.198+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.222+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.887+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="2018-12-03T12:08:57.147+01:00", comments="Source field: client_connection.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.834+01:00", comments="Source field: client_connection.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.exam_id")
private Long examId; private Long examId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.status") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.status")
private String status; private String status;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.connection_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.connection_token")
private String connectionToken; private String connectionToken;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.user_name")
private String userName; private String userName;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.vdi") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.vdi")
private Boolean vdi; private Boolean vdi;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+01:00", comments="Source field: client_connection.client_address")
private String clientAddress; private String clientAddress;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.149+01:00", comments="Source field: client_connection.virtual_client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.836+01:00", comments="Source field: client_connection.virtual_client_address")
private String virtualClientAddress; private String virtualClientAddress;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.147+01:00", comments="Source Table: client_connection") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.834+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.status") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.connection_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.148+01:00", comments="Source field: client_connection.vdi") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.835+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="2018-12-03T12:08:57.149+01:00", comments="Source field: client_connection.client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.836+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="2018-12-03T12:08:57.149+01:00", comments="Source field: client_connection.virtual_client_address") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.836+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.843+01:00", comments="Source field: client_event.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.connection_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.843+01:00", comments="Source field: client_event.connection_id")
private Long connectionId; private Long connectionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.user_identifier") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+01:00", comments="Source field: client_event.user_identifier")
private String userIdentifier; private String userIdentifier;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+01:00", comments="Source field: client_event.type")
private Integer type; private Integer type;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+01:00", comments="Source field: client_event.timestamp")
private Long timestamp; private Long timestamp;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.numeric_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+01:00", comments="Source field: client_event.numeric_value")
private BigDecimal numericValue; private BigDecimal numericValue;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+01:00", comments="Source field: client_event.text")
private String text; private String text;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.165+01:00", comments="Source Table: client_event") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.843+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="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.843+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="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.connection_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.user_identifier") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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="2018-12-03T12:08:57.165+01:00", comments="Source field: client_event.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.numeric_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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="2018-12-03T12:08:57.166+01:00", comments="Source field: client_event.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.844+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:56.863+01:00", comments="Source field: configuration_attribute.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.549+01:00", comments="Source field: configuration_attribute.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.864+01:00", comments="Source field: configuration_attribute.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.550+01:00", comments="Source field: configuration_attribute.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.864+01:00", comments="Source field: configuration_attribute.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.550+01:00", comments="Source field: configuration_attribute.type")
private String type; private String type;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.864+01:00", comments="Source field: configuration_attribute.parent_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+01:00", comments="Source field: configuration_attribute.parent_id")
private Long parentId; private Long parentId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.resources") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+01:00", comments="Source field: configuration_attribute.resources")
private String resources; private String resources;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.validator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+01:00", comments="Source field: configuration_attribute.validator")
private String validator; private String validator;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.dependencies") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+01:00", comments="Source field: configuration_attribute.dependencies")
private String dependencies; private String dependencies;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.866+01:00", comments="Source field: configuration_attribute.default_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.552+01:00", comments="Source field: configuration_attribute.default_value")
private String defaultValue; private String defaultValue;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:56.856+01:00", comments="Source Table: configuration_attribute") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.538+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="2018-12-03T12:08:56.863+01:00", comments="Source field: configuration_attribute.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.550+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="2018-12-03T12:08:56.864+01:00", comments="Source field: configuration_attribute.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.550+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="2018-12-03T12:08:56.864+01:00", comments="Source field: configuration_attribute.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+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="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.parent_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+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="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.resources") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+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="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.validator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+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="2018-12-03T12:08:56.865+01:00", comments="Source field: configuration_attribute.dependencies") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.551+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="2018-12-03T12:08:56.866+01:00", comments="Source field: configuration_attribute.default_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.552+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 Dec 03 12:08:56 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:56 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:56 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.123+01:00", comments="Source field: configuration_node.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+01:00", comments="Source field: configuration_node.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+01:00", comments="Source field: configuration_node.institution_id")
private Long institutionId; private Long institutionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+01:00", comments="Source field: configuration_node.owner")
private String owner; private String owner;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+01:00", comments="Source field: configuration_node.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.description") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+01:00", comments="Source field: configuration_node.description")
private String description; private String description;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+01:00", comments="Source field: configuration_node.type")
private String type; private String type;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+01:00", comments="Source field: configuration_node.template")
private String template; private String template;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.125+01:00", comments="Source field: configuration_node.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+01:00", comments="Source field: configuration_node.active")
private Integer active; private Integer active;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.123+01:00", comments="Source Table: configuration_node") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.798+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.description") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+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="2018-12-03T12:08:57.124+01:00", comments="Source field: configuration_node.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.799+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="2018-12-03T12:08:57.125+01:00", comments="Source field: configuration_node.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.800+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+01:00", comments="Source field: configuration.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+01:00", comments="Source field: configuration.configuration_node_id")
private Long configurationNodeId; private Long configurationNodeId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.version") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+01:00", comments="Source field: configuration.version")
private String version; private String version;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.114+01:00", comments="Source field: configuration.version_date") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+01:00", comments="Source field: configuration.version_date")
private DateTime versionDate; private DateTime versionDate;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.115+01:00", comments="Source field: configuration.followup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+01:00", comments="Source field: configuration.followup")
private Integer followup; private Integer followup;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.113+01:00", comments="Source Table: configuration") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+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="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+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="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+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="2018-12-03T12:08:57.113+01:00", comments="Source field: configuration.version") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+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="2018-12-03T12:08:57.114+01:00", comments="Source field: configuration.version_date") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.791+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="2018-12-03T12:08:57.115+01:00", comments="Source field: configuration.followup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.792+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.095+01:00", comments="Source field: configuration_value.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.775+01:00", comments="Source field: configuration_value.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.configuration_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+01:00", comments="Source field: configuration_value.configuration_id")
private Long configurationId; private Long configurationId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.configuration_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+01:00", comments="Source field: configuration_value.configuration_attribute_id")
private Long configurationAttributeId; private Long configurationAttributeId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.list_index") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+01:00", comments="Source field: configuration_value.list_index")
private Integer listIndex; private Integer listIndex;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+01:00", comments="Source field: configuration_value.value")
private String value; private String value;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+01:00", comments="Source field: configuration_value.text")
private String text; private String text;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.095+01:00", comments="Source Table: configuration_value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.775+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="2018-12-03T12:08:57.095+01:00", comments="Source field: configuration_value.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.775+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="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.configuration_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.configuration_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.list_index") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.value") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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="2018-12-03T12:08:57.096+01:00", comments="Source field: configuration_value.text") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.776+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.806+01:00", comments="Source field: exam_configuration_map.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+01:00", comments="Source field: exam_configuration_map.exam_id")
private Long examId; private Long examId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.user_names") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+01:00", comments="Source field: exam_configuration_map.user_names")
private String userNames; private String userNames;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.131+01:00", comments="Source Table: exam_configuration_map") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.806+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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.configuration_node_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+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="2018-12-03T12:08:57.131+01:00", comments="Source field: exam_configuration_map.user_names") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.807+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public int hashCode() { public int hashCode() {

View file

@ -3,30 +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="2018-12-03T12:08:57.139+01:00", comments="Source field: exam.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+01:00", comments="Source field: exam.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.lms_setup_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+01:00", comments="Source field: exam.institution_id")
private Long institutionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+01:00", comments="Source field: exam.lms_setup_id")
private Long lmsSetupId; private Long lmsSetupId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.external_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.823+01:00", comments="Source field: exam.external_uuid")
private String externalUuid; private String externalUuid;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.826+01:00", comments="Source field: exam.owner")
private String owner; private String owner;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.supporter") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.826+01:00", comments="Source field: exam.supporter")
private String supporter; private String supporter;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+01:00", comments="Source field: exam.type")
private String type; private String type;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+01:00", comments="Source field: exam.active")
private Integer active; private Integer active;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.139+01:00", comments="Source Table: exam") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+01:00", comments="Source Table: exam")
public ExamRecord(Long id, Long lmsSetupId, String externalUuid, String owner, String supporter, String type, Integer active) { public ExamRecord(Long id, Long institutionId, Long lmsSetupId, String externalUuid, String owner, String supporter, String type, Integer active) {
this.id = id; this.id = id;
this.institutionId = institutionId;
this.lmsSetupId = lmsSetupId; this.lmsSetupId = lmsSetupId;
this.externalUuid = externalUuid; this.externalUuid = externalUuid;
this.owner = owner; this.owner = owner;
@ -35,37 +39,42 @@ public class ExamRecord {
this.active = active; this.active = active;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+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="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.lms_setup_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.817+01:00", comments="Source field: exam.institution_id")
public Long getInstitutionId() {
return institutionId;
}
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.819+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="2018-12-03T12:08:57.140+01:00", comments="Source field: exam.external_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.826+01:00", comments="Source field: exam.external_uuid")
public String getExternalUuid() { public String getExternalUuid() {
return externalUuid; return externalUuid;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.owner") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.826+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="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.supporter") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+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="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+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="2018-12-03T12:08:57.141+01:00", comments="Source field: exam.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.827+01:00", comments="Source field: exam.active")
public Integer getActive() { public Integer getActive() {
return active; return active;
} }
@ -74,7 +83,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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public String toString() { public String toString() {
@ -83,6 +92,7 @@ public class ExamRecord {
sb.append(" ["); sb.append(" [");
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", institutionId=").append(institutionId);
sb.append(", lmsSetupId=").append(lmsSetupId); sb.append(", lmsSetupId=").append(lmsSetupId);
sb.append(", externalUuid=").append(externalUuid); sb.append(", externalUuid=").append(externalUuid);
sb.append(", owner=").append(owner); sb.append(", owner=").append(owner);
@ -97,7 +107,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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -112,6 +122,7 @@ public class ExamRecord {
} }
ExamRecord other = (ExamRecord) that; ExamRecord other = (ExamRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getInstitutionId() == null ? other.getInstitutionId() == null : this.getInstitutionId().equals(other.getInstitutionId()))
&& (this.getLmsSetupId() == null ? other.getLmsSetupId() == null : this.getLmsSetupId().equals(other.getLmsSetupId())) && (this.getLmsSetupId() == null ? other.getLmsSetupId() == null : this.getLmsSetupId().equals(other.getLmsSetupId()))
&& (this.getExternalUuid() == null ? other.getExternalUuid() == null : this.getExternalUuid().equals(other.getExternalUuid())) && (this.getExternalUuid() == null ? other.getExternalUuid() == null : this.getExternalUuid().equals(other.getExternalUuid()))
&& (this.getOwner() == null ? other.getOwner() == null : this.getOwner().equals(other.getOwner())) && (this.getOwner() == null ? other.getOwner() == null : this.getOwner().equals(other.getOwner()))
@ -124,13 +135,14 @@ 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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getInstitutionId() == null) ? 0 : getInstitutionId().hashCode());
result = prime * result + ((getLmsSetupId() == null) ? 0 : getLmsSetupId().hashCode()); result = prime * result + ((getLmsSetupId() == null) ? 0 : getLmsSetupId().hashCode());
result = prime * result + ((getExternalUuid() == null) ? 0 : getExternalUuid().hashCode()); result = prime * result + ((getExternalUuid() == null) ? 0 : getExternalUuid().hashCode());
result = prime * result + ((getOwner() == null) ? 0 : getOwner().hashCode()); result = prime * result + ((getOwner() == null) ? 0 : getOwner().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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.849+01:00", comments="Source field: indicator.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.849+01:00", comments="Source field: indicator.exam_id")
private Long examId; private Long examId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.850+01:00", comments="Source field: indicator.type")
private String type; private String type;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.850+01:00", comments="Source field: indicator.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.color") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.850+01:00", comments="Source field: indicator.color")
private String color; private String color;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.173+01:00", comments="Source Table: indicator") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.849+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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.849+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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.exam_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.849+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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.850+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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.850+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="2018-12-03T12:08:57.174+01:00", comments="Source field: indicator.color") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.851+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 InstitutionRecord { public class InstitutionRecord {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.authtype") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.authtype")
private String authtype; private String authtype;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.active")
private Integer active; private Integer active;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source Table: institution") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source Table: institution")
public InstitutionRecord(Long id, String name, String authtype, Integer active) { public InstitutionRecord(Long id, String name, String authtype, Integer active) {
this.id = id; this.id = id;
this.name = name; this.name = name;
@ -23,22 +23,22 @@ public class InstitutionRecord {
this.active = active; this.active = active;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+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="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+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="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.authtype") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.authtype")
public String getAuthtype() { public String getAuthtype() {
return authtype; return authtype;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.182+01:00", comments="Source field: institution.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.855+01:00", comments="Source field: institution.active")
public Integer getActive() { public Integer getActive() {
return active; return active;
} }
@ -47,7 +47,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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public String toString() { public String toString() {
@ -67,7 +67,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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -91,7 +91,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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.187+01:00", comments="Source field: lms_setup.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.187+01:00", comments="Source field: lms_setup.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.institution_id")
private Long institutionId; private Long institutionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.lms_type")
private String lmsType; private String lmsType;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_url") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.lms_url")
private String lmsUrl; private String lmsUrl;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.lms_clientname")
private String lmsClientname; private String lmsClientname;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.lms_clientsecret")
private String lmsClientsecret; private String lmsClientsecret;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_rest_api_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.seb_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+01:00", comments="Source field: lms_setup.seb_clientname")
private String sebClientname; private String sebClientname;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.seb_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+01:00", comments="Source field: lms_setup.seb_clientsecret")
private String sebClientsecret; private String sebClientsecret;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+01:00", comments="Source field: lms_setup.active")
private Integer active; private Integer active;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.186+01:00", comments="Source Table: lms_setup") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.187+01:00", comments="Source field: lms_setup.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.187+01:00", comments="Source field: lms_setup.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_url") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.lms_rest_api_token") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.858+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.seb_clientname") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.seb_clientsecret") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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="2018-12-03T12:08:57.188+01:00", comments="Source field: lms_setup.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.859+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+01:00", comments="Source field: orientation.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.config_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+01:00", comments="Source field: orientation.config_attribute_id")
private Long configAttributeId; private Long configAttributeId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+01:00", comments="Source field: orientation.template")
private String template; private String template;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.view") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.view")
private String view; private String view;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.group") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.group")
private String group; private String group;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.x_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.x_position")
private Integer xPosition; private Integer xPosition;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.y_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.y_position")
private Integer yPosition; private Integer yPosition;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.width") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.width")
private Integer width; private Integer width;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.105+01:00", comments="Source field: orientation.height") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+01:00", comments="Source field: orientation.height")
private Integer height; private Integer height;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.102+01:00", comments="Source Table: orientation") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+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="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+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="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.config_attribute_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+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="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.template") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.785+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="2018-12-03T12:08:57.103+01:00", comments="Source field: orientation.view") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.group") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.x_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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="2018-12-03T12:08:57.104+01:00", comments="Source field: orientation.y_position") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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="2018-12-03T12:08:57.105+01:00", comments="Source field: orientation.width") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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="2018-12-03T12:08:57.105+01:00", comments="Source field: orientation.height") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.786+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.888+01:00", comments="Source field: user_role.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.user_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.889+01:00", comments="Source field: user_role.user_id")
private Long userId; private Long userId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.role_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.889+01:00", comments="Source field: user_role.role_name")
private String roleName; private String roleName;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.226+01:00", comments="Source Table: user_role") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.888+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="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.889+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="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.user_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.889+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="2018-12-03T12:08:57.226+01:00", comments="Source field: user_role.role_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.892+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 UserLogRecord { public class UserLogRecord {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.228+01:00", comments="Source field: user_log.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source field: user_log.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.user_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source field: user_log.user_uuid")
private String userUuid; private String userUuid;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source field: user_log.timestamp")
private Long timestamp; private Long timestamp;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.action_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.action_type")
private String actionType; private String actionType;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.entity_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.entity_type")
private String entityType; private String entityType;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.entity_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.entity_id")
private String entityId; private String entityId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.message") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.message")
private String message; private String message;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.228+01:00", comments="Source Table: user_log") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source Table: user_log")
public UserLogRecord(Long id, String userUuid, Long timestamp, String actionType, String entityType, String entityId, String message) { public UserLogRecord(Long id, String userUuid, Long timestamp, String actionType, String entityType, String entityId, String message) {
this.id = id; this.id = id;
this.userUuid = userUuid; this.userUuid = userUuid;
@ -35,37 +35,37 @@ public class UserLogRecord {
this.message = message; this.message = message;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source field: user_log.id")
public Long getId() { public Long getId() {
return id; return id;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.user_uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.895+01:00", comments="Source field: user_log.user_uuid")
public String getUserUuid() { public String getUserUuid() {
return userUuid; return userUuid;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.timestamp") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.timestamp")
public Long getTimestamp() { public Long getTimestamp() {
return timestamp; return timestamp;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.action_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.action_type")
public String getActionType() { public String getActionType() {
return actionType; return actionType;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.entity_type") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.entity_type")
public String getEntityType() { public String getEntityType() {
return entityType; return entityType;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.entity_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.entity_id")
public String getEntityId() { public String getEntityId() {
return entityId; return entityId;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.229+01:00", comments="Source field: user_log.message") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.896+01:00", comments="Source field: user_log.message")
public String getMessage() { public String getMessage() {
return message; return message;
} }
@ -74,7 +74,7 @@ public class UserLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_log * This method corresponds to the database table user_log
* *
* @mbg.generated Mon Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public String toString() { public String toString() {
@ -97,7 +97,7 @@ public class UserLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_log * This method corresponds to the database table user_log
* *
* @mbg.generated Mon Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public boolean equals(Object that) { public boolean equals(Object that) {
@ -124,7 +124,7 @@ public class UserLogRecord {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table user_log * This method corresponds to the database table user_log
* *
* @mbg.generated Mon Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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="2018-12-03T12:08:57.192+01:00", comments="Source field: user.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+01:00", comments="Source field: user.id")
private Long id; private Long id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.193+01:00", comments="Source field: user.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+01:00", comments="Source field: user.institution_id")
private Long institutionId; private Long institutionId;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.193+01:00", comments="Source field: user.uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+01:00", comments="Source field: user.uuid")
private String uuid; private String uuid;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+01:00", comments="Source field: user.name")
private String name; private String name;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+01:00", comments="Source field: user.user_name")
private String userName; private String userName;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.password") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.password")
private String password; private String password;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.email") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.email")
private String email; private String email;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.locale") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.locale")
private String locale; private String locale;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.timezone") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.timezone")
private String timezone; private String timezone;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.active")
private Integer active; private Integer active;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.192+01:00", comments="Source Table: user") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.864+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="2018-12-03T12:08:57.193+01:00", comments="Source field: user.id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+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="2018-12-03T12:08:57.193+01:00", comments="Source field: user.institution_id") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+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="2018-12-03T12:08:57.193+01:00", comments="Source field: user.uuid") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+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="2018-12-03T12:08:57.194+01:00", comments="Source field: user.name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.865+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="2018-12-03T12:08:57.194+01:00", comments="Source field: user.user_name") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+01:00", comments="Source field: user.user_name")
public String getUserName() { public String getUserName() {
return userName; return userName;
} }
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-03T12:08:57.194+01:00", comments="Source field: user.password") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+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="2018-12-03T12:08:57.194+01:00", comments="Source field: user.email") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+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="2018-12-03T12:08:57.194+01:00", comments="Source field: user.locale") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+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="2018-12-03T12:08:57.194+01:00", comments="Source field: user.timezone") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+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="2018-12-03T12:08:57.195+01:00", comments="Source field: user.active") @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-12-06T10:32:55.882+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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@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 Dec 03 12:08:57 CET 2018 * @mbg.generated Thu Dec 06 10:32:55 CET 2018
*/ */
@Override @Override
public int hashCode() { public int hashCode() {

View file

@ -9,104 +9,30 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.authorization; package ch.ethz.seb.sebserver.webservice.servicelayer.authorization;
import java.security.Principal; import java.security.Principal;
import java.util.Collection;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.PostConstruct;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.model.EntityType; import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.user.UserRole; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.RoleTypeGrant.RoleTypeKey;
/** A service to check authorization grants for a given user for entity-types and -instances /** A service to check authorization grants for a given user for entity-types and -instances
* *
* If there is one or more GrantEntity objects within an authenticated user-request, this service * If there is one or more GrantEntity objects within an authenticated user-request, this service
* can be used check the authenticated user access grant within the object. Check if a given user * can be used check the authenticated user access grant within the object. Check if a given user
* has write, modify or even read-only rights on an entity instance or on an entity type. */ * has write, modify or even read-only rights on an entity instance or on an entity type. */
@Lazy public interface AuthorizationGrantService {
@Service
@WebServiceProfile
public class AuthorizationGrantService {
/** Map of role based grants for specified entity types. */ /** Check a specified GrantType for a given GrantEntity for given user-principal and
private final Map<RoleTypeGrant.RoleTypeKey, RoleTypeGrant> grants = new HashMap<>(); * returns a with a Result of the granted entity instance or with a Result of a
/** Map of collected AuthorizationGrantRule exceptions */ * NoGrantException.
private final Map<EntityType, AuthorizationGrantRule> exceptionalRules = *
new EnumMap<>(EntityType.class); * @param entity The GrantEntity to check specified GrantType for
* @param grantType The GrantType
private final CurrentUserService currentUserService; * @param principal the user principal
* @return a with a Result of the granted entity instance or with a Result of a NoGrantException */
public AuthorizationGrantService( <E extends GrantEntity> Result<E> checkGrantForEntity(
final Collection<AuthorizationGrantRule> exceptionalGrantRules, final E entity,
final CurrentUserService currentUserService) { final GrantType grantType,
final Principal principal);
this.currentUserService = currentUserService;
if (exceptionalGrantRules != null) {
exceptionalGrantRules.stream()
.forEach(r -> this.exceptionalRules.put(r.entityType(), r));
}
}
/** Initialize the (hard-coded) grants */
@PostConstruct
public void init() {
// grants for institution
addGrant(EntityType.INSTITUTION)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.MODIFY)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.EXAM_SUPPORTER)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.create();
// grants for lms setup
addGrant(EntityType.LMS_SETUP)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.MODIFY)
.andForRole(UserRole.EXAM_SUPPORTER)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.create();
// grants for user account
addGrant(EntityType.USER)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_ADMIN)
.andForRole(UserRole.EXAM_SUPPORTER)
.create();
// grants for exam
addGrant(EntityType.EXAM)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.withOwnerPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_SUPPORTER)
.withOwnerPrivilege(GrantType.MODIFY)
.create();
// TODO other entities
}
/** Checks if a given user has a specified grant for a given entity-type /** Checks if a given user has a specified grant for a given entity-type
* *
@ -118,17 +44,7 @@ public class AuthorizationGrantService {
* @param grantType the grant type to check * @param grantType the grant type to check
* @param principal an authorization Principal instance to extract the user from * @param principal an authorization Principal instance to extract the user from
* @return true if a given user has a specified grant for a given entity-type. False otherwise */ * @return true if a given user has a specified grant for a given entity-type. False otherwise */
public boolean hasTypeGrant(final EntityType entityType, final GrantType grantType, final Principal principal) { boolean hasBaseGrant(final EntityType entityType, final GrantType grantType, final Principal principal);
final SEBServerUser user = this.currentUserService.extractFromPrincipal(principal);
for (final UserRole role : user.getUserRoles()) {
final RoleTypeGrant roleTypeGrant = this.grants.get(new RoleTypeKey(entityType, role));
if (roleTypeGrant != null && roleTypeGrant.hasBasePrivilege(grantType)) {
return true;
}
}
return false;
}
/** Checks if a given user has specified grant for a given entity-instance /** Checks if a given user has specified grant for a given entity-instance
* *
@ -136,9 +52,7 @@ public class AuthorizationGrantService {
* @param grantType the grant type to check * @param grantType the grant type to check
* @param principal an authorization Principal instance to extract the user from * @param principal an authorization Principal instance to extract the user from
* @return true if a given user has a specified grant for a given entity-instance. False otherwise */ * @return true if a given user has a specified grant for a given entity-instance. False otherwise */
public boolean hasGrant(final GrantEntity entity, final GrantType grantType, final Principal principal) { boolean hasGrant(final GrantEntity entity, final GrantType grantType, final Principal principal);
return hasGrant(entity, grantType, this.currentUserService.extractFromPrincipal(principal));
}
/** Checks if a given user has specified grant for a given entity-instance /** Checks if a given user has specified grant for a given entity-instance
* *
@ -146,14 +60,7 @@ public class AuthorizationGrantService {
* @param grantType the grant type to check * @param grantType the grant type to check
* @param user a SEBServerUser instance to check grant for * @param user a SEBServerUser instance to check grant for
* @return true if a given user has a specified grant for a given entity-instance. False otherwise */ * @return true if a given user has a specified grant for a given entity-instance. False otherwise */
public boolean hasGrant(final GrantEntity entity, final GrantType grantType, final SEBServerUser user) { boolean hasGrant(final GrantEntity entity, final GrantType grantType, final SEBServerUser user);
final AuthorizationGrantRule authorizationGrantRule = getGrantRule(entity.entityType());
if (authorizationGrantRule == null) {
return false;
}
return authorizationGrantRule.hasGrant(entity, user, grantType);
}
/** Closure to get a grant check predicate to filter a several entity-instances within the same grant /** Closure to get a grant check predicate to filter a several entity-instances within the same grant
* *
@ -161,13 +68,10 @@ public class AuthorizationGrantService {
* @param grantType the GrantType for the grant check filter * @param grantType the GrantType for the grant check filter
* @param principal an authorization Principal instance to extract the user from * @param principal an authorization Principal instance to extract the user from
* @return A filter predicate working on the given attributes to check user grants */ * @return A filter predicate working on the given attributes to check user grants */
public <T extends GrantEntity> Predicate<T> getGrantFilter( <T extends GrantEntity> Predicate<T> getGrantFilter(
final EntityType entityType, final EntityType entityType,
final GrantType grantType, final GrantType grantType,
final Principal principal) { final Principal principal);
return getGrantFilter(entityType, grantType, this.currentUserService.extractFromPrincipal(principal));
}
/** Closure to get a grant check predicate to filter a several entity-instances within the same grant /** Closure to get a grant check predicate to filter a several entity-instances within the same grant
* *
@ -175,122 +79,9 @@ public class AuthorizationGrantService {
* @param grantType the GrantType for the grant check filter * @param grantType the GrantType for the grant check filter
* @param user a SEBServerUser instance to check grant for * @param user a SEBServerUser instance to check grant for
* @return A filter predicate working on the given attributes to check user grants */ * @return A filter predicate working on the given attributes to check user grants */
public <T extends GrantEntity> Predicate<T> getGrantFilter( <T extends GrantEntity> Predicate<T> getGrantFilter(
final EntityType entityType, final EntityType entityType,
final GrantType grantType, final GrantType grantType,
final SEBServerUser user) { final SEBServerUser user);
final AuthorizationGrantRule authorizationGrantRule = getGrantRule(entityType);
if (authorizationGrantRule == null)
return entity -> false;
return entity -> authorizationGrantRule.hasGrant(entity, user, grantType);
}
private AuthorizationGrantRule getGrantRule(final EntityType type) {
return this.exceptionalRules.computeIfAbsent(
type,
entityType -> new BaseTypeGrantRule(entityType, this));
}
private GrantRuleBuilder addGrant(final EntityType entityType) {
return new GrantRuleBuilder(entityType);
}
/** This is the default (or base) implementation of a AuthorizationGrantRule.
*
* The rule is: go over all user-roles of the given user and for each user-role check
* if there is base-privilege on the given entity-type for the given grant type.
* if true return true
* if false; check if there is a given institutional-privilege on the given
* entity-instance for the given grant type.
* if true return true
* if false; check if there is a given ownership-privilege on the given
* entity-instance for the given grant type.
* if true return true
* if false return false */
private static class BaseTypeGrantRule implements AuthorizationGrantRule {
private final EntityType type;
private final Map<UserRole, RoleTypeGrant> grants;
public BaseTypeGrantRule(final EntityType type, final AuthorizationGrantService service) {
this.type = type;
this.grants = new EnumMap<>(UserRole.class);
for (final UserRole role : UserRole.values()) {
this.grants.put(role,
service.grants.get(new RoleTypeKey(type, role)));
}
}
@Override
public EntityType entityType() {
return this.type;
}
@Override
public boolean hasGrant(final GrantEntity entity, final SEBServerUser user, final GrantType grantType) {
for (final UserRole role : user.getUserRoles()) {
final RoleTypeGrant roleTypeGrant = this.grants.get(role);
if (roleTypeGrant != null && roleTypeGrant.hasPrivilege(user, entity, grantType)) {
return true;
}
}
return false;
}
}
/** Implements a GrantRuleBuilder for internal use and to make the code more readable.
* See init (PostConstruct) */
private final class GrantRuleBuilder {
private final EntityType entityType;
private UserRole userRole;
private GrantType basePrivilege = GrantType.NONE;
private GrantType institutionalPrivilege = GrantType.NONE;
private GrantType ownerPrivilege = GrantType.NONE;
public GrantRuleBuilder(final EntityType entityType) {
super();
this.entityType = entityType;
}
public GrantRuleBuilder forRole(final UserRole userRole) {
this.userRole = userRole;
return this;
}
public GrantRuleBuilder withBasePrivilege(final GrantType basePrivilege) {
this.basePrivilege = basePrivilege;
return this;
}
public GrantRuleBuilder withInstitutionalPrivilege(final GrantType institutionalPrivilege) {
this.institutionalPrivilege = institutionalPrivilege;
return this;
}
public GrantRuleBuilder withOwnerPrivilege(final GrantType ownerPrivilege) {
this.ownerPrivilege = ownerPrivilege;
return this;
}
public GrantRuleBuilder andForRole(final UserRole userRole) {
create();
return new GrantRuleBuilder(this.entityType)
.forRole(userRole);
}
public void create() {
final RoleTypeGrant roleTypeGrant = new RoleTypeGrant(
this.basePrivilege,
this.institutionalPrivilege,
this.ownerPrivilege,
this.entityType,
this.userRole);
AuthorizationGrantService.this.grants.put(roleTypeGrant.roleTypeKey, roleTypeGrant);
}
}
} }

View file

@ -0,0 +1,280 @@
/*
* 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.webservice.servicelayer.authorization;
import java.security.Principal;
import java.util.Collection;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Predicate;
import javax.annotation.PostConstruct;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.user.UserRole;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.RoleTypeGrant.RoleTypeKey;
@Lazy
@Service
@WebServiceProfile
public class AuthorizationGrantServiceImpl implements AuthorizationGrantService {
/** Map of role based grants for specified entity types. */
private final Map<RoleTypeGrant.RoleTypeKey, RoleTypeGrant> grants = new HashMap<>();
/** Map of collected AuthorizationGrantRule exceptions */
private final Map<EntityType, AuthorizationGrantRule> exceptionalRules =
new EnumMap<>(EntityType.class);
private final UserService userService;
public AuthorizationGrantServiceImpl(
final Collection<AuthorizationGrantRule> exceptionalGrantRules,
final UserService userService) {
this.userService = userService;
if (exceptionalGrantRules != null) {
exceptionalGrantRules.stream()
.forEach(r -> this.exceptionalRules.put(r.entityType(), r));
}
}
/** Initialize the (hard-coded) grants */
@PostConstruct
public void init() {
// grants for institution
addGrant(EntityType.INSTITUTION)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.MODIFY)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.EXAM_SUPPORTER)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.create();
// grants for lms setup
addGrant(EntityType.LMS_SETUP)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.MODIFY)
.andForRole(UserRole.EXAM_SUPPORTER)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.create();
// grants for user account
addGrant(EntityType.USER)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.WRITE)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_ADMIN)
.andForRole(UserRole.EXAM_SUPPORTER)
.create();
// grants for exam
addGrant(EntityType.EXAM)
.forRole(UserRole.SEB_SERVER_ADMIN)
.withBasePrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.andForRole(UserRole.EXAM_ADMIN)
.withInstitutionalPrivilege(GrantType.READ_ONLY)
.withOwnerPrivilege(GrantType.WRITE)
.andForRole(UserRole.EXAM_SUPPORTER)
.withOwnerPrivilege(GrantType.MODIFY)
.create();
// TODO other entities
}
@Override
public <E extends GrantEntity> Result<E> checkGrantForEntity(
final E entity,
final GrantType grantType,
final Principal principal) {
if (hasGrant(entity, grantType, principal)) {
return Result.of(entity);
} else {
return Result.ofError(new PermissionDeniedException(entity, grantType, principal.getName()));
}
}
@Override
public boolean hasBaseGrant(
final EntityType entityType,
final GrantType grantType,
final Principal principal) {
final SEBServerUser user = this.userService.extractFromPrincipal(principal);
for (final UserRole role : user.getUserRoles()) {
final RoleTypeGrant roleTypeGrant = this.grants.get(new RoleTypeKey(entityType, role));
if (roleTypeGrant != null && roleTypeGrant.hasBasePrivilege(grantType)) {
return true;
}
}
return false;
}
@Override
public boolean hasGrant(final GrantEntity entity, final GrantType grantType, final Principal principal) {
return hasGrant(entity, grantType, this.userService.extractFromPrincipal(principal));
}
@Override
public boolean hasGrant(final GrantEntity entity, final GrantType grantType, final SEBServerUser user) {
final AuthorizationGrantRule authorizationGrantRule = getGrantRule(entity.entityType());
if (authorizationGrantRule == null) {
return false;
}
return authorizationGrantRule.hasGrant(entity, user, grantType);
}
@Override
public <T extends GrantEntity> Predicate<T> getGrantFilter(
final EntityType entityType,
final GrantType grantType,
final Principal principal) {
return getGrantFilter(entityType, grantType, this.userService.extractFromPrincipal(principal));
}
@Override
public <T extends GrantEntity> Predicate<T> getGrantFilter(
final EntityType entityType,
final GrantType grantType,
final SEBServerUser user) {
final AuthorizationGrantRule authorizationGrantRule = getGrantRule(entityType);
if (authorizationGrantRule == null)
return entity -> false;
return entity -> authorizationGrantRule.hasGrant(entity, user, grantType);
}
private AuthorizationGrantRule getGrantRule(final EntityType type) {
return this.exceptionalRules.computeIfAbsent(
type,
entityType -> new BaseTypeGrantRule(entityType, this));
}
private GrantRuleBuilder addGrant(final EntityType entityType) {
return new GrantRuleBuilder(entityType);
}
/** This is the default (or base) implementation of a AuthorizationGrantRule.
*
* The rule is: go over all user-roles of the given user and for each user-role check
* if there is base-privilege on the given entity-type for the given grant type.
* if true return true
* if false; check if there is a given institutional-privilege on the given
* entity-instance for the given grant type.
* if true return true
* if false; check if there is a given ownership-privilege on the given
* entity-instance for the given grant type.
* if true return true
* if false return false */
private static class BaseTypeGrantRule implements AuthorizationGrantRule {
private final EntityType type;
private final Map<UserRole, RoleTypeGrant> grants;
public BaseTypeGrantRule(final EntityType type, final AuthorizationGrantServiceImpl service) {
this.type = type;
this.grants = new EnumMap<>(UserRole.class);
for (final UserRole role : UserRole.values()) {
this.grants.put(role,
service.grants.get(new RoleTypeKey(type, role)));
}
}
@Override
public EntityType entityType() {
return this.type;
}
@Override
public boolean hasGrant(final GrantEntity entity, final SEBServerUser user, final GrantType grantType) {
for (final UserRole role : user.getUserRoles()) {
final RoleTypeGrant roleTypeGrant = this.grants.get(role);
if (roleTypeGrant != null && roleTypeGrant.hasPrivilege(user, entity, grantType)) {
return true;
}
}
return false;
}
}
/** Implements a GrantRuleBuilder for internal use and to make the code more readable.
* See init (PostConstruct) */
private final class GrantRuleBuilder {
private final EntityType entityType;
private UserRole userRole;
private GrantType basePrivilege = GrantType.NONE;
private GrantType institutionalPrivilege = GrantType.NONE;
private GrantType ownerPrivilege = GrantType.NONE;
public GrantRuleBuilder(final EntityType entityType) {
super();
this.entityType = entityType;
}
public GrantRuleBuilder forRole(final UserRole userRole) {
this.userRole = userRole;
return this;
}
public GrantRuleBuilder withBasePrivilege(final GrantType basePrivilege) {
this.basePrivilege = basePrivilege;
return this;
}
public GrantRuleBuilder withInstitutionalPrivilege(final GrantType institutionalPrivilege) {
this.institutionalPrivilege = institutionalPrivilege;
return this;
}
public GrantRuleBuilder withOwnerPrivilege(final GrantType ownerPrivilege) {
this.ownerPrivilege = ownerPrivilege;
return this;
}
public GrantRuleBuilder andForRole(final UserRole userRole) {
create();
return new GrantRuleBuilder(this.entityType)
.forRole(userRole);
}
public void create() {
final RoleTypeGrant roleTypeGrant = new RoleTypeGrant(
this.basePrivilege,
this.institutionalPrivilege,
this.ownerPrivilege,
this.entityType,
this.userRole);
AuthorizationGrantServiceImpl.this.grants.put(roleTypeGrant.roleTypeKey, roleTypeGrant);
}
}
}

View file

@ -18,11 +18,11 @@ 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 */
Long institutionId(); 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 */
String ownerUUID(); String getOwnerUUID();
} }

View file

@ -0,0 +1,50 @@
/*
* 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.webservice.servicelayer.authorization;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
public class PermissionDeniedException extends RuntimeException {
private static final long serialVersionUID = 5333137812363042580L;
public final EntityType entityType;
public final GrantEntity entity;
public final GrantType grantType;
public final String userId;
public PermissionDeniedException(
final EntityType entityType,
final GrantType grantType,
final String userId) {
super("No grant: " + grantType + " on type: " + entityType + " for user: " + userId);
this.entityType = entityType;
this.entity = null;
this.grantType = grantType;
this.userId = userId;
}
public PermissionDeniedException(
final GrantEntity entity,
final GrantType grantType,
final String userId) {
super("No grant: " + grantType +
" on type: " + entity.entityType() +
" entity institution: " + entity.getInstitutionId() +
" entity owner: " + entity.getOwnerUUID() +
" for user: " + userId);
this.entityType = entity.entityType();
this.entity = entity;
this.grantType = grantType;
this.userId = userId;
}
}

View file

@ -79,6 +79,8 @@ public final class RoleTypeGrant {
* If the institutionalPrivilege is of type GrantType.MODIFY, the GrantType.READ_ONLY are implicitly included * If the institutionalPrivilege is of type GrantType.MODIFY, the GrantType.READ_ONLY are implicitly included
* and so on. * and so on.
* *
* If the given GrantEntity instance has no institution id (null) this returns false
*
* @param grantType the GrantType to check on institutionalPrivilege * @param grantType the GrantType to check on institutionalPrivilege
* @param user SEBServerUser instance to check institutional grant * @param user SEBServerUser instance to check institutional grant
* @param entity entity-instance to check institutional grant * @param entity entity-instance to check institutional grant
@ -88,8 +90,12 @@ public final class RoleTypeGrant {
final GrantEntity entity, final GrantEntity entity,
final GrantType grantType) { final GrantType grantType) {
if (entity.getInstitutionId() == null) {
return false;
}
return this.institutionalPrivilege.hasImplicit(grantType) && return this.institutionalPrivilege.hasImplicit(grantType) &&
user.institutionId().longValue() == entity.institutionId().longValue(); user.institutionId().longValue() == entity.getInstitutionId().longValue();
} }
/** Checks the ownership privilege on given grantType by using the hasImplicit /** Checks the ownership privilege on given grantType by using the hasImplicit
@ -100,6 +106,8 @@ public final class RoleTypeGrant {
* If the ownershipPrivilege is of type GrantType.MODIFY, the GrantType.READ_ONLY are implicitly included * If the ownershipPrivilege is of type GrantType.MODIFY, the GrantType.READ_ONLY are implicitly included
* and so on. * and so on.
* *
* If the given GrantEntity instance has no owner UUID (null) this returns false
*
* @param grantType the GrantType to check on ownershipPrivilege * @param grantType the GrantType to check on ownershipPrivilege
* @param user SEBServerUser instance to check ownership grant * @param user SEBServerUser instance to check ownership grant
* @param entity entity-instance to check ownership grant * @param entity entity-instance to check ownership grant
@ -109,8 +117,12 @@ public final class RoleTypeGrant {
final GrantEntity entity, final GrantEntity entity,
final GrantType grantType) { final GrantType grantType) {
if (entity.getOwnerUUID() == null) {
return false;
}
return this.ownershipPrivilege.hasImplicit(grantType) && return this.ownershipPrivilege.hasImplicit(grantType) &&
user.uuid().equals(entity.ownerUUID()); user.uuid().equals(entity.getOwnerUUID());
} }
@Override @Override

View file

@ -17,11 +17,10 @@ import org.springframework.security.core.CredentialsContainer;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.util.CollectionUtils;
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.UserRole; import ch.ethz.seb.sebserver.gbl.model.user.UserRole;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.RoleRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserRecord;
/** SEBServerUser defines web-service internal user-account based authentication principal */ /** SEBServerUser defines web-service internal user-account based authentication principal */
public final class SEBServerUser implements UserDetails, CredentialsContainer { public final class SEBServerUser implements UserDetails, CredentialsContainer {
@ -34,7 +33,7 @@ public final class SEBServerUser implements UserDetails, CredentialsContainer {
private final Collection<GrantedAuthority> authorities; private final Collection<GrantedAuthority> authorities;
private final EnumSet<UserRole> userRoles; private final EnumSet<UserRole> userRoles;
SEBServerUser(final Long id, final UserInfo userInfo, final String password) { public SEBServerUser(final Long id, final UserInfo userInfo, final String password) {
this.id = id; this.id = id;
this.userInfo = userInfo; this.userInfo = userInfo;
this.password = password; this.password = password;
@ -44,10 +43,14 @@ public final class SEBServerUser implements UserDetails, CredentialsContainer {
.map(SimpleGrantedAuthority::new) .map(SimpleGrantedAuthority::new)
.collect(Collectors.toList())); .collect(Collectors.toList()));
this.userRoles = EnumSet.copyOf(userInfo.roles if (CollectionUtils.isEmpty(userInfo.roles)) {
.stream() this.userRoles = EnumSet.noneOf(UserRole.class);
.map(UserRole::valueOf) } else {
.collect(Collectors.toSet())); this.userRoles = EnumSet.copyOf(userInfo.roles
.stream()
.map(UserRole::valueOf)
.collect(Collectors.toSet()));
}
} }
@Override @Override
@ -159,19 +162,4 @@ public final class SEBServerUser implements UserDetails, CredentialsContainer {
return new SEBServerUser(user.id, UserInfo.of(user.userInfo), user.password); return new SEBServerUser(user.id, UserInfo.of(user.userInfo), user.password);
} }
/** Creates a SEBServerUser model object from given UserRecord and given collection of RoleRecord.
*
* @param record The UserRecord instance to create a SEBServerUser instance from
* @param roles Collection of RoleRecords. This can be empty or even null
* @return SEBServerUser instance from given UserRecord and RoleRecords data */
public static final SEBServerUser fromRecord(
final UserRecord record,
final Collection<RoleRecord> roles) {
return new SEBServerUser(
record.getId(),
UserInfo.fromRecord(record, roles),
record.getPassword());
}
} }

View file

@ -0,0 +1,49 @@
/*
* 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.webservice.servicelayer.authorization;
import java.security.Principal;
/** A service to get the authenticated user from current request */
public interface UserService {
/** Use this to get the current User within a request-response thread cycle.
*
* @return the SEBServerUser instance of the current request
* @throws IllegalStateException if no Authentication was found
* @throws IllegalArgumentException if fromPrincipal is not able to extract the User of the Authentication
* instance */
SEBServerUser getCurrentUser();
/** Extracts the internal SEBServerUser from a given Principal.
*
* This is attended to apply some known strategies to extract the internal user from Principal. If there is no
* internal user found on the given Principal, a IllegalArgumentException is thrown.
*
* If there is certainly a internal user within the given Principal but no strategy that finds it, this method can
* be extended with the needed strategy.
*
* @param principal
* @return internal User instance if it was found within the Principal and the existing strategies
* @throws IllegalArgumentException if no internal User can be found */
SEBServerUser extractFromPrincipal(final Principal principal);
/** Gets an overall anonymous user with no rights. This can be used to make user specific data anonymous
* so that they have only a reference to this anonymous user
*
* @return an overall anonymous user with no rights */
SEBServerUser getAnonymousUser();
/** Gets a overall super user with all rights. This can be used for background jobs that are
* not user specific but system specific.
*
* @return an overall super user with all rights */
SEBServerUser getSuperUser();
}

View file

@ -21,15 +21,15 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
/** A service to get the authenticated user from current request */
@Lazy @Lazy
@Service @Service
@WebServiceProfile @WebServiceProfile
public class CurrentUserService { public class UserServiceImpl implements UserService {
private static final Logger log = LoggerFactory.getLogger(CurrentUserService.class); private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
public interface ExtractUserFromAuthenticationStrategy { public interface ExtractUserFromAuthenticationStrategy {
SEBServerUser extract(Principal principal); SEBServerUser extract(Principal principal);
@ -37,16 +37,11 @@ public class CurrentUserService {
private final Collection<ExtractUserFromAuthenticationStrategy> extractStrategies; private final Collection<ExtractUserFromAuthenticationStrategy> extractStrategies;
public CurrentUserService(final Collection<ExtractUserFromAuthenticationStrategy> extractStrategies) { public UserServiceImpl(final Collection<ExtractUserFromAuthenticationStrategy> extractStrategies) {
this.extractStrategies = extractStrategies; this.extractStrategies = extractStrategies;
} }
/** Use this to get the current User within a request-response thread cycle. @Override
*
* @return the SEBServerUser instance of the current request
* @throws IllegalStateException if no Authentication was found
* @throws IllegalArgumentException if fromPrincipal is not able to extract the User of the Authentication
* instance */
public SEBServerUser getCurrentUser() { public SEBServerUser getCurrentUser() {
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication == null) { if (authentication == null) {
@ -56,17 +51,7 @@ public class CurrentUserService {
return extractFromPrincipal(authentication); return extractFromPrincipal(authentication);
} }
/** Extracts the internal SEBServerUser from a given Principal. @Override
*
* This is attended to apply some known strategies to extract the internal user from Principal. If there is no
* internal user found on the given Principal, a IllegalArgumentException is thrown.
*
* If there is certainly a internal user within the given Principal but no strategy that finds it, this method can
* be extended with the needed strategy.
*
* @param principal
* @return internal User instance if it was found within the Principal and the existing strategies
* @throws IllegalArgumentException if no internal User can be found */
public SEBServerUser extractFromPrincipal(final Principal principal) { public SEBServerUser extractFromPrincipal(final Principal principal) {
for (final ExtractUserFromAuthenticationStrategy extractStrategie : this.extractStrategies) { for (final ExtractUserFromAuthenticationStrategy extractStrategie : this.extractStrategies) {
try { try {
@ -82,6 +67,16 @@ public class CurrentUserService {
throw new IllegalArgumentException("Unable to extract internal user from Principal: " + principal); throw new IllegalArgumentException("Unable to extract internal user from Principal: " + principal);
} }
@Override
public SEBServerUser getAnonymousUser() {
return ANONYMOUS_USER;
}
@Override
public SEBServerUser getSuperUser() {
return SUPER_USER;
}
// 1. OAuth2Authentication strategy // 1. OAuth2Authentication strategy
@Lazy @Lazy
@Component @Component
@ -104,4 +99,14 @@ public class CurrentUserService {
} }
} }
private static final SEBServerUser SUPER_USER = new SEBServerUser(
-1L,
new UserInfo("SEB_SERVER_SUPER_USER", -1L, "superUser", "superUser", null, false, null, null, null),
null);
private static final SEBServerUser ANONYMOUS_USER = new SEBServerUser(
-1L,
new UserInfo("SEB_SERVER_ANONYMOUS_USER", -2L, "anonymous", "anonymous", null, false, null, null, null),
null);
} }

View file

@ -0,0 +1,18 @@
/*
* 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.webservice.servicelayer.dao;
import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
public interface EntityDAO<T extends Entity> {
EntityType entityType();
}

View file

@ -11,17 +11,26 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.dao;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
@ResponseStatus(HttpStatus.NOT_FOUND) @ResponseStatus(HttpStatus.NOT_FOUND)
public final class ResourceNotFoundException extends RuntimeException { public final class ResourceNotFoundException extends RuntimeException {
private static final long serialVersionUID = 8319235723086949618L; private static final long serialVersionUID = 8319235723086949618L;
public ResourceNotFoundException(final String resourceName, final String resourceId) { public final EntityType entityType;
this(resourceName, resourceId, null); public final String entityId;
public ResourceNotFoundException(final EntityType entityType, final String entityId) {
super("Resource " + entityType + " with ID: " + entityId + " not found");
this.entityType = entityType;
this.entityId = entityId;
} }
public ResourceNotFoundException(final String resourceName, final String resourceId, final Throwable cause) { public ResourceNotFoundException(final EntityType entityType, final String entityId, final Throwable cause) {
super("Resource " + resourceName + " with ID: " + resourceId + " not found", cause); super("Resource " + entityType + " with ID: " + entityId + " not found", cause);
this.entityType = entityType;
this.entityId = entityId;
} }
} }

View file

@ -0,0 +1,75 @@
/*
* 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.webservice.servicelayer.dao;
import java.util.Collection;
import java.util.function.Predicate;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserLogRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser;
public interface UserActivityLogDAO extends UserRelatedEntityDAO<UserActivityLog> {
enum ActionType {
CREATE,
MODIFY,
DEACTIVATE,
ACTIVATE,
ARCHIVE,
DELETE
}
/** Creates a user activity log entry.
*
* @param user for specified SEBServerUser instance
* @param actionType the action type
* @param entityType the entity type
* @param entityId the entity id (primary key or UUID)
* @param message an optional message */
void logUserActivity(
SEBServerUser user,
ActionType actionType,
EntityType entityType,
String entityId,
String message);
/** Creates a user activity log entry.
*
* @param user for specified SEBServerUser instance
* @param actionType the action type
* @param entityType the entity type
* @param entityId the entity id (primary key or UUID) */
default void logUserActivity(
final SEBServerUser user,
final ActionType actionType,
final EntityType entityType,
final String entityId) {
logUserActivity(user, actionType, entityType, entityId);
}
Result<Collection<UserActivityLog>> allForUser(
final String userId,
Predicate<UserLogRecord> predicate);
Result<Collection<UserActivityLog>> allBetween(
Long from,
Long to,
Predicate<UserLogRecord> predicate);
Result<Collection<UserActivityLog>> allForBetween(
String userId,
Long from,
Long to,
Predicate<UserLogRecord> predicate);
}

View file

@ -20,7 +20,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser
/** The Data Access Object for all User related data like get user data within UserInfo, /** The Data Access Object for all User related data like get user data within UserInfo,
* save and modify user related data within UserMod and get internal user principal data * save and modify user related data within UserMod and get internal user principal data
* within SEBServerUser. */ * within SEBServerUser. */
public interface UserDAO { public interface UserDAO extends EntityDAO<UserInfo> {
/** Use this to get UserInfo by database identifier /** Use this to get UserInfo by database identifier
* *
@ -58,6 +58,7 @@ public interface UserDAO {
* tests then matching predicate. So predicate filtering is not really fast * tests then matching predicate. So predicate filtering is not really fast
* If you need a fast filtering user all with UserFilter * If you need a fast filtering user all with UserFilter
* *
* @param predicate Predicate expecting instance of type UserInfo
* @return a Result of Collection of UserInfo that matches a given predicate. Or an exception result on error * @return a Result of Collection of UserInfo that matches a given predicate. Or an exception result on error
* case */ * case */
Result<Collection<UserInfo>> all(Predicate<UserInfo> predicate); Result<Collection<UserInfo>> all(Predicate<UserInfo> predicate);

View file

@ -0,0 +1,24 @@
/*
* 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.webservice.servicelayer.dao;
import java.util.Collection;
import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.util.Result;
public interface UserRelatedEntityDAO<T extends Entity> extends EntityDAO<T> {
Result<Collection<T>> getAllForUser(String userId);
Result<Integer> deleteUserReferences(final String userId);
Result<Integer> deleteUserEnities(final String userId);
}

View file

@ -0,0 +1,230 @@
/*
* 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.webservice.servicelayer.dao.impl;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.mybatis.dynamic.sql.SqlBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.gbl.model.user.UserActivityLog;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserLogRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserLogRecordMapper;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.UserLogRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.SEBServerUser;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO;
public class UserActivityLogDAOImpl implements UserActivityLogDAO {
private static final Logger log = LoggerFactory.getLogger(UserActivityLogDAOImpl.class);
private final UserLogRecordMapper userLogRecordMapper;
private final UserService currentUserService;
public UserActivityLogDAOImpl(
final UserLogRecordMapper userLogRecordMapper,
final UserService currentUserService) {
this.userLogRecordMapper = userLogRecordMapper;
this.currentUserService = currentUserService;
}
@Override
public EntityType entityType() {
return EntityType.USER_LOG;
}
@Override
@Transactional
public void logUserActivity(
final SEBServerUser user,
final ActionType actionType,
final EntityType entityType,
final String entityId,
final String message) {
try {
this.userLogRecordMapper.insert(new UserLogRecord(
null,
user.getUserInfo().uuid,
System.currentTimeMillis(),
actionType.name(),
entityType.name(),
entityId,
message));
} catch (final Throwable t) {
log.error(
"Unexpected error while trying to log user activity for user {}, action-type: {} entity-type: {} entity-id: {}",
user.getUserInfo().uuid,
actionType,
entityType,
entityId,
t);
}
}
@Override
@Transactional(readOnly = true)
public Result<Collection<UserActivityLog>> getAllForUser(final String userId) {
return allForUser(userId, model -> true);
}
@Override
@Transactional(readOnly = true)
public Result<Collection<UserActivityLog>> allForUser(
final String userId,
final Predicate<UserLogRecord> filter) {
try {
final List<UserLogRecord> records = this.userLogRecordMapper.selectByExample()
.where(UserLogRecordDynamicSqlSupport.userUuid, SqlBuilder.isEqualTo(userId))
.build()
.execute();
return getAllFromRecords(filter, records);
} catch (final Throwable t) {
log.error("Unexpected error while trying to get all activity logs for user with id: {}", userId);
return Result.ofError(t);
}
}
@Override
@Transactional(readOnly = true)
public Result<Collection<UserActivityLog>> allBetween(
final Long from,
final Long to,
final Predicate<UserLogRecord> predicate) {
return allForBetween(null, from, to, predicate);
}
@Override
@Transactional(readOnly = true)
public Result<Collection<UserActivityLog>> allForBetween(
final String userId,
final Long from,
final Long to,
final Predicate<UserLogRecord> predicate) {
try {
final List<UserLogRecord> records = this.userLogRecordMapper.selectByExample()
.where(UserLogRecordDynamicSqlSupport.userUuid, SqlBuilder.isEqualToWhenPresent(userId))
.and(UserLogRecordDynamicSqlSupport.timestamp, SqlBuilder.isGreaterThanOrEqualToWhenPresent(from))
.and(UserLogRecordDynamicSqlSupport.timestamp, SqlBuilder.isLessThanWhenPresent(to))
.build()
.execute();
return getAllFromRecords(predicate, records);
} catch (final Throwable t) {
log.error("Unexpected error while trying to get all activity logs in the time-frame form: {} to: {}", from,
to);
return Result.ofError(t);
}
}
@Override
@Transactional(readOnly = true)
public Result<Integer> deleteUserReferences(final String userId) {
try {
final List<UserLogRecord> records = this.userLogRecordMapper.selectByExample()
.where(UserLogRecordDynamicSqlSupport.userUuid, SqlBuilder.isEqualTo(userId))
.build()
.execute();
if (CollectionUtils.isEmpty(records)) {
return Result.of(0);
}
records
.stream()
.forEach(this::overrrideUser);
return Result.of(records.size());
} catch (final Throwable t) {
log.error(
"Unexpected error while trying to delete all user references form activity logs for user with id: {}",
userId);
return Result.ofError(t);
}
}
private void overrrideUser(final UserLogRecord record) {
final UserLogRecord selective = new UserLogRecord(
record.getId(),
this.currentUserService.getAnonymousUser().getUsername(),
null, null, null, null, null);
this.userLogRecordMapper.updateByPrimaryKeySelective(selective);
}
@Override
public Result<Integer> deleteUserEnities(final String userId) {
try {
return Result.of(this.userLogRecordMapper.deleteByExample()
.where(UserLogRecordDynamicSqlSupport.userUuid, SqlBuilder.isEqualToWhenPresent(userId))
.build()
.execute());
} catch (final Throwable t) {
log.error("Unexpected error while trying to delete all activity logs for user with id: {}", userId);
return Result.ofError(t);
}
}
private Result<Collection<UserActivityLog>> getAllFromRecords(
final Predicate<UserLogRecord> predicate,
final List<UserLogRecord> records) {
if (CollectionUtils.isEmpty(records)) {
return Result.of(Collections.emptyList());
}
return Result.of(records.stream()
.filter(predicate)
.flatMap(record -> fromRecord(record).stream())
.collect(Collectors.toList()));
}
private Result<UserActivityLog> fromRecord(final UserLogRecord record) {
try {
return Result.of(new UserActivityLog(
record.getUserUuid(),
record.getTimestamp(),
ActionType.valueOf(record.getActionType()),
EntityType.valueOf(record.getEntityType()),
record.getEntityId(),
record.getMessage()));
} catch (final Throwable t) {
log.error("Unexpected error while trying to convert UserLogRecord to UserActivityLog: ", t);
return Result.ofError(t);
}
}
}

View file

@ -13,6 +13,7 @@ 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.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.function.Predicate;
@ -21,14 +22,16 @@ import java.util.stream.Collectors;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.joda.time.DateTimeZone;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionInterceptor; import org.springframework.transaction.interceptor.TransactionInterceptor;
import org.springframework.util.CollectionUtils;
import ch.ethz.seb.sebserver.gbl.model.Domain; 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.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;
@ -63,6 +66,11 @@ public class UserDaoImpl implements UserDAO {
this.roleRecordMapper = roleRecordMapper; this.roleRecordMapper = roleRecordMapper;
} }
@Override
public EntityType entityType() {
return EntityType.USER;
}
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<UserInfo> byId(final Long id) { public Result<UserInfo> byId(final Long id) {
@ -88,30 +96,14 @@ public class UserDaoImpl implements UserDAO {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<SEBServerUser> sebServerUserByUsername(final String username) { public Result<SEBServerUser> sebServerUserByUsername(final String username) {
return recordByUsername(username) return recordByUsername(username, true)
.map(rec -> SEBServerUser.fromRecord( .flatMap(rec -> sebServerUserFromRecord(rec));
rec,
getRoles(rec)));
} }
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result<Collection<UserInfo>> allActive() { public Result<Collection<UserInfo>> allActive() {
try { return all(UserFilter.ofActive());
final List<UserRecord> records = this.userRecordMapper
.selectByExample()
.where(UserRecordDynamicSqlSupport.active, isNotEqualTo(0))
.build()
.execute();
return fromRecords(records);
} catch (final Exception e) {
final String errorMessage = "Unexpected error while trying to get all active users: ";
log.error(errorMessage, e);
return Result.ofRuntimeError(errorMessage);
}
} }
@Override @Override
@ -128,15 +120,11 @@ public class UserDaoImpl implements UserDAO {
return Result.of(Collections.emptyList()); return Result.of(Collections.emptyList());
} }
return Result.of(records.stream() return fromRecords(records, predicate);
.map(record -> UserInfo.fromRecord(record, getRoles(record)))
.filter(predicate)
.collect(Collectors.toList()));
} catch (final Exception e) { } catch (final Exception e) {
final String errorMessage = "Unexpected error while trying to get all users: "; log.error("Unexpected error while trying to get all users: ", e);
log.error(errorMessage, e); return Result.ofError(e);
return Result.ofRuntimeError(errorMessage);
} }
} }
@ -147,7 +135,7 @@ public class UserDaoImpl implements UserDAO {
final List<UserRecord> records = this.userRecordMapper.selectByExample().where( final List<UserRecord> records = this.userRecordMapper.selectByExample().where(
UserRecordDynamicSqlSupport.active, UserRecordDynamicSqlSupport.active,
isNotEqualTo(BooleanUtils.toInteger(filter.active))) isEqualTo(BooleanUtils.toInteger(filter.active)))
.and(UserRecordDynamicSqlSupport.institutionId, isEqualToWhenPresent(filter.institutionId)) .and(UserRecordDynamicSqlSupport.institutionId, isEqualToWhenPresent(filter.institutionId))
.and(UserRecordDynamicSqlSupport.name, isLikeWhenPresent(filter.name)) .and(UserRecordDynamicSqlSupport.name, isLikeWhenPresent(filter.name))
.and(UserRecordDynamicSqlSupport.userName, isLikeWhenPresent(filter.userName)) .and(UserRecordDynamicSqlSupport.userName, isLikeWhenPresent(filter.userName))
@ -155,12 +143,11 @@ public class UserDaoImpl implements UserDAO {
.build() .build()
.execute(); .execute();
return fromRecords(records); return fromRecords(records, record -> true);
} catch (final Exception e) { } catch (final Exception e) {
final String errorMessage = "Unexpected error while trying to get fitered users: "; log.error("Unexpected error while trying to get fitered users, filter: {}", filter, e);
log.error(errorMessage + " filter: {}", filter, e); return Result.ofError(e);
return Result.ofRuntimeError(errorMessage);
} }
} }
@ -194,13 +181,17 @@ public class UserDaoImpl implements UserDAO {
return Result.ofError(new RuntimeException("TODO")); return Result.ofError(new RuntimeException("TODO"));
} }
private Result<Collection<UserInfo>> fromRecords(final List<UserRecord> records) { private Result<Collection<UserInfo>> fromRecords(
if (records == null) { final List<UserRecord> records,
final Predicate<UserInfo> predicate) {
if (CollectionUtils.isEmpty(records)) {
return Result.of(Collections.emptyList()); return Result.of(Collections.emptyList());
} }
return Result.of(records.stream() return Result.of(records.stream()
.map(record -> UserInfo.fromRecord(record, getRoles(record))) .flatMap(record -> fromRecord(record).stream())
.filter(predicate)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
@ -280,11 +271,12 @@ public class UserDaoImpl implements UserDAO {
.forEach(roleRecord -> this.roleRecordMapper.insert(roleRecord)); .forEach(roleRecord -> this.roleRecordMapper.insert(roleRecord));
} }
private Result<UserRecord> recordByUsername(final String username) { private Result<UserRecord> recordByUsername(final String username, final Boolean active) {
return Utils.getSingle( return Utils.getSingle(
this.userRecordMapper this.userRecordMapper
.selectByExample() .selectByExample()
.where(UserRecordDynamicSqlSupport.userName, isEqualTo(username)) .where(UserRecordDynamicSqlSupport.userName, isEqualTo(username))
.and(UserRecordDynamicSqlSupport.active, isEqualToWhenPresent(BooleanUtils.toInteger(active)))
.build() .build()
.execute()); .execute());
} }
@ -301,11 +293,11 @@ public class UserDaoImpl implements UserDAO {
private Result<UserInfo> toDomainModel(final String nameId, final UserRecord record) { private Result<UserInfo> toDomainModel(final String nameId, final UserRecord record) {
if (record == null) { if (record == null) {
return Result.ofError(new ResourceNotFoundException( return Result.ofError(new ResourceNotFoundException(
Domain.USER.TYPE_NAME, EntityType.USER,
String.valueOf(nameId))); String.valueOf(nameId)));
} }
return Result.of(UserInfo.fromRecord(record, getRoles(record))); return fromRecord(record);
} }
private List<RoleRecord> getRoles(final UserRecord record) { private List<RoleRecord> getRoles(final UserRecord record) {
@ -316,4 +308,41 @@ public class UserDaoImpl implements UserDAO {
return roles; return roles;
} }
private Result<UserInfo> fromRecord(final UserRecord record) {
try {
final List<RoleRecord> roles = getRoles(record);
Set<String> userRoles = Collections.emptySet();
if (roles != null) {
userRoles = roles
.stream()
.map(r -> r.getRoleName())
.collect(Collectors.toSet());
}
return Result.of(new UserInfo(
record.getUuid(),
record.getInstitutionId(),
record.getName(),
record.getUserName(),
record.getEmail(),
BooleanUtils.toBooleanObject(record.getActive()),
Locale.forLanguageTag(record.getLocale()),
DateTimeZone.forID(record.getTimezone()),
userRoles));
} catch (final Exception e) {
return Result.ofError(e);
}
}
private Result<SEBServerUser> sebServerUserFromRecord(final UserRecord record) {
return fromRecord(record)
.map(userInfo -> new SEBServerUser(
record.getId(),
userInfo,
record.getPassword()));
}
} }

View file

@ -0,0 +1,85 @@
/*
* 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.webservice.weblayer.api;
import java.util.Collection;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import ch.ethz.seb.sebserver.webservice.datalayer.APIMessage;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.PermissionDeniedException;
@Order(Ordered.HIGHEST_PRECEDENCE)
@ControllerAdvice
public class APIExceptionHandler extends ResponseEntityExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(APIExceptionHandler.class);
@Override
protected ResponseEntity<Object> handleExceptionInternal(
final Exception ex,
final Object body,
final HttpHeaders headers,
final HttpStatus status,
final WebRequest request) {
log.error("Unexpected internal error catched at the API endpoint: ", ex);
return APIMessage.ErrorMessage.UNEXPECTED
.createErrorResponse(ex.getMessage());
}
@Override
protected ResponseEntity<Object> handleMethodArgumentNotValid(
final MethodArgumentNotValidException ex,
final HttpHeaders headers,
final HttpStatus status,
final WebRequest request) {
final Collection<APIMessage> valErrors = ex.getBindingResult()
.getFieldErrors()
.stream()
.map(field -> APIMessage.fieldValidationError(field))
.collect(Collectors.toList());
return new ResponseEntity<>(valErrors, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(UsernameNotFoundException.class)
public ResponseEntity<Object> handleUserNotFound(
final UsernameNotFoundException ex,
final WebRequest request) {
return APIMessage.ErrorMessage.UNAUTHORIZED
.createErrorResponse(ex.getMessage());
}
@ExceptionHandler(PermissionDeniedException.class)
public ResponseEntity<Object> handleNoPermission(
final PermissionDeniedException ex,
final WebRequest request) {
log.warn("Permission Denied Exception: ", ex);
return APIMessage.ErrorMessage.FORBIDDEN
.createErrorResponse(ex.getMessage());
}
}

View file

@ -0,0 +1,114 @@
/*
* 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.webservice.weblayer.api;
import java.security.Principal;
import java.util.Collection;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.springframework.security.core.Authentication;
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.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
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.webservice.servicelayer.authorization.AuthorizationGrantService;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.GrantType;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.UserService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO;
@RestController
@RequestMapping("/${sebserver.webservice.api.admin.endpoint}/useraccount")
public class UserAccountController {
private final UserDAO userDao;
private final AuthorizationGrantService authorizationGrantService;
private final UserService userService;
public UserAccountController(
final UserDAO userDao,
final AuthorizationGrantService authorizationGrantService,
final UserService userService) {
this.userDao = userDao;
this.authorizationGrantService = authorizationGrantService;
this.userService = userService;
}
@RequestMapping(method = RequestMethod.GET)
public Collection<UserInfo> getAll(
@RequestBody(required = false) final UserFilter filter,
final Principal principal) {
if (this.authorizationGrantService.hasBaseGrant(
EntityType.USER,
GrantType.READ_ONLY,
principal)) {
return (filter != null)
? this.userDao.all(filter).getOrThrow()
: this.userDao.allActive().getOrThrow();
} else {
final Predicate<UserInfo> grantFilter = this.authorizationGrantService.getGrantFilter(
EntityType.USER,
GrantType.READ_ONLY,
principal);
if (filter == null) {
return this.userDao
.all(grantFilter)
.getOrThrow();
} else {
return this.userDao
.all(filter)
.getOrThrow()
.stream()
.filter(grantFilter)
.collect(Collectors.toList());
}
}
}
@RequestMapping(value = "/me", method = RequestMethod.GET)
public UserInfo loggedInUser(final Authentication auth) {
return this.userService
.getCurrentUser()
.getUserInfo();
}
@RequestMapping(value = "/{userUUID}", method = RequestMethod.GET)
public UserInfo accountInfo(@PathVariable final String userUUID, final Principal principal) {
return this.userDao
.byUuid(userUUID)
.flatMap(userInfo -> this.authorizationGrantService.checkGrantForEntity(
userInfo,
GrantType.READ_ONLY,
principal))
.getOrThrow();
}
// @RequestMapping(value = "/", method = RequestMethod.POST)
// public UserInfo save(
// @PathVariable final Long institutionId,
// @RequestBody final UserFilter filter,
// final Principal principal) {
//
// }
}

View file

@ -1,9 +1,6 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Schema SEBServer -- Schema SEBServerDemo
-- ----------------------------------------------------- -- -----------------------------------------------------
DROP DATABASE IF EXISTS SEBServer;
CREATE DATABASE IF NOT EXISTS SEBServer;
use SEBServer;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `institution` -- Table `institution`
@ -14,6 +11,7 @@ CREATE TABLE IF NOT EXISTS `institution` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL, `name` VARCHAR(255) NOT NULL,
`authType` VARCHAR(45) NOT NULL, `authType` VARCHAR(45) NOT NULL,
`active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE INDEX `name_UNIQUE` (`name` ASC)) UNIQUE INDEX `name_UNIQUE` (`name` ASC))
; ;
@ -35,6 +33,7 @@ CREATE TABLE IF NOT EXISTS `lms_setup` (
`lms_rest_api_token` VARCHAR(4000) NULL, `lms_rest_api_token` VARCHAR(4000) NULL,
`seb_clientname` VARCHAR(255) NOT NULL, `seb_clientname` VARCHAR(255) NOT NULL,
`seb_clientsecret` VARCHAR(255) NOT NULL, `seb_clientsecret` VARCHAR(255) NOT NULL,
`active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `setupInstitutionRef_idx` (`institution_id` ASC), INDEX `setupInstitutionRef_idx` (`institution_id` ASC),
CONSTRAINT `setupInstitutionRef` CONSTRAINT `setupInstitutionRef`
@ -52,17 +51,25 @@ DROP TABLE IF EXISTS `exam` ;
CREATE TABLE IF NOT EXISTS `exam` ( CREATE TABLE IF NOT EXISTS `exam` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`institution_id` BIGINT UNSIGNED NOT NULL,
`lms_setup_id` BIGINT UNSIGNED NOT NULL, `lms_setup_id` BIGINT UNSIGNED NOT NULL,
`external_uuid` VARCHAR(255) NOT NULL, `external_uuid` VARCHAR(255) NOT NULL,
`owner` VARCHAR(255) NOT NULL, `owner` VARCHAR(255) NOT NULL,
`supporter` VARCHAR(4000) NULL COMMENT 'comma separated list of user_uuid', `supporter` VARCHAR(4000) NULL COMMENT 'comma separated list of user_uuid',
`type` VARCHAR(45) NOT NULL, `type` VARCHAR(45) NOT NULL,
`active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `lms_setup_key_idx` (`lms_setup_id` ASC), INDEX `lms_setup_key_idx` (`lms_setup_id` ASC),
CONSTRAINT `lms_setup_key` INDEX `institution_key_idx` (`institution_id` ASC),
CONSTRAINT `examLmsSetupRef`
FOREIGN KEY (`lms_setup_id`) FOREIGN KEY (`lms_setup_id`)
REFERENCES `lms_setup` (`id`) REFERENCES `lms_setup` (`id`)
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `examInstitutionRef`
FOREIGN KEY (`institution_id`)
REFERENCES `institution` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
; ;
@ -148,6 +155,7 @@ CREATE TABLE IF NOT EXISTS `configuration_node` (
`description` VARCHAR(4000) NULL, `description` VARCHAR(4000) NULL,
`type` VARCHAR(45) NULL, `type` VARCHAR(45) NULL,
`template` VARCHAR(255) NULL, `template` VARCHAR(255) NULL,
`active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `configurationInstitutionRef_idx` (`institution_id` ASC), INDEX `configurationInstitutionRef_idx` (`institution_id` ASC),
CONSTRAINT `configurationInstitutionRef` CONSTRAINT `configurationInstitutionRef`
@ -295,9 +303,9 @@ CREATE TABLE IF NOT EXISTS `user` (
`user_name` VARCHAR(255) NOT NULL, `user_name` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL, `password` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL, `email` VARCHAR(255) NOT NULL,
`active` INT(1) NOT NULL,
`locale` VARCHAR(45) NOT NULL, `locale` VARCHAR(45) NOT NULL,
`timeZone` VARCHAR(45) NOT NULL, `timeZone` VARCHAR(45) NOT NULL,
`active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `institutionRef_idx` (`institution_id` ASC), INDEX `institutionRef_idx` (`institution_id` ASC),
CONSTRAINT `institutionRef` CONSTRAINT `institutionRef`
@ -390,5 +398,3 @@ CREATE TABLE IF NOT EXISTS `user_log` (
`message` VARCHAR(255) NULL, `message` VARCHAR(255) NULL,
PRIMARY KEY (`id`)) PRIMARY KEY (`id`))
; ;

View file

@ -0,0 +1,57 @@
/*
* 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 static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import org.junit.Test;
import ch.ethz.seb.sebserver.gbl.JSONMapper;
import ch.ethz.seb.sebserver.gbl.model.EntityType;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserActivityLogDAO.ActionType;
public class UserActivityLogTest {
private final JSONMapper jsonMapper = new JSONMapper();
@Test
public void testFromToJson() throws IOException {
final UserActivityLog testModel = new UserActivityLog(
"testUser",
123l,
ActionType.CREATE,
EntityType.EXAM,
"321",
"noComment");
final String jsonValue = this.jsonMapper.writeValueAsString(testModel);
assertEquals(
"{\"userId\":\"testUser\","
+ "\"timestamp\":123,"
+ "\"actionType\":\"CREATE\","
+ "\"entityType\":\"EXAM\","
+ "\"entityId\":\"321\","
+ "\"message\":\"noComment\"}",
jsonValue);
final UserActivityLog deserialized = this.jsonMapper.readValue(jsonValue, UserActivityLog.class);
assertNotNull(deserialized);
assertEquals(testModel.userId, deserialized.userId);
assertEquals(testModel.timestamp, deserialized.timestamp);
assertEquals(testModel.actionType, deserialized.actionType);
assertEquals(testModel.entityType, deserialized.entityType);
assertEquals(testModel.entityId, deserialized.entityId);
assertEquals(testModel.message, deserialized.message);
}
}

View file

@ -8,15 +8,12 @@
package ch.ethz.seb.sebserver.webservice.integration.api; package ch.ethz.seb.sebserver.webservice.integration.api;
import static org.junit.Assert.assertEquals;
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.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.Before; import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -25,6 +22,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.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.jdbc.Sql;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.ResultActions;
@ -42,14 +40,14 @@ import ch.ethz.seb.sebserver.gbl.JSONMapper;
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("test") @ActiveProfiles("test")
@AutoConfigureMockMvc @AutoConfigureMockMvc
public class AdministrationAPIIntegrationTest { public abstract class AdministrationAPIIntegrationTest {
@Value("${sebserver.webservice.api.admin.clientId}") @Value("${sebserver.webservice.api.admin.clientId}")
private String clientId; protected String clientId;
@Value("${sebserver.webservice.api.admin.clientSecret}") @Value("${sebserver.webservice.api.admin.clientSecret}")
private String clientSecret; protected String clientSecret;
@Value("${sebserver.webservice.api.admin.endpoint}") @Value("${sebserver.webservice.api.admin.endpoint}")
private String endpoint; protected String endpoint;
@Autowired @Autowired
protected WebApplicationContext wac; protected WebApplicationContext wac;
@ -61,6 +59,7 @@ public class AdministrationAPIIntegrationTest {
protected MockMvc mockMvc; protected MockMvc mockMvc;
@Before @Before
@Sql(scripts = { "classpath:schema-test.sql", "classpath:data-test.sql" })
public void setup() { public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac)
.addFilter(this.springSecurityFilterChain).build(); .addFilter(this.springSecurityFilterChain).build();
@ -86,25 +85,16 @@ public class AdministrationAPIIntegrationTest {
return jsonParser.parseMap(resultString).get("access_token").toString(); return jsonParser.parseMap(resultString).get("access_token").toString();
} }
@Test protected String getSebAdminAccess() throws Exception {
public void getHello_givenNoToken_thenRedirect() throws Exception { return obtainAccessToken("admin", "admin");
this.mockMvc.perform(get(this.endpoint + "/hello"))
.andExpect(status().is3xxRedirection());
} }
@Test protected String getAdminInstitution1Access() throws Exception {
public void getHello_givenToken_thenOK() { return obtainAccessToken("inst1Admin", "admin");
try { }
final String accessToken = obtainAccessToken("admin", "admin");
final String contentAsString = this.mockMvc.perform(get(this.endpoint + "/hello")
.header("Authorization", "Bearer " + accessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals("Hello From Admin-Web-Service", contentAsString); protected String getAdminInstitution2Access() throws Exception {
} catch (final Exception e) { return obtainAccessToken("inst2Admin", "admin");
e.printStackTrace();
}
} }
} }

View file

@ -8,18 +8,12 @@
package ch.ethz.seb.sebserver.webservice.integration.api; package ch.ethz.seb.sebserver.webservice.integration.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
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.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.io.UnsupportedEncodingException;
import org.junit.Before; import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -45,10 +39,10 @@ import ch.ethz.seb.sebserver.gbl.JSONMapper;
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("test") @ActiveProfiles("test")
@AutoConfigureMockMvc @AutoConfigureMockMvc
public class ExamAPIIntegrationTest { public abstract class ExamAPIIntegrationTest {
@Value("${sebserver.webservice.api.exam.endpoint}") @Value("${sebserver.webservice.api.exam.endpoint}")
private String endpoint; protected String endpoint;
@Autowired @Autowired
protected WebApplicationContext wac; protected WebApplicationContext wac;
@ -88,37 +82,4 @@ public class ExamAPIIntegrationTest {
return jsonParser.parseMap(resultString).get("access_token").toString(); return jsonParser.parseMap(resultString).get("access_token").toString();
} }
@Test
public void getHello_givenNoToken_thenUnauthorized() throws Exception {
this.mockMvc.perform(get(this.endpoint + "/hello"))
.andExpect(status().isUnauthorized());
}
@Test
public void get_same_token_for_same_scope() throws Exception {
final String accessToken1 = obtainAccessToken("test", "test", "testScope");
final String accessToken2 = obtainAccessToken("test", "test", "testScope");
assertEquals(accessToken1, accessToken2);
}
@Test
public void get_different_tokens_for_different_scopes() throws Exception {
final String accessToken1 = obtainAccessToken("test", "test", "testScope1");
final String accessToken2 = obtainAccessToken("test", "test", "testScope2");
assertNotEquals(accessToken1, accessToken2);
}
@Test
public void getHello_givenToken_thenOK() throws UnsupportedEncodingException, Exception {
final String accessToken = obtainAccessToken("test", "test", "testScope");
final String contentAsString = this.mockMvc.perform(get(this.endpoint + "/hello")
.header("Authorization", "Bearer " + accessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals("Hello From Exam-Web-Service", contentAsString);
}
} }

View file

@ -0,0 +1,54 @@
/*
* 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.webservice.integration.api;
import static org.junit.Assert.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.io.UnsupportedEncodingException;
import org.junit.Test;
public class GeneralAdminAPITest extends AdministrationAPIIntegrationTest {
@Test
public void getHello_givenNoToken_thenRedirect() throws Exception {
this.mockMvc.perform(get(this.endpoint + "/hello"))
.andExpect(status().is3xxRedirection());
}
@Test
public void getHello_givenToken_thenOK() throws UnsupportedEncodingException, Exception {
final String accessToken = obtainAccessToken("admin", "admin");
final String contentAsString = this.mockMvc.perform(get(this.endpoint + "/hello")
.header("Authorization", "Bearer " + accessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals("Hello From Admin-Web-Service", contentAsString);
}
@Test
public void accessGrantedForActiveUser() throws Exception {
final String obtainAccessToken = obtainAccessToken("user1", "test");
assertNotNull(obtainAccessToken);
}
@Test
public void accessDeniedForInactiveUser() throws Exception {
try {
obtainAccessToken("deactivatedUser", "test");
fail("AssertionError expected here");
} catch (final AssertionError e) {
assertEquals("Status expected:<200> but was:<400>", e.getMessage());
}
}
}

View file

@ -0,0 +1,55 @@
/*
* 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.webservice.integration.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.io.UnsupportedEncodingException;
import org.junit.Test;
public class GeneralExamAPITest extends ExamAPIIntegrationTest {
@Test
public void getHello_givenNoToken_thenUnauthorized() throws Exception {
this.mockMvc.perform(get(this.endpoint + "/hello"))
.andExpect(status().isUnauthorized());
}
@Test
public void get_same_token_for_same_scope() throws Exception {
final String accessToken1 = obtainAccessToken("test", "test", "testScope");
final String accessToken2 = obtainAccessToken("test", "test", "testScope");
assertEquals(accessToken1, accessToken2);
}
@Test
public void get_different_tokens_for_different_scopes() throws Exception {
final String accessToken1 = obtainAccessToken("test", "test", "testScope1");
final String accessToken2 = obtainAccessToken("test", "test", "testScope2");
assertNotEquals(accessToken1, accessToken2);
}
@Test
public void getHello_givenToken_thenOK() throws UnsupportedEncodingException, Exception {
final String accessToken = obtainAccessToken("test", "test", "testScope");
final String contentAsString = this.mockMvc.perform(get(this.endpoint + "/hello")
.header("Authorization", "Bearer " + accessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals("Hello From Exam-Web-Service", contentAsString);
}
}

View file

@ -0,0 +1,147 @@
/*
* 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.webservice.integration.api;
import static org.junit.Assert.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.Collection;
import java.util.List;
import org.junit.Test;
import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
public class UserAPITest extends AdministrationAPIIntegrationTest {
@Test
public void getMyUserInfo() throws Exception {
String sebAdminAccessToken = getSebAdminAccess();
String contentAsString = this.mockMvc.perform(get(this.endpoint + "/useraccount/me")
.header("Authorization", "Bearer " + sebAdminAccessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals(
"{\"uuid\":\"1\","
+ "\"institutionId\":1,"
+ "\"name\":\"SEBAdmin\","
+ "\"userName\":\"admin\","
+ "\"email\":\"admin@nomail.nomail\","
+ "\"active\":true,"
+ "\"locale\":\"en\","
+ "\"timezone\":\"UTC\","
+ "\"userRoles\":[\"SEB_SERVER_ADMIN\"]}",
contentAsString);
sebAdminAccessToken = getAdminInstitution1Access();
contentAsString = this.mockMvc.perform(get(this.endpoint + "/useraccount/me")
.header("Authorization", "Bearer " + sebAdminAccessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals(
"{\"uuid\":\"2\","
+ "\"institutionId\":1,"
+ "\"name\":\"Institutional1 Admin\","
+ "\"userName\":\"inst1Admin\","
+ "\"email\":\"admin@nomail.nomail\","
+ "\"active\":true,"
+ "\"locale\":\"en\","
+ "\"timezone\":\"UTC\","
+ "\"userRoles\":[\"INSTITUTIONAL_ADMIN\"]}",
contentAsString);
}
@Test
public void getUserInfo() throws Exception {
final String sebAdminAccessToken = getSebAdminAccess();
String contentAsString = this.mockMvc.perform(get(this.endpoint + "/useraccount/2")
.header("Authorization", "Bearer " + sebAdminAccessToken))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertEquals(
"{\"uuid\":\"2\","
+ "\"institutionId\":1,"
+ "\"name\":\"Institutional1 Admin\","
+ "\"userName\":\"inst1Admin\","
+ "\"email\":\"admin@nomail.nomail\","
+ "\"active\":true,"
+ "\"locale\":\"en\","
+ "\"timezone\":\"UTC\","
+ "\"userRoles\":[\"INSTITUTIONAL_ADMIN\"]}",
contentAsString);
final String adminInstitution2AccessToken = getAdminInstitution2Access();
contentAsString = this.mockMvc.perform(get(this.endpoint + "/useraccount/1")
.header("Authorization", "Bearer " + adminInstitution2AccessToken))
.andExpect(status().isForbidden())
.andReturn().getResponse().getContentAsString();
assertEquals(
"{\"messageCode\":\"1001\","
+ "\"systemMessage\":\"FORBIDDEN\","
+ "\"details\":\"No grant: READ_ONLY on type: USER entity institution: 1 entity owner: null for user: inst2Admin\","
+ "\"attributes\":[]}",
contentAsString);
}
@Test
public void getAllUserInfoNoFilter() throws Exception {
String token = getSebAdminAccess();
List<UserInfo> userInfos = this.jsonMapper.readValue(
this.mockMvc.perform(get(this.endpoint + "/useraccount")
.header("Authorization", "Bearer " + token))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString(),
new TypeReference<List<UserInfo>>() {
});
// expecting all users for a SEBAdmin except inactive.
assertNotNull(userInfos);
assertTrue(userInfos.size() == 6);
assertNotNull(getUserInfo("admin", userInfos));
assertNotNull(getUserInfo("inst1Admin", userInfos));
assertNotNull(getUserInfo("examSupporter", userInfos));
assertNotNull(getUserInfo("inst2Admin", userInfos));
assertNotNull(getUserInfo("examAdmin1", userInfos));
assertNotNull(getUserInfo("user1", userInfos));
token = getAdminInstitution1Access();
userInfos = this.jsonMapper.readValue(
this.mockMvc.perform(get(this.endpoint + "/useraccount")
.header("Authorization", "Bearer " + token))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString(),
new TypeReference<List<UserInfo>>() {
});
// expecting all users of institution 1 for Institutional Admin of institution 1
assertNotNull(userInfos);
assertTrue(userInfos.size() == 3);
assertNotNull(getUserInfo("admin", userInfos));
assertNotNull(getUserInfo("inst1Admin", userInfos));
assertNotNull(getUserInfo("examSupporter", userInfos));
// TODO more tests
}
private UserInfo getUserInfo(final String name, final Collection<UserInfo> infos) {
return infos
.stream()
.filter(ui -> ui.userName.equals(name))
.findFirst()
.orElseThrow();
}
}

View file

@ -8,7 +8,8 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.authorization; package ch.ethz.seb.sebserver.webservice.servicelayer.authorization;
import static org.junit.Assert.*; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.security.Principal; import java.security.Principal;
import java.util.Arrays; import java.util.Arrays;
@ -31,26 +32,13 @@ public class AuthorizationGrantServiceTest {
@Mock @Mock
private Principal principal; private Principal principal;
@Test
@SuppressWarnings("unused")
public void testInit() {
try {
final AuthorizationGrantService service = getTestServiceWithUserWithRoles();
fail("Error expected here, user with no roles makes no sense");
} catch (final Exception e) {
}
final AuthorizationGrantService service = getTestServiceWithUserWithRoles(UserRole.SEB_SERVER_ADMIN);
}
@Test @Test
public void testInstitutionGrantsForSEB_SERVER_ADMIN() { public void testInstitutionGrantsForSEB_SERVER_ADMIN() {
final AuthorizationGrantService service = getTestServiceWithUserWithRoles(UserRole.SEB_SERVER_ADMIN); final AuthorizationGrantServiceImpl service = getTestServiceWithUserWithRoles(UserRole.SEB_SERVER_ADMIN);
assertTrue(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.READ_ONLY, this.principal)); assertTrue(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.READ_ONLY, this.principal));
assertTrue(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.MODIFY, this.principal)); assertTrue(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.MODIFY, this.principal));
assertTrue(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.WRITE, this.principal)); assertTrue(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.WRITE, this.principal));
final GrantEntity institution = entityOf(EntityType.INSTITUTION, 2L, ""); final GrantEntity institution = entityOf(EntityType.INSTITUTION, 2L, "");
@ -61,11 +49,11 @@ public class AuthorizationGrantServiceTest {
@Test @Test
public void testInstitutionGrantsForINSTITUTIONAL_ADMIN() { public void testInstitutionGrantsForINSTITUTIONAL_ADMIN() {
final AuthorizationGrantService service = getTestServiceWithUserWithRoles(UserRole.INSTITUTIONAL_ADMIN); final AuthorizationGrantServiceImpl service = getTestServiceWithUserWithRoles(UserRole.INSTITUTIONAL_ADMIN);
assertFalse(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.READ_ONLY, this.principal)); assertFalse(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.READ_ONLY, this.principal));
assertFalse(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.MODIFY, this.principal)); assertFalse(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.MODIFY, this.principal));
assertFalse(service.hasTypeGrant(EntityType.INSTITUTION, GrantType.WRITE, this.principal)); assertFalse(service.hasBaseGrant(EntityType.INSTITUTION, GrantType.WRITE, this.principal));
final GrantEntity ownInstitution = entityOf(EntityType.INSTITUTION, 1L, ""); final GrantEntity ownInstitution = entityOf(EntityType.INSTITUTION, 1L, "");
@ -98,24 +86,24 @@ public class AuthorizationGrantServiceTest {
} }
@Override @Override
public Long institutionId() { public Long getInstitutionId() {
return instId; return instId;
} }
@Override @Override
public String ownerUUID() { public String getOwnerUUID() {
return owner; return owner;
} }
}; };
} }
private AuthorizationGrantService getTestServiceWithUserWithRoles(final UserRole... roles) { private AuthorizationGrantServiceImpl getTestServiceWithUserWithRoles(final UserRole... roles) {
final SEBServerUser user = getUser(roles); final SEBServerUser user = getUser(roles);
final CurrentUserService currentUserServiceMock = Mockito.mock(CurrentUserService.class); final UserServiceImpl currentUserServiceMock = Mockito.mock(UserServiceImpl.class);
Mockito.when(currentUserServiceMock.extractFromPrincipal(this.principal)).thenReturn(user); Mockito.when(currentUserServiceMock.extractFromPrincipal(this.principal)).thenReturn(user);
final AuthorizationGrantService authorizationGrantService = new AuthorizationGrantService( final AuthorizationGrantServiceImpl authorizationGrantService = new AuthorizationGrantServiceImpl(
Collections.emptyList(), Collections.emptyList(),
currentUserServiceMock); currentUserServiceMock);
authorizationGrantService.init(); authorizationGrantService.init();

View file

@ -1,13 +1,26 @@
INSERT INTO institution VALUES INSERT INTO institution VALUES
(1, 'ETH Zürich', 'INTERNAL', 1) (1, 'Institution1', 'INTERNAL', 1),
(2, 'Institution2', 'INTERNAL', 1)
; ;
INSERT INTO user VALUES INSERT INTO user VALUES
(1, 1, 'internalDemoAdmin', 'Admin1', 'admin', '$2a$08$c2GKYEYoUVXH1Yb8GXVXVu66ltPvbZgLMcVSXRH.LgZNF/YeaYB8m', 'admin@nomail.nomail', 'en', 'UTC', 1) (1, 1, '1', 'SEBAdmin', 'admin', '$2a$08$c2GKYEYoUVXH1Yb8GXVXVu66ltPvbZgLMcVSXRH.LgZNF/YeaYB8m', 'admin@nomail.nomail', 'en', 'UTC', 1),
(2, 1, '2', 'Institutional1 Admin', 'inst1Admin', '$2a$08$c2GKYEYoUVXH1Yb8GXVXVu66ltPvbZgLMcVSXRH.LgZNF/YeaYB8m', 'admin@nomail.nomail', 'en', 'UTC', 1),
(5, 1, '5', 'Exam Supporter', 'examSupporter', '', 'admin@nomail.nomail', 'en', 'UTC', 1),
(3, 2, '3', 'Institutional1 Admin', 'inst2Admin', '$2a$08$c2GKYEYoUVXH1Yb8GXVXVu66ltPvbZgLMcVSXRH.LgZNF/YeaYB8m', 'admin@nomail.nomail', 'en', 'UTC', 1),
(4, 2, '4', 'ExamAdmin1', 'examAdmin1', '$2a$08$c2GKYEYoUVXH1Yb8GXVXVu66ltPvbZgLMcVSXRH.LgZNF/YeaYB8m', 'admin@nomail.nomail', 'en', 'UTC', 1),
(6, 2, '6', 'Deactivated', 'deactivatedUser', '$2a$08$YICtiLuceLMeY4EE3TyMGuBNt6SXmAE9HZKilzS9RP00nn4OhexBm', 'user@nomail.nomail', 'en', 'UTC', 0),
(7, 2, '7', 'User', 'user1', '$2a$08$YICtiLuceLMeY4EE3TyMGuBNt6SXmAE9HZKilzS9RP00nn4OhexBm', 'user@nomail.nomail', 'en', 'UTC', 1)
; ;
INSERT INTO user_role VALUES INSERT INTO user_role VALUES
(1, 1, 'SEB_SERVER_ADMIN') (1, 1, 'SEB_SERVER_ADMIN'),
(2, 2, 'INSTITUTIONAL_ADMIN'),
(3, 3, 'INSTITUTIONAL_ADMIN'),
(4, 4, 'EXAM_ADMIN'),
(5, 5, 'EXAM_SUPPORTER'),
(6, 6, 'EXAM_SUPPORTER'),
(7, 7, 'EXAM_SUPPORTER')
; ;

View file

@ -1,3 +1,7 @@
-- -----------------------------------------------------
-- Schema SEBServerDemo
-- -----------------------------------------------------
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `institution` -- Table `institution`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -47,6 +51,7 @@ DROP TABLE IF EXISTS `exam` ;
CREATE TABLE IF NOT EXISTS `exam` ( CREATE TABLE IF NOT EXISTS `exam` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`institution_id` BIGINT UNSIGNED NOT NULL,
`lms_setup_id` BIGINT UNSIGNED NOT NULL, `lms_setup_id` BIGINT UNSIGNED NOT NULL,
`external_uuid` VARCHAR(255) NOT NULL, `external_uuid` VARCHAR(255) NOT NULL,
`owner` VARCHAR(255) NOT NULL, `owner` VARCHAR(255) NOT NULL,
@ -55,10 +60,16 @@ CREATE TABLE IF NOT EXISTS `exam` (
`active` INT(1) NOT NULL, `active` INT(1) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `lms_setup_key_idx` (`lms_setup_id` ASC), INDEX `lms_setup_key_idx` (`lms_setup_id` ASC),
CONSTRAINT `lms_setup_key` INDEX `institution_key_idx` (`institution_id` ASC),
CONSTRAINT `examLmsSetupRef`
FOREIGN KEY (`lms_setup_id`) FOREIGN KEY (`lms_setup_id`)
REFERENCES `lms_setup` (`id`) REFERENCES `lms_setup` (`id`)
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `examInstitutionRef`
FOREIGN KEY (`institution_id`)
REFERENCES `institution` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
; ;
@ -387,4 +398,3 @@ CREATE TABLE IF NOT EXISTS `user_log` (
`message` VARCHAR(255) NULL, `message` VARCHAR(255) NULL,
PRIMARY KEY (`id`)) PRIMARY KEY (`id`))
; ;