From 0527d7cb85d286a53096062431764eb918a5dc85 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 13 Nov 2018 11:56:12 +0100 Subject: [PATCH] generated ORM code first commit version 0.1 --- .../java/ch/ethz/seb/sebserver/Constants.java | 33 +++ .../ch/ethz/seb/sebserver/model/Domain.java | 143 +++++++++++ .../ws/batis/JodaTimeTypeResolver.java | 94 +++++++ .../ws/batis/JodaTimeTypeResolverTest.java | 118 +++++++++ ...ientConnectionRecordDynamicSqlSupport.java | 58 +++++ .../mapper/ClientConnectionRecordMapper.java | 213 ++++++++++++++++ .../ClientEventRecordDynamicSqlSupport.java | 54 ++++ .../batis/mapper/ClientEventRecordMapper.java | 206 +++++++++++++++ ...ationAttributeRecordDynamicSqlSupport.java | 58 +++++ .../ConfigurationAttributeRecordMapper.java | 213 ++++++++++++++++ ...figurationNodeRecordDynamicSqlSupport.java | 53 ++++ .../mapper/ConfigurationNodeRecordMapper.java | 205 +++++++++++++++ .../ConfigurationRecordDynamicSqlSupport.java | 44 ++++ .../mapper/ConfigurationRecordMapper.java | 191 ++++++++++++++ ...igurationValueRecordDynamicSqlSupport.java | 48 ++++ .../ConfigurationValueRecordMapper.java | 197 +++++++++++++++ ...nfigurationMapRecordDynamicSqlSupport.java | 38 +++ .../ExamConfigurationMapRecordMapper.java | 181 +++++++++++++ .../mapper/ExamRecordDynamicSqlSupport.java | 48 ++++ .../ws/batis/mapper/ExamRecordMapper.java | 197 +++++++++++++++ .../IndicatorRecordDynamicSqlSupport.java | 43 ++++ .../batis/mapper/IndicatorRecordMapper.java | 189 ++++++++++++++ .../InstitutionRecordDynamicSqlSupport.java | 33 +++ .../batis/mapper/InstitutionRecordMapper.java | 173 +++++++++++++ .../OrientationRecordDynamicSqlSupport.java | 63 +++++ .../batis/mapper/OrientationRecordMapper.java | 221 ++++++++++++++++ .../mapper/RoleRecordDynamicSqlSupport.java | 33 +++ .../ws/batis/mapper/RoleRecordMapper.java | 173 +++++++++++++ .../SebLmsSetupRecordDynamicSqlSupport.java | 68 +++++ .../batis/mapper/SebLmsSetupRecordMapper.java | 229 +++++++++++++++++ .../mapper/UserRecordDynamicSqlSupport.java | 74 ++++++ .../ws/batis/mapper/UserRecordMapper.java | 239 ++++++++++++++++++ .../batis/model/ClientConnectionRecord.java | 154 +++++++++++ .../ws/batis/model/ClientEventRecord.java | 143 +++++++++++ .../model/ConfigurationAttributeRecord.java | 154 +++++++++++ .../batis/model/ConfigurationNodeRecord.java | 142 +++++++++++ .../ws/batis/model/ConfigurationRecord.java | 119 +++++++++ .../batis/model/ConfigurationValueRecord.java | 130 ++++++++++ .../model/ExamConfigurationMapRecord.java | 106 ++++++++ .../sebserver/ws/batis/model/ExamRecord.java | 130 ++++++++++ .../ws/batis/model/IndicatorRecord.java | 118 +++++++++ .../ws/batis/model/InstitutionRecord.java | 94 +++++++ .../ws/batis/model/OrientationRecord.java | 166 ++++++++++++ .../sebserver/ws/batis/model/RoleRecord.java | 94 +++++++ .../ws/batis/model/SebLmsSetupRecord.java | 178 +++++++++++++ .../sebserver/ws/batis/model/UserRecord.java | 191 ++++++++++++++ 46 files changed, 5849 insertions(+) create mode 100644 src/main/java/ch/ethz/seb/sebserver/Constants.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/model/Domain.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolver.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolverTest.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordDynamicSqlSupport.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordMapper.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientConnectionRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientEventRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationAttributeRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationNodeRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationValueRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamConfigurationMapRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/IndicatorRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/InstitutionRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/OrientationRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/RoleRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/SebLmsSetupRecord.java create mode 100644 src/main/java/ch/ethz/seb/sebserver/ws/batis/model/UserRecord.java diff --git a/src/main/java/ch/ethz/seb/sebserver/Constants.java b/src/main/java/ch/ethz/seb/sebserver/Constants.java new file mode 100644 index 00000000..be9cb6c2 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/Constants.java @@ -0,0 +1,33 @@ +/* + * 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; + +import java.util.Calendar; +import java.util.TimeZone; + +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +/** Global Constants used in SEB Server web-service as well as in web-gui component */ +public interface Constants { + + /** Calendar using the UTC time-zone */ + Calendar UTC = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + + /** Date-Time formatter without milliseconds using UTC time-zone. Pattern is yyyy-MM-dd HH:mm:ss */ + DateTimeFormatter DATE_TIME_PATTERN_UTC_NO_MILLIS = DateTimeFormat + .forPattern("yyyy-MM-dd HH:mm:ss") + .withZoneUTC(); + + /** Date-Time formatter with milliseconds using UTC time-zone. Pattern is yyyy-MM-dd HH:mm:ss.S */ + DateTimeFormatter DATE_TIME_PATTERN_UTC_MILLIS = DateTimeFormat + .forPattern("yyyy-MM-dd HH:mm:ss.S") + .withZoneUTC(); + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/model/Domain.java b/src/main/java/ch/ethz/seb/sebserver/model/Domain.java new file mode 100644 index 00000000..0b2289dc --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/model/Domain.java @@ -0,0 +1,143 @@ +package ch.ethz.seb.sebserver.model; + +import javax.annotation.Generated; + +/** Defines the global names of the domain model and domain model fields. +* This shall be used as a static overall domain model names reference within SEB Server Web-Service as well as within the integrated GUI +* This file is generated by the org.eth.demo.sebserver.gen.DomainModelNameReferencePlugin and must not be edited manually.**/ +@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2018-11-12T16:16:23.438+01:00") +interface Domain { + + interface ConfigurationAttribute { + String ENITIY_NAME = "ConfigurationAttribute"; + String ATTR_NAME = "name"; + String ATTR_TYPE = "type"; + String ATTR_PARENT_ID = "parentId"; + String ATTR_RESOURCES = "resources"; + String ATTR_VALIDATOR = "validator"; + String ATTR_DEPENDENCIES = "dependencies"; + String ATTR_DEFAULT_VALUE = "defaultValue"; + } + + interface ConfigurationValue { + String ENITIY_NAME = "ConfigurationValue"; + String ATTR_CONFIGURATION_ID = "configurationId"; + String ATTR_CONFIGURATION_ATTRIBUTE_ID = "configurationAttributeId"; + String ATTR_LIST_INDEX = "listIndex"; + String ATTR_VALUE = "value"; + } + + interface Orientation { + String ENITIY_NAME = "Orientation"; + String ATTR_CONFIG_ATTRIBUTE_ID = "configAttributeId"; + String ATTR_TEMPLATE = "template"; + String ATTR_VIEW = "view"; + String ATTR_GROUP = "group"; + String ATTR_X_POSITION = "xPosition"; + String ATTR_Y_POSITION = "yPosition"; + String ATTR_WIDTH = "width"; + String ATTR_HEIGHT = "height"; + } + + interface Configuration { + String ENITIY_NAME = "Configuration"; + String ATTR_CONFIGURATION_NODE_ID = "configurationNodeId"; + String ATTR_VERSION = "version"; + String ATTR_VERSION_DATE = "versionDate"; + String ATTR_FOLLOWUP = "followup"; + } + + interface ConfigurationNode { + String ENITIY_NAME = "ConfigurationNode"; + String ATTR_INSTITUTION_ID = "institutionId"; + String ATTR_OWNER = "owner"; + String ATTR_NAME = "name"; + String ATTR_DESCRIPTION = "description"; + String ATTR_TYPE = "type"; + String ATTR_TEMPLATE = "template"; + } + + interface ExamConfigurationMap { + String ENITIY_NAME = "ExamConfigurationMap"; + String ATTR_EXAM_ID = "examId"; + String ATTR_CONFIGURATION_NODE_ID = "configurationNodeId"; + String ATTR_USER_NAMES = "userNames"; + } + + interface Exam { + String ENITIY_NAME = "Exam"; + String ATTR_LMS_SETUP_ID = "lmsSetupId"; + String ATTR_EXTERNAL_UUID = "externalUuid"; + String ATTR_OWNER = "owner"; + String ATTR_SUPPORTER = "supporter"; + String ATTR_TYPE = "type"; + } + + interface ClientConnection { + String ENITIY_NAME = "ClientConnection"; + String ATTR_EXAM_ID = "examId"; + String ATTR_STATUS = "status"; + String ATTR_CONNECTION_TOKEN = "connectionToken"; + String ATTR_USER_NAME = "userName"; + String ATTR_VDI = "vdi"; + String ATTR_CLIENT_ADDRESS = "clientAddress"; + String ATTR_VIRTUAL_CLIENT_ADDRESS = "virtualClientAddress"; + } + + interface ClientEvent { + String ENITIY_NAME = "ClientEvent"; + String ATTR_CONNECTION_ID = "connectionId"; + String ATTR_USER_IDENTIFIER = "userIdentifier"; + String ATTR_TYPE = "type"; + String ATTR_TIMESTAMP = "timestamp"; + String ATTR_NUMERIC_VALUE = "numericValue"; + String ATTR_TEXT = "text"; + } + + interface Indicator { + String ENITIY_NAME = "Indicator"; + String ATTR_EXAM_ID = "examId"; + String ATTR_TYPE = "type"; + String ATTR_NAME = "name"; + String ATTR_COLOR = "color"; + } + + interface Institution { + String ENITIY_NAME = "Institution"; + String ATTR_NAME = "name"; + String ATTR_AUTHTYPE = "authtype"; + } + + interface SebLmsSetup { + String ENITIY_NAME = "SebLmsSetup"; + String ATTR_INSTITUTION_ID = "institutionId"; + String ATTR_NAME = "name"; + String ATTR_LMS_TYPE = "lmsType"; + String ATTR_LMS_URL = "lmsUrl"; + String ATTR_LMS_CLIENTNAME = "lmsClientname"; + String ATTR_LMS_CLIENTSECRET = "lmsClientsecret"; + String ATTR_LMS_REST_API_TOKEN = "lmsRestApiToken"; + String ATTR_SEB_CLIENTNAME = "sebClientname"; + String ATTR_SEB_CLIENTSECRET = "sebClientsecret"; + } + + interface User { + String ENITIY_NAME = "User"; + String ATTR_INSTITUTION_ID = "institutionId"; + String ATTR_UUID = "uuid"; + String ATTR_NAME = "name"; + String ATTR_USER_NAME = "userName"; + String ATTR_PASSWORD = "password"; + String ATTR_EMAIL = "email"; + String ATTR_CREATION_DATE = "creationDate"; + String ATTR_ACTIVE = "active"; + String ATTR_LOCALE = "locale"; + String ATTR_TIMEZONE = "timezone"; + } + + interface UserRole { + String ENITIY_NAME = "UserRole"; + String ATTR_USER_ID = "userId"; + String ATTR_ROLE_NAME = "roleName"; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolver.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolver.java new file mode 100644 index 00000000..e88c7bd9 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolver.java @@ -0,0 +1,94 @@ +/* + * 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.ws.batis; + +import java.sql.CallableStatement; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; + +import org.apache.ibatis.type.BaseTypeHandler; +import org.apache.ibatis.type.JdbcType; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDateTime; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ch.ethz.seb.sebserver.Constants; + +/** Joda DateTime resolver for MyBatis TIMESTAMP to DateTime conversion and vis versa. This is used to convert MyBatis + * TIMESTAMP type to Joda-Time's DateTime + * + * NOTE: The TIMESTAMP is always stored and read in UTC time-zone. */ +public class JodaTimeTypeResolver extends BaseTypeHandler { + + private static final Logger log = LoggerFactory.getLogger(JodaTimeTypeResolver.class); + + @Override + public void setNonNullParameter( + final PreparedStatement ps, + final int i, + final DateTime parameter, + final JdbcType jdbcType) throws SQLException { + + ps.setTimestamp( + i, + new Timestamp(parameter.getMillis()), + Constants.UTC); + } + + @Override + public DateTime getNullableResult(final ResultSet rs, final String columnName) throws SQLException { + return getDateTime(() -> rs.getString(columnName)); + } + + @Override + public DateTime getNullableResult(final ResultSet rs, final int columnIndex) throws SQLException { + return getDateTime(() -> rs.getString(columnIndex)); + } + + @Override + public DateTime getNullableResult(final CallableStatement cs, final int columnIndex) throws SQLException { + return getDateTime(() -> cs.getString(columnIndex)); + } + + private DateTime getDateTime(final SupplierSQLExceptionAware supplier) throws SQLException { + String dateFormattedString = supplier.get(); + + try { + // cutting milliseconds if there are some. This is needed to be able to use a general pattern + // independently from the different data-base-drivers format the date-time values + if (dateFormattedString.contains(".")) { + dateFormattedString = dateFormattedString.substring( + 0, + dateFormattedString.indexOf(".")); + } + + // NOTE: This create a DateTime in UTC time.zone with no time-zone-offset. + final LocalDateTime localDateTime = LocalDateTime.parse( + dateFormattedString, + Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS); + final DateTime dateTime = localDateTime.toDateTime(DateTimeZone.UTC); + + return dateTime; + } catch (final Exception e) { + log.error("while trying to parse LocalDateTime; value: " + dateFormattedString + " format: " + + Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS, e); + throw new RuntimeException("Failed to parse date-time from SQL string: " + dateFormattedString, e); + } + } + + @FunctionalInterface + private interface SupplierSQLExceptionAware { + T get() throws SQLException; + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolverTest.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolverTest.java new file mode 100644 index 00000000..a060a1af --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/JodaTimeTypeResolverTest.java @@ -0,0 +1,118 @@ +/* + * 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.ws.batis; + +import static org.junit.Assert.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.*; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; + +import org.apache.ibatis.type.JdbcType; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Test; +import org.mockito.Mockito; + +import ch.ethz.seb.sebserver.Constants; + +public class JodaTimeTypeResolverTest { + + @Test + public void testSetNonNullParameter() throws SQLException { + final DateTime pointInTime = new DateTime(0, DateTimeZone.UTC); + final PreparedStatement statement = Mockito.mock(PreparedStatement.class); + final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver(); + final Timestamp timestamp = new Timestamp(pointInTime.getMillis()); + + jodaTimeTypeResolver.setNonNullParameter(statement, 0, pointInTime, JdbcType.TIMESTAMP); + + Mockito.verify(statement, times(1)).setTimestamp(0, timestamp, Constants.UTC); + verify(statement, never()).setTimestamp(anyInt(), any(Timestamp.class)); + + jodaTimeTypeResolver.setNonNullParameter(statement, 0, pointInTime, JdbcType.DATE); + + Mockito.verify(statement, times(2)).setTimestamp(0, timestamp, Constants.UTC); + verify(statement, never()).setTimestamp(anyInt(), any(Timestamp.class)); + + jodaTimeTypeResolver.setNonNullParameter(statement, 0, pointInTime, JdbcType.DATETIMEOFFSET); + + Mockito.verify(statement, times(3)).setTimestamp(0, timestamp, Constants.UTC); + verify(statement, never()).setTimestamp(anyInt(), any(Timestamp.class)); + } + + @Test + public void testGetNullableResultExceptions() throws SQLException { + final String columnName = "timestamp"; + + final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver(); + + final ResultSet resultSetMock = Mockito.mock(ResultSet.class); + when(resultSetMock.getString(columnName)).thenReturn(null); + + try { + @SuppressWarnings("unused") + final DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName); + fail("Exception expected here"); + } catch (final Exception e) { + assertEquals("Failed to parse date-time from SQL string: null", e.getMessage()); + } + + } + + @Test + public void testGetNullableResultNoMillis() throws SQLException { + final String columnName = "timestamp"; + final int columnIndex = 0; + + final DateTime pointInTime = new DateTime(0, DateTimeZone.UTC); + final String pointInTimeString = pointInTime.toString(Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS); + assertEquals("1970-01-01 00:00:00", pointInTimeString); + + final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver(); + + final ResultSet resultSetMock = Mockito.mock(ResultSet.class); + when(resultSetMock.getString(columnName)).thenReturn(pointInTimeString); + when(resultSetMock.getString(columnIndex)).thenReturn(pointInTimeString); + + DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName); + assertNotNull(nullableResult); + assertEquals(pointInTimeString, nullableResult.toString(Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS)); + assertEquals(pointInTime, nullableResult); + + nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnIndex); + assertNotNull(nullableResult); + assertEquals(pointInTimeString, nullableResult.toString(Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS)); + assertEquals(pointInTime, nullableResult); + } + + @Test + public void testGetNullableResultWithMillis() throws SQLException { + final String columnName = "timestamp"; + + final DateTime pointInTime = new DateTime(0, DateTimeZone.UTC); + final String pointInTimeString = pointInTime.toString(Constants.DATE_TIME_PATTERN_UTC_MILLIS); + assertEquals("1970-01-01 00:00:00.0", pointInTimeString); + + final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver(); + + final ResultSet resultSetMock = Mockito.mock(ResultSet.class); + when(resultSetMock.getString(columnName)).thenReturn(pointInTimeString); + + final DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName); + assertNotNull(nullableResult); + assertEquals("1970-01-01 00:00:00", nullableResult.toString(Constants.DATE_TIME_PATTERN_UTC_NO_MILLIS)); + assertEquals(pointInTime, nullableResult); + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java new file mode 100644 index 00000000..76b762c6 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordDynamicSqlSupport.java @@ -0,0 +1,58 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ClientConnectionRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source Table: client_connection") + public static final ClientConnectionRecord clientConnectionRecord = new ClientConnectionRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.id") + public static final SqlColumn id = clientConnectionRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.exam_id") + public static final SqlColumn examId = clientConnectionRecord.examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.status") + public static final SqlColumn status = clientConnectionRecord.status; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.connection_token") + public static final SqlColumn connectionToken = clientConnectionRecord.connectionToken; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.user_name") + public static final SqlColumn userName = clientConnectionRecord.userName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source field: client_connection.vdi") + public static final SqlColumn vdi = clientConnectionRecord.vdi; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.536+01:00", comments="Source field: client_connection.client_address") + public static final SqlColumn clientAddress = clientConnectionRecord.clientAddress; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.536+01:00", comments="Source field: client_connection.virtual_client_address") + public static final SqlColumn virtualClientAddress = clientConnectionRecord.virtualClientAddress; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.535+01:00", comments="Source Table: client_connection") + public static final class ClientConnectionRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn examId = column("exam_id", JDBCType.BIGINT); + + public final SqlColumn status = column("status", JDBCType.VARCHAR); + + public final SqlColumn connectionToken = column("connection_token", JDBCType.VARCHAR); + + public final SqlColumn userName = column("user_name", JDBCType.VARCHAR); + + public final SqlColumn vdi = column("vdi", JDBCType.BOOLEAN); + + public final SqlColumn clientAddress = column("client_address", JDBCType.VARCHAR); + + public final SqlColumn virtualClientAddress = column("virtual_client_address", JDBCType.VARCHAR); + + public ClientConnectionRecord() { + super("client_connection"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordMapper.java new file mode 100644 index 00000000..a9317516 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientConnectionRecordMapper.java @@ -0,0 +1,213 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ClientConnectionRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ClientConnectionRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ClientConnectionRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.536+01:00", comments="Source Table: client_connection") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.536+01:00", comments="Source Table: client_connection") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.536+01:00", comments="Source Table: client_connection") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="status", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="connection_token", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="user_name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="vdi", javaType=Boolean.class, jdbcType=JdbcType.BOOLEAN), + @Arg(column="client_address", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="virtual_client_address", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ClientConnectionRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="status", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="connection_token", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="user_name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="vdi", javaType=Boolean.class, jdbcType=JdbcType.BOOLEAN), + @Arg(column="client_address", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="virtual_client_address", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(clientConnectionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, clientConnectionRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default int insert(ClientConnectionRecord record) { + return insert(SqlBuilder.insert(record) + .into(clientConnectionRecord) + .map(examId).toProperty("examId") + .map(status).toProperty("status") + .map(connectionToken).toProperty("connectionToken") + .map(userName).toProperty("userName") + .map(vdi).toProperty("vdi") + .map(clientAddress).toProperty("clientAddress") + .map(virtualClientAddress).toProperty("virtualClientAddress") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default int insertSelective(ClientConnectionRecord record) { + return insert(SqlBuilder.insert(record) + .into(clientConnectionRecord) + .map(examId).toPropertyWhenPresent("examId", record::getExamId) + .map(status).toPropertyWhenPresent("status", record::getStatus) + .map(connectionToken).toPropertyWhenPresent("connectionToken", record::getConnectionToken) + .map(userName).toPropertyWhenPresent("userName", record::getUserName) + .map(vdi).toPropertyWhenPresent("vdi", record::getVdi) + .map(clientAddress).toPropertyWhenPresent("clientAddress", record::getClientAddress) + .map(virtualClientAddress).toPropertyWhenPresent("virtualClientAddress", record::getVirtualClientAddress) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) + .from(clientConnectionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) + .from(clientConnectionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default ClientConnectionRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, examId, status, connectionToken, userName, vdi, clientAddress, virtualClientAddress) + .from(clientConnectionRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default UpdateDSL> updateByExample(ClientConnectionRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) + .set(examId).equalTo(record::getExamId) + .set(status).equalTo(record::getStatus) + .set(connectionToken).equalTo(record::getConnectionToken) + .set(userName).equalTo(record::getUserName) + .set(vdi).equalTo(record::getVdi) + .set(clientAddress).equalTo(record::getClientAddress) + .set(virtualClientAddress).equalTo(record::getVirtualClientAddress); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default UpdateDSL> updateByExampleSelective(ClientConnectionRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(status).equalToWhenPresent(record::getStatus) + .set(connectionToken).equalToWhenPresent(record::getConnectionToken) + .set(userName).equalToWhenPresent(record::getUserName) + .set(vdi).equalToWhenPresent(record::getVdi) + .set(clientAddress).equalToWhenPresent(record::getClientAddress) + .set(virtualClientAddress).equalToWhenPresent(record::getVirtualClientAddress); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default int updateByPrimaryKey(ClientConnectionRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) + .set(examId).equalTo(record::getExamId) + .set(status).equalTo(record::getStatus) + .set(connectionToken).equalTo(record::getConnectionToken) + .set(userName).equalTo(record::getUserName) + .set(vdi).equalTo(record::getVdi) + .set(clientAddress).equalTo(record::getClientAddress) + .set(virtualClientAddress).equalTo(record::getVirtualClientAddress) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.537+01:00", comments="Source Table: client_connection") + default int updateByPrimaryKeySelective(ClientConnectionRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientConnectionRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(status).equalToWhenPresent(record::getStatus) + .set(connectionToken).equalToWhenPresent(record::getConnectionToken) + .set(userName).equalToWhenPresent(record::getUserName) + .set(vdi).equalToWhenPresent(record::getVdi) + .set(clientAddress).equalToWhenPresent(record::getClientAddress) + .set(virtualClientAddress).equalToWhenPresent(record::getVirtualClientAddress) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(clientConnectionRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordDynamicSqlSupport.java new file mode 100644 index 00000000..49a7d25c --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordDynamicSqlSupport.java @@ -0,0 +1,54 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.math.BigDecimal; +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ClientEventRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source Table: client_event") + public static final ClientEventRecord clientEventRecord = new ClientEventRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.id") + public static final SqlColumn id = clientEventRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.connection_id") + public static final SqlColumn connectionId = clientEventRecord.connectionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.user_identifier") + public static final SqlColumn userIdentifier = clientEventRecord.userIdentifier; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.type") + public static final SqlColumn type = clientEventRecord.type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.timestamp") + public static final SqlColumn timestamp = clientEventRecord.timestamp; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.numeric_value") + public static final SqlColumn numericValue = clientEventRecord.numericValue; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source field: client_event.text") + public static final SqlColumn text = clientEventRecord.text; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source Table: client_event") + public static final class ClientEventRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn connectionId = column("connection_id", JDBCType.BIGINT); + + public final SqlColumn userIdentifier = column("user_identifier", JDBCType.VARCHAR); + + public final SqlColumn type = column("type", JDBCType.INTEGER); + + public final SqlColumn timestamp = column("timestamp", JDBCType.BIGINT); + + public final SqlColumn numericValue = column("numeric_value", JDBCType.DECIMAL); + + public final SqlColumn text = column("text", JDBCType.VARCHAR); + + public ClientEventRecord() { + super("client_event"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordMapper.java new file mode 100644 index 00000000..9aad9e84 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ClientEventRecordMapper.java @@ -0,0 +1,206 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ClientEventRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ClientEventRecord; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ClientEventRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="connection_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="user_identifier", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="timestamp", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="numeric_value", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL), + @Arg(column="text", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ClientEventRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="connection_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="user_identifier", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="timestamp", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="numeric_value", javaType=BigDecimal.class, jdbcType=JdbcType.DECIMAL), + @Arg(column="text", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(clientEventRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, clientEventRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + default int insert(ClientEventRecord record) { + return insert(SqlBuilder.insert(record) + .into(clientEventRecord) + .map(connectionId).toProperty("connectionId") + .map(userIdentifier).toProperty("userIdentifier") + .map(type).toProperty("type") + .map(timestamp).toProperty("timestamp") + .map(numericValue).toProperty("numericValue") + .map(text).toProperty("text") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.540+01:00", comments="Source Table: client_event") + default int insertSelective(ClientEventRecord record) { + return insert(SqlBuilder.insert(record) + .into(clientEventRecord) + .map(connectionId).toPropertyWhenPresent("connectionId", record::getConnectionId) + .map(userIdentifier).toPropertyWhenPresent("userIdentifier", record::getUserIdentifier) + .map(type).toPropertyWhenPresent("type", record::getType) + .map(timestamp).toPropertyWhenPresent("timestamp", record::getTimestamp) + .map(numericValue).toPropertyWhenPresent("numericValue", record::getNumericValue) + .map(text).toPropertyWhenPresent("text", record::getText) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) + .from(clientEventRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, connectionId, userIdentifier, type, timestamp, numericValue, text) + .from(clientEventRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default ClientEventRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, connectionId, userIdentifier, type, timestamp, numericValue, text) + .from(clientEventRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default UpdateDSL> updateByExample(ClientEventRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientEventRecord) + .set(connectionId).equalTo(record::getConnectionId) + .set(userIdentifier).equalTo(record::getUserIdentifier) + .set(type).equalTo(record::getType) + .set(timestamp).equalTo(record::getTimestamp) + .set(numericValue).equalTo(record::getNumericValue) + .set(text).equalTo(record::getText); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default UpdateDSL> updateByExampleSelective(ClientEventRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientEventRecord) + .set(connectionId).equalToWhenPresent(record::getConnectionId) + .set(userIdentifier).equalToWhenPresent(record::getUserIdentifier) + .set(type).equalToWhenPresent(record::getType) + .set(timestamp).equalToWhenPresent(record::getTimestamp) + .set(numericValue).equalToWhenPresent(record::getNumericValue) + .set(text).equalToWhenPresent(record::getText); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default int updateByPrimaryKey(ClientEventRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientEventRecord) + .set(connectionId).equalTo(record::getConnectionId) + .set(userIdentifier).equalTo(record::getUserIdentifier) + .set(type).equalTo(record::getType) + .set(timestamp).equalTo(record::getTimestamp) + .set(numericValue).equalTo(record::getNumericValue) + .set(text).equalTo(record::getText) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: client_event") + default int updateByPrimaryKeySelective(ClientEventRecord record) { + return UpdateDSL.updateWithMapper(this::update, clientEventRecord) + .set(connectionId).equalToWhenPresent(record::getConnectionId) + .set(userIdentifier).equalToWhenPresent(record::getUserIdentifier) + .set(type).equalToWhenPresent(record::getType) + .set(timestamp).equalToWhenPresent(record::getTimestamp) + .set(numericValue).equalToWhenPresent(record::getNumericValue) + .set(text).equalToWhenPresent(record::getText) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(clientEventRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java new file mode 100644 index 00000000..ffe38f9a --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordDynamicSqlSupport.java @@ -0,0 +1,58 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ConfigurationAttributeRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.386+01:00", comments="Source Table: configuration_attribute") + public static final ConfigurationAttributeRecord configurationAttributeRecord = new ConfigurationAttributeRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.390+01:00", comments="Source field: configuration_attribute.id") + public static final SqlColumn id = configurationAttributeRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.391+01:00", comments="Source field: configuration_attribute.name") + public static final SqlColumn name = configurationAttributeRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.391+01:00", comments="Source field: configuration_attribute.type") + public static final SqlColumn type = configurationAttributeRecord.type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.392+01:00", comments="Source field: configuration_attribute.parent_id") + public static final SqlColumn parentId = configurationAttributeRecord.parentId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.396+01:00", comments="Source field: configuration_attribute.resources") + public static final SqlColumn resources = configurationAttributeRecord.resources; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.397+01:00", comments="Source field: configuration_attribute.validator") + public static final SqlColumn validator = configurationAttributeRecord.validator; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.397+01:00", comments="Source field: configuration_attribute.dependencies") + public static final SqlColumn dependencies = configurationAttributeRecord.dependencies; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.398+01:00", comments="Source field: configuration_attribute.default_value") + public static final SqlColumn defaultValue = configurationAttributeRecord.defaultValue; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.390+01:00", comments="Source Table: configuration_attribute") + public static final class ConfigurationAttributeRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn type = column("type", JDBCType.VARCHAR); + + public final SqlColumn parentId = column("parent_id", JDBCType.BIGINT); + + public final SqlColumn resources = column("resources", JDBCType.VARCHAR); + + public final SqlColumn validator = column("validator", JDBCType.VARCHAR); + + public final SqlColumn dependencies = column("dependencies", JDBCType.VARCHAR); + + public final SqlColumn defaultValue = column("default_value", JDBCType.VARCHAR); + + public ConfigurationAttributeRecord() { + super("configuration_attribute"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordMapper.java new file mode 100644 index 00000000..3dae6a6f --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationAttributeRecordMapper.java @@ -0,0 +1,213 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ConfigurationAttributeRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ConfigurationAttributeRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ConfigurationAttributeRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.400+01:00", comments="Source Table: configuration_attribute") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.402+01:00", comments="Source Table: configuration_attribute") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.404+01:00", comments="Source Table: configuration_attribute") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.406+01:00", comments="Source Table: configuration_attribute") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="parent_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="resources", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="validator", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="dependencies", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="default_value", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ConfigurationAttributeRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.407+01:00", comments="Source Table: configuration_attribute") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="parent_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="resources", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="validator", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="dependencies", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="default_value", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.408+01:00", comments="Source Table: configuration_attribute") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.409+01:00", comments="Source Table: configuration_attribute") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(configurationAttributeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.409+01:00", comments="Source Table: configuration_attribute") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.410+01:00", comments="Source Table: configuration_attribute") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationAttributeRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.411+01:00", comments="Source Table: configuration_attribute") + default int insert(ConfigurationAttributeRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationAttributeRecord) + .map(name).toProperty("name") + .map(type).toProperty("type") + .map(parentId).toProperty("parentId") + .map(resources).toProperty("resources") + .map(validator).toProperty("validator") + .map(dependencies).toProperty("dependencies") + .map(defaultValue).toProperty("defaultValue") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.413+01:00", comments="Source Table: configuration_attribute") + default int insertSelective(ConfigurationAttributeRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationAttributeRecord) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(type).toPropertyWhenPresent("type", record::getType) + .map(parentId).toPropertyWhenPresent("parentId", record::getParentId) + .map(resources).toPropertyWhenPresent("resources", record::getResources) + .map(validator).toPropertyWhenPresent("validator", record::getValidator) + .map(dependencies).toPropertyWhenPresent("dependencies", record::getDependencies) + .map(defaultValue).toPropertyWhenPresent("defaultValue", record::getDefaultValue) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.414+01:00", comments="Source Table: configuration_attribute") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) + .from(configurationAttributeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.415+01:00", comments="Source Table: configuration_attribute") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, type, parentId, resources, validator, dependencies, defaultValue) + .from(configurationAttributeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.417+01:00", comments="Source Table: configuration_attribute") + default ConfigurationAttributeRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, name, type, parentId, resources, validator, dependencies, defaultValue) + .from(configurationAttributeRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.418+01:00", comments="Source Table: configuration_attribute") + default UpdateDSL> updateByExample(ConfigurationAttributeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) + .set(name).equalTo(record::getName) + .set(type).equalTo(record::getType) + .set(parentId).equalTo(record::getParentId) + .set(resources).equalTo(record::getResources) + .set(validator).equalTo(record::getValidator) + .set(dependencies).equalTo(record::getDependencies) + .set(defaultValue).equalTo(record::getDefaultValue); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.419+01:00", comments="Source Table: configuration_attribute") + default UpdateDSL> updateByExampleSelective(ConfigurationAttributeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) + .set(name).equalToWhenPresent(record::getName) + .set(type).equalToWhenPresent(record::getType) + .set(parentId).equalToWhenPresent(record::getParentId) + .set(resources).equalToWhenPresent(record::getResources) + .set(validator).equalToWhenPresent(record::getValidator) + .set(dependencies).equalToWhenPresent(record::getDependencies) + .set(defaultValue).equalToWhenPresent(record::getDefaultValue); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.420+01:00", comments="Source Table: configuration_attribute") + default int updateByPrimaryKey(ConfigurationAttributeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) + .set(name).equalTo(record::getName) + .set(type).equalTo(record::getType) + .set(parentId).equalTo(record::getParentId) + .set(resources).equalTo(record::getResources) + .set(validator).equalTo(record::getValidator) + .set(dependencies).equalTo(record::getDependencies) + .set(defaultValue).equalTo(record::getDefaultValue) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.422+01:00", comments="Source Table: configuration_attribute") + default int updateByPrimaryKeySelective(ConfigurationAttributeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationAttributeRecord) + .set(name).equalToWhenPresent(record::getName) + .set(type).equalToWhenPresent(record::getType) + .set(parentId).equalToWhenPresent(record::getParentId) + .set(resources).equalToWhenPresent(record::getResources) + .set(validator).equalToWhenPresent(record::getValidator) + .set(dependencies).equalToWhenPresent(record::getDependencies) + .set(defaultValue).equalToWhenPresent(record::getDefaultValue) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(configurationAttributeRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java new file mode 100644 index 00000000..34c7fec4 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordDynamicSqlSupport.java @@ -0,0 +1,53 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ConfigurationNodeRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source Table: configuration_node") + public static final ConfigurationNodeRecord configurationNodeRecord = new ConfigurationNodeRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.id") + public static final SqlColumn id = configurationNodeRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.institution_id") + public static final SqlColumn institutionId = configurationNodeRecord.institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.owner") + public static final SqlColumn owner = configurationNodeRecord.owner; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.name") + public static final SqlColumn name = configurationNodeRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.description") + public static final SqlColumn description = configurationNodeRecord.description; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.type") + public static final SqlColumn type = configurationNodeRecord.type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source field: configuration_node.template") + public static final SqlColumn template = configurationNodeRecord.template; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source Table: configuration_node") + public static final class ConfigurationNodeRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn institutionId = column("institution_id", JDBCType.BIGINT); + + public final SqlColumn owner = column("owner", JDBCType.VARCHAR); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn description = column("description", JDBCType.VARCHAR); + + public final SqlColumn type = column("type", JDBCType.VARCHAR); + + public final SqlColumn template = column("template", JDBCType.VARCHAR); + + public ConfigurationNodeRecord() { + super("configuration_node"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordMapper.java new file mode 100644 index 00000000..102e9a9d --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationNodeRecordMapper.java @@ -0,0 +1,205 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ConfigurationNodeRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ConfigurationNodeRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ConfigurationNodeRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="description", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="template", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ConfigurationNodeRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="description", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="template", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(configurationNodeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.524+01:00", comments="Source Table: configuration_node") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationNodeRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default int insert(ConfigurationNodeRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationNodeRecord) + .map(institutionId).toProperty("institutionId") + .map(owner).toProperty("owner") + .map(name).toProperty("name") + .map(description).toProperty("description") + .map(type).toProperty("type") + .map(template).toProperty("template") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default int insertSelective(ConfigurationNodeRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationNodeRecord) + .map(institutionId).toPropertyWhenPresent("institutionId", record::getInstitutionId) + .map(owner).toPropertyWhenPresent("owner", record::getOwner) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(description).toPropertyWhenPresent("description", record::getDescription) + .map(type).toPropertyWhenPresent("type", record::getType) + .map(template).toPropertyWhenPresent("template", record::getTemplate) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template) + .from(configurationNodeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, owner, name, description, type, template) + .from(configurationNodeRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default ConfigurationNodeRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, owner, name, description, type, template) + .from(configurationNodeRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default UpdateDSL> updateByExample(ConfigurationNodeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(owner).equalTo(record::getOwner) + .set(name).equalTo(record::getName) + .set(description).equalTo(record::getDescription) + .set(type).equalTo(record::getType) + .set(template).equalTo(record::getTemplate); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default UpdateDSL> updateByExampleSelective(ConfigurationNodeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(owner).equalToWhenPresent(record::getOwner) + .set(name).equalToWhenPresent(record::getName) + .set(description).equalToWhenPresent(record::getDescription) + .set(type).equalToWhenPresent(record::getType) + .set(template).equalToWhenPresent(record::getTemplate); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default int updateByPrimaryKey(ConfigurationNodeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(owner).equalTo(record::getOwner) + .set(name).equalTo(record::getName) + .set(description).equalTo(record::getDescription) + .set(type).equalTo(record::getType) + .set(template).equalTo(record::getTemplate) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: configuration_node") + default int updateByPrimaryKeySelective(ConfigurationNodeRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationNodeRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(owner).equalToWhenPresent(record::getOwner) + .set(name).equalToWhenPresent(record::getName) + .set(description).equalToWhenPresent(record::getDescription) + .set(type).equalToWhenPresent(record::getType) + .set(template).equalToWhenPresent(record::getTemplate) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(configurationNodeRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordDynamicSqlSupport.java new file mode 100644 index 00000000..f72b42b7 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordDynamicSqlSupport.java @@ -0,0 +1,44 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.joda.time.DateTime; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ConfigurationRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source Table: configuration") + public static final ConfigurationRecord configurationRecord = new ConfigurationRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.517+01:00", comments="Source field: configuration.id") + public static final SqlColumn id = configurationRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.517+01:00", comments="Source field: configuration.configuration_node_id") + public static final SqlColumn configurationNodeId = configurationRecord.configurationNodeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.517+01:00", comments="Source field: configuration.version") + public static final SqlColumn version = configurationRecord.version; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.518+01:00", comments="Source field: configuration.version_date") + public static final SqlColumn versionDate = configurationRecord.versionDate; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.518+01:00", comments="Source field: configuration.followup") + public static final SqlColumn followup = configurationRecord.followup; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.516+01:00", comments="Source Table: configuration") + public static final class ConfigurationRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn configurationNodeId = column("configuration_node_id", JDBCType.BIGINT); + + public final SqlColumn version = column("version", JDBCType.VARCHAR); + + public final SqlColumn versionDate = column("version_date", JDBCType.TIMESTAMP, "ch.ethz.seb.sebserver.ws.batis.JodaTimeTypeResolver"); + + public final SqlColumn followup = column("followup", JDBCType.INTEGER); + + public ConfigurationRecord() { + super("configuration"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordMapper.java new file mode 100644 index 00000000..0f029500 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationRecordMapper.java @@ -0,0 +1,191 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ConfigurationRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.JodaTimeTypeResolver; +import ch.ethz.seb.sebserver.ws.batis.model.ConfigurationRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.joda.time.DateTime; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ConfigurationRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.519+01:00", comments="Source Table: configuration") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.519+01:00", comments="Source Table: configuration") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.519+01:00", comments="Source Table: configuration") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.519+01:00", comments="Source Table: configuration") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="configuration_node_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="version", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="version_date", javaType=DateTime.class, typeHandler=JodaTimeTypeResolver.class, jdbcType=JdbcType.TIMESTAMP), + @Arg(column="followup", javaType=Integer.class, jdbcType=JdbcType.INTEGER) + }) + ConfigurationRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.519+01:00", comments="Source Table: configuration") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="configuration_node_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="version", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="version_date", javaType=DateTime.class, typeHandler=JodaTimeTypeResolver.class, jdbcType=JdbcType.TIMESTAMP), + @Arg(column="followup", javaType=Integer.class, jdbcType=JdbcType.INTEGER) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(configurationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default int insert(ConfigurationRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationRecord) + .map(configurationNodeId).toProperty("configurationNodeId") + .map(version).toProperty("version") + .map(versionDate).toProperty("versionDate") + .map(followup).toProperty("followup") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default int insertSelective(ConfigurationRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationRecord) + .map(configurationNodeId).toPropertyWhenPresent("configurationNodeId", record::getConfigurationNodeId) + .map(version).toPropertyWhenPresent("version", record::getVersion) + .map(versionDate).toPropertyWhenPresent("versionDate", record::getVersionDate) + .map(followup).toPropertyWhenPresent("followup", record::getFollowup) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) + .from(configurationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.520+01:00", comments="Source Table: configuration") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationNodeId, version, versionDate, followup) + .from(configurationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.521+01:00", comments="Source Table: configuration") + default ConfigurationRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, configurationNodeId, version, versionDate, followup) + .from(configurationRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.521+01:00", comments="Source Table: configuration") + default UpdateDSL> updateByExample(ConfigurationRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationRecord) + .set(configurationNodeId).equalTo(record::getConfigurationNodeId) + .set(version).equalTo(record::getVersion) + .set(versionDate).equalTo(record::getVersionDate) + .set(followup).equalTo(record::getFollowup); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.521+01:00", comments="Source Table: configuration") + default UpdateDSL> updateByExampleSelective(ConfigurationRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationRecord) + .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) + .set(version).equalToWhenPresent(record::getVersion) + .set(versionDate).equalToWhenPresent(record::getVersionDate) + .set(followup).equalToWhenPresent(record::getFollowup); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.521+01:00", comments="Source Table: configuration") + default int updateByPrimaryKey(ConfigurationRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationRecord) + .set(configurationNodeId).equalTo(record::getConfigurationNodeId) + .set(version).equalTo(record::getVersion) + .set(versionDate).equalTo(record::getVersionDate) + .set(followup).equalTo(record::getFollowup) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.521+01:00", comments="Source Table: configuration") + default int updateByPrimaryKeySelective(ConfigurationRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationRecord) + .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) + .set(version).equalToWhenPresent(record::getVersion) + .set(versionDate).equalToWhenPresent(record::getVersionDate) + .set(followup).equalToWhenPresent(record::getFollowup) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(configurationRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java new file mode 100644 index 00000000..f08ba5e1 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordDynamicSqlSupport.java @@ -0,0 +1,48 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ConfigurationValueRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source Table: configuration_value") + public static final ConfigurationValueRecord configurationValueRecord = new ConfigurationValueRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source field: configuration_value.id") + public static final SqlColumn id = configurationValueRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source field: configuration_value.configuration_id") + public static final SqlColumn configurationId = configurationValueRecord.configurationId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source field: configuration_value.configuration_attribute_id") + public static final SqlColumn configurationAttributeId = configurationValueRecord.configurationAttributeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source field: configuration_value.list_index") + public static final SqlColumn listIndex = configurationValueRecord.listIndex; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.498+01:00", comments="Source field: configuration_value.value") + public static final SqlColumn value = configurationValueRecord.value; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.498+01:00", comments="Source field: configuration_value.text") + public static final SqlColumn text = configurationValueRecord.text; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.497+01:00", comments="Source Table: configuration_value") + public static final class ConfigurationValueRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn configurationId = column("configuration_id", JDBCType.BIGINT); + + public final SqlColumn configurationAttributeId = column("configuration_attribute_id", JDBCType.BIGINT); + + public final SqlColumn listIndex = column("list_index", JDBCType.INTEGER); + + public final SqlColumn value = column("value", JDBCType.VARCHAR); + + public final SqlColumn text = column("text", JDBCType.CLOB); + + public ConfigurationValueRecord() { + super("configuration_value"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordMapper.java new file mode 100644 index 00000000..0c8967bc --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ConfigurationValueRecordMapper.java @@ -0,0 +1,197 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ConfigurationValueRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ConfigurationValueRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ConfigurationValueRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="configuration_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="configuration_attribute_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="list_index", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="value", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="text", javaType=String.class, jdbcType=JdbcType.CLOB) + }) + ConfigurationValueRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="configuration_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="configuration_attribute_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="list_index", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="value", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="text", javaType=String.class, jdbcType=JdbcType.CLOB) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(configurationValueRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.501+01:00", comments="Source Table: configuration_value") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, configurationValueRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default int insert(ConfigurationValueRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationValueRecord) + .map(configurationId).toProperty("configurationId") + .map(configurationAttributeId).toProperty("configurationAttributeId") + .map(listIndex).toProperty("listIndex") + .map(value).toProperty("value") + .map(text).toProperty("text") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default int insertSelective(ConfigurationValueRecord record) { + return insert(SqlBuilder.insert(record) + .into(configurationValueRecord) + .map(configurationId).toPropertyWhenPresent("configurationId", record::getConfigurationId) + .map(configurationAttributeId).toPropertyWhenPresent("configurationAttributeId", record::getConfigurationAttributeId) + .map(listIndex).toPropertyWhenPresent("listIndex", record::getListIndex) + .map(value).toPropertyWhenPresent("value", record::getValue) + .map(text).toPropertyWhenPresent("text", record::getText) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) + .from(configurationValueRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configurationId, configurationAttributeId, listIndex, value, text) + .from(configurationValueRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default ConfigurationValueRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, configurationId, configurationAttributeId, listIndex, value, text) + .from(configurationValueRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default UpdateDSL> updateByExample(ConfigurationValueRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) + .set(configurationId).equalTo(record::getConfigurationId) + .set(configurationAttributeId).equalTo(record::getConfigurationAttributeId) + .set(listIndex).equalTo(record::getListIndex) + .set(value).equalTo(record::getValue) + .set(text).equalTo(record::getText); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default UpdateDSL> updateByExampleSelective(ConfigurationValueRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) + .set(configurationId).equalToWhenPresent(record::getConfigurationId) + .set(configurationAttributeId).equalToWhenPresent(record::getConfigurationAttributeId) + .set(listIndex).equalToWhenPresent(record::getListIndex) + .set(value).equalToWhenPresent(record::getValue) + .set(text).equalToWhenPresent(record::getText); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default int updateByPrimaryKey(ConfigurationValueRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) + .set(configurationId).equalTo(record::getConfigurationId) + .set(configurationAttributeId).equalTo(record::getConfigurationAttributeId) + .set(listIndex).equalTo(record::getListIndex) + .set(value).equalTo(record::getValue) + .set(text).equalTo(record::getText) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.502+01:00", comments="Source Table: configuration_value") + default int updateByPrimaryKeySelective(ConfigurationValueRecord record) { + return UpdateDSL.updateWithMapper(this::update, configurationValueRecord) + .set(configurationId).equalToWhenPresent(record::getConfigurationId) + .set(configurationAttributeId).equalToWhenPresent(record::getConfigurationAttributeId) + .set(listIndex).equalToWhenPresent(record::getListIndex) + .set(value).equalToWhenPresent(record::getValue) + .set(text).equalToWhenPresent(record::getText) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(configurationValueRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java new file mode 100644 index 00000000..ed838dfd --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordDynamicSqlSupport.java @@ -0,0 +1,38 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ExamConfigurationMapRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source Table: exam_configuration_map") + public static final ExamConfigurationMapRecord examConfigurationMapRecord = new ExamConfigurationMapRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.id") + public static final SqlColumn id = examConfigurationMapRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.exam_id") + public static final SqlColumn examId = examConfigurationMapRecord.examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + public static final SqlColumn configurationNodeId = examConfigurationMapRecord.configurationNodeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.user_names") + public static final SqlColumn userNames = examConfigurationMapRecord.userNames; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source Table: exam_configuration_map") + public static final class ExamConfigurationMapRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn examId = column("exam_id", JDBCType.BIGINT); + + public final SqlColumn configurationNodeId = column("configuration_node_id", JDBCType.BIGINT); + + public final SqlColumn userNames = column("user_names", JDBCType.VARCHAR); + + public ExamConfigurationMapRecord() { + super("exam_configuration_map"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordMapper.java new file mode 100644 index 00000000..5a1855cd --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamConfigurationMapRecordMapper.java @@ -0,0 +1,181 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ExamConfigurationMapRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ExamConfigurationMapRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ExamConfigurationMapRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source Table: exam_configuration_map") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.527+01:00", comments="Source Table: exam_configuration_map") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.527+01:00", comments="Source Table: exam_configuration_map") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.527+01:00", comments="Source Table: exam_configuration_map") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="configuration_node_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="user_names", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ExamConfigurationMapRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.527+01:00", comments="Source Table: exam_configuration_map") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="configuration_node_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="user_names", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.527+01:00", comments="Source Table: exam_configuration_map") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(examConfigurationMapRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, examConfigurationMapRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default int insert(ExamConfigurationMapRecord record) { + return insert(SqlBuilder.insert(record) + .into(examConfigurationMapRecord) + .map(examId).toProperty("examId") + .map(configurationNodeId).toProperty("configurationNodeId") + .map(userNames).toProperty("userNames") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default int insertSelective(ExamConfigurationMapRecord record) { + return insert(SqlBuilder.insert(record) + .into(examConfigurationMapRecord) + .map(examId).toPropertyWhenPresent("examId", record::getExamId) + .map(configurationNodeId).toPropertyWhenPresent("configurationNodeId", record::getConfigurationNodeId) + .map(userNames).toPropertyWhenPresent("userNames", record::getUserNames) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) + .from(examConfigurationMapRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, configurationNodeId, userNames) + .from(examConfigurationMapRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default ExamConfigurationMapRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, examId, configurationNodeId, userNames) + .from(examConfigurationMapRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default UpdateDSL> updateByExample(ExamConfigurationMapRecord record) { + return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) + .set(examId).equalTo(record::getExamId) + .set(configurationNodeId).equalTo(record::getConfigurationNodeId) + .set(userNames).equalTo(record::getUserNames); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default UpdateDSL> updateByExampleSelective(ExamConfigurationMapRecord record) { + return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) + .set(userNames).equalToWhenPresent(record::getUserNames); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default int updateByPrimaryKey(ExamConfigurationMapRecord record) { + return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) + .set(examId).equalTo(record::getExamId) + .set(configurationNodeId).equalTo(record::getConfigurationNodeId) + .set(userNames).equalTo(record::getUserNames) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.528+01:00", comments="Source Table: exam_configuration_map") + default int updateByPrimaryKeySelective(ExamConfigurationMapRecord record) { + return UpdateDSL.updateWithMapper(this::update, examConfigurationMapRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(configurationNodeId).equalToWhenPresent(record::getConfigurationNodeId) + .set(userNames).equalToWhenPresent(record::getUserNames) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(examConfigurationMapRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordDynamicSqlSupport.java new file mode 100644 index 00000000..b8814b3c --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordDynamicSqlSupport.java @@ -0,0 +1,48 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class ExamRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.530+01:00", comments="Source Table: exam") + public static final ExamRecord examRecord = new ExamRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.530+01:00", comments="Source field: exam.id") + public static final SqlColumn id = examRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source field: exam.lms_setup_id") + public static final SqlColumn lmsSetupId = examRecord.lmsSetupId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source field: exam.external_uuid") + public static final SqlColumn externalUuid = examRecord.externalUuid; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source field: exam.owner") + public static final SqlColumn owner = examRecord.owner; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source field: exam.supporter") + public static final SqlColumn supporter = examRecord.supporter; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source field: exam.type") + public static final SqlColumn type = examRecord.type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.530+01:00", comments="Source Table: exam") + public static final class ExamRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn lmsSetupId = column("lms_setup_id", JDBCType.BIGINT); + + public final SqlColumn externalUuid = column("external_uuid", JDBCType.VARCHAR); + + public final SqlColumn owner = column("owner", JDBCType.VARCHAR); + + public final SqlColumn supporter = column("supporter", JDBCType.VARCHAR); + + public final SqlColumn type = column("type", JDBCType.VARCHAR); + + public ExamRecord() { + super("exam"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordMapper.java new file mode 100644 index 00000000..53bb356f --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/ExamRecordMapper.java @@ -0,0 +1,197 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.ExamRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.ExamRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface ExamRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source Table: exam") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source Table: exam") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.531+01:00", comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="supporter", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + ExamRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="lms_setup_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="external_uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="owner", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="supporter", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(examRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, examRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, examRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default int insert(ExamRecord record) { + return insert(SqlBuilder.insert(record) + .into(examRecord) + .map(lmsSetupId).toProperty("lmsSetupId") + .map(externalUuid).toProperty("externalUuid") + .map(owner).toProperty("owner") + .map(supporter).toProperty("supporter") + .map(type).toProperty("type") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default int insertSelective(ExamRecord record) { + return insert(SqlBuilder.insert(record) + .into(examRecord) + .map(lmsSetupId).toPropertyWhenPresent("lmsSetupId", record::getLmsSetupId) + .map(externalUuid).toPropertyWhenPresent("externalUuid", record::getExternalUuid) + .map(owner).toPropertyWhenPresent("owner", record::getOwner) + .map(supporter).toPropertyWhenPresent("supporter", record::getSupporter) + .map(type).toPropertyWhenPresent("type", record::getType) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, lmsSetupId, externalUuid, owner, supporter, type) + .from(examRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, lmsSetupId, externalUuid, owner, supporter, type) + .from(examRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default ExamRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, lmsSetupId, externalUuid, owner, supporter, type) + .from(examRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default UpdateDSL> updateByExample(ExamRecord record) { + return UpdateDSL.updateWithMapper(this::update, examRecord) + .set(lmsSetupId).equalTo(record::getLmsSetupId) + .set(externalUuid).equalTo(record::getExternalUuid) + .set(owner).equalTo(record::getOwner) + .set(supporter).equalTo(record::getSupporter) + .set(type).equalTo(record::getType); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default UpdateDSL> updateByExampleSelective(ExamRecord record) { + return UpdateDSL.updateWithMapper(this::update, examRecord) + .set(lmsSetupId).equalToWhenPresent(record::getLmsSetupId) + .set(externalUuid).equalToWhenPresent(record::getExternalUuid) + .set(owner).equalToWhenPresent(record::getOwner) + .set(supporter).equalToWhenPresent(record::getSupporter) + .set(type).equalToWhenPresent(record::getType); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.532+01:00", comments="Source Table: exam") + default int updateByPrimaryKey(ExamRecord record) { + return UpdateDSL.updateWithMapper(this::update, examRecord) + .set(lmsSetupId).equalTo(record::getLmsSetupId) + .set(externalUuid).equalTo(record::getExternalUuid) + .set(owner).equalTo(record::getOwner) + .set(supporter).equalTo(record::getSupporter) + .set(type).equalTo(record::getType) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.533+01:00", comments="Source Table: exam") + default int updateByPrimaryKeySelective(ExamRecord record) { + return UpdateDSL.updateWithMapper(this::update, examRecord) + .set(lmsSetupId).equalToWhenPresent(record::getLmsSetupId) + .set(externalUuid).equalToWhenPresent(record::getExternalUuid) + .set(owner).equalToWhenPresent(record::getOwner) + .set(supporter).equalToWhenPresent(record::getSupporter) + .set(type).equalToWhenPresent(record::getType) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(examRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordDynamicSqlSupport.java new file mode 100644 index 00000000..faee9996 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordDynamicSqlSupport.java @@ -0,0 +1,43 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class IndicatorRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source Table: indicator") + public static final IndicatorRecord indicatorRecord = new IndicatorRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.id") + public static final SqlColumn id = indicatorRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.exam_id") + public static final SqlColumn examId = indicatorRecord.examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source field: indicator.type") + public static final SqlColumn type = indicatorRecord.type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source field: indicator.name") + public static final SqlColumn name = indicatorRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source field: indicator.color") + public static final SqlColumn color = indicatorRecord.color; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source Table: indicator") + public static final class IndicatorRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn examId = column("exam_id", JDBCType.BIGINT); + + public final SqlColumn type = column("type", JDBCType.VARCHAR); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn color = column("color", JDBCType.VARCHAR); + + public IndicatorRecord() { + super("indicator"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordMapper.java new file mode 100644 index 00000000..6ae919c3 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/IndicatorRecordMapper.java @@ -0,0 +1,189 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.IndicatorRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.IndicatorRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface IndicatorRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="color", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + IndicatorRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="exam_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="color", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(indicatorRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.543+01:00", comments="Source Table: indicator") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, indicatorRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default int insert(IndicatorRecord record) { + return insert(SqlBuilder.insert(record) + .into(indicatorRecord) + .map(examId).toProperty("examId") + .map(type).toProperty("type") + .map(name).toProperty("name") + .map(color).toProperty("color") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default int insertSelective(IndicatorRecord record) { + return insert(SqlBuilder.insert(record) + .into(indicatorRecord) + .map(examId).toPropertyWhenPresent("examId", record::getExamId) + .map(type).toPropertyWhenPresent("type", record::getType) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(color).toPropertyWhenPresent("color", record::getColor) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, examId, type, name, color) + .from(indicatorRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, examId, type, name, color) + .from(indicatorRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default IndicatorRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, examId, type, name, color) + .from(indicatorRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default UpdateDSL> updateByExample(IndicatorRecord record) { + return UpdateDSL.updateWithMapper(this::update, indicatorRecord) + .set(examId).equalTo(record::getExamId) + .set(type).equalTo(record::getType) + .set(name).equalTo(record::getName) + .set(color).equalTo(record::getColor); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default UpdateDSL> updateByExampleSelective(IndicatorRecord record) { + return UpdateDSL.updateWithMapper(this::update, indicatorRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(type).equalToWhenPresent(record::getType) + .set(name).equalToWhenPresent(record::getName) + .set(color).equalToWhenPresent(record::getColor); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default int updateByPrimaryKey(IndicatorRecord record) { + return UpdateDSL.updateWithMapper(this::update, indicatorRecord) + .set(examId).equalTo(record::getExamId) + .set(type).equalTo(record::getType) + .set(name).equalTo(record::getName) + .set(color).equalTo(record::getColor) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.544+01:00", comments="Source Table: indicator") + default int updateByPrimaryKeySelective(IndicatorRecord record) { + return UpdateDSL.updateWithMapper(this::update, indicatorRecord) + .set(examId).equalToWhenPresent(record::getExamId) + .set(type).equalToWhenPresent(record::getType) + .set(name).equalToWhenPresent(record::getName) + .set(color).equalToWhenPresent(record::getColor) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(indicatorRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordDynamicSqlSupport.java new file mode 100644 index 00000000..2e8beb03 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordDynamicSqlSupport.java @@ -0,0 +1,33 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class InstitutionRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source Table: institution") + public static final InstitutionRecord institutionRecord = new InstitutionRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.id") + public static final SqlColumn id = institutionRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source field: institution.name") + public static final SqlColumn name = institutionRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source field: institution.authtype") + public static final SqlColumn authtype = institutionRecord.authtype; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source Table: institution") + public static final class InstitutionRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn authtype = column("authtype", JDBCType.VARCHAR); + + public InstitutionRecord() { + super("institution"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordMapper.java new file mode 100644 index 00000000..322a71d7 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/InstitutionRecordMapper.java @@ -0,0 +1,173 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.InstitutionRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.InstitutionRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface InstitutionRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="authtype", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + InstitutionRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="authtype", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(institutionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, institutionRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default int insert(InstitutionRecord record) { + return insert(SqlBuilder.insert(record) + .into(institutionRecord) + .map(name).toProperty("name") + .map(authtype).toProperty("authtype") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default int insertSelective(InstitutionRecord record) { + return insert(SqlBuilder.insert(record) + .into(institutionRecord) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(authtype).toPropertyWhenPresent("authtype", record::getAuthtype) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, name, authtype) + .from(institutionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, name, authtype) + .from(institutionRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default InstitutionRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, name, authtype) + .from(institutionRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.546+01:00", comments="Source Table: institution") + default UpdateDSL> updateByExample(InstitutionRecord record) { + return UpdateDSL.updateWithMapper(this::update, institutionRecord) + .set(name).equalTo(record::getName) + .set(authtype).equalTo(record::getAuthtype); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source Table: institution") + default UpdateDSL> updateByExampleSelective(InstitutionRecord record) { + return UpdateDSL.updateWithMapper(this::update, institutionRecord) + .set(name).equalToWhenPresent(record::getName) + .set(authtype).equalToWhenPresent(record::getAuthtype); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source Table: institution") + default int updateByPrimaryKey(InstitutionRecord record) { + return UpdateDSL.updateWithMapper(this::update, institutionRecord) + .set(name).equalTo(record::getName) + .set(authtype).equalTo(record::getAuthtype) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source Table: institution") + default int updateByPrimaryKeySelective(InstitutionRecord record) { + return UpdateDSL.updateWithMapper(this::update, institutionRecord) + .set(name).equalToWhenPresent(record::getName) + .set(authtype).equalToWhenPresent(record::getAuthtype) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(institutionRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordDynamicSqlSupport.java new file mode 100644 index 00000000..fd840e3a --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordDynamicSqlSupport.java @@ -0,0 +1,63 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class OrientationRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.504+01:00", comments="Source Table: orientation") + public static final OrientationRecord orientationRecord = new OrientationRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.504+01:00", comments="Source field: orientation.id") + public static final SqlColumn id = orientationRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.config_attribute_id") + public static final SqlColumn configAttributeId = orientationRecord.configAttributeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.template") + public static final SqlColumn template = orientationRecord.template; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.view") + public static final SqlColumn view = orientationRecord.view; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.group") + public static final SqlColumn group = orientationRecord.group; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.x_position") + public static final SqlColumn xPosition = orientationRecord.xPosition; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.y_position") + public static final SqlColumn yPosition = orientationRecord.yPosition; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.505+01:00", comments="Source field: orientation.width") + public static final SqlColumn width = orientationRecord.width; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source field: orientation.height") + public static final SqlColumn height = orientationRecord.height; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.504+01:00", comments="Source Table: orientation") + public static final class OrientationRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn configAttributeId = column("config_attribute_id", JDBCType.BIGINT); + + public final SqlColumn template = column("template", JDBCType.VARCHAR); + + public final SqlColumn view = column("view", JDBCType.VARCHAR); + + public final SqlColumn group = column("group", JDBCType.VARCHAR); + + public final SqlColumn xPosition = column("x_position", JDBCType.INTEGER); + + public final SqlColumn yPosition = column("y_position", JDBCType.INTEGER); + + public final SqlColumn width = column("width", JDBCType.INTEGER); + + public final SqlColumn height = column("height", JDBCType.INTEGER); + + public OrientationRecord() { + super("orientation"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordMapper.java new file mode 100644 index 00000000..8ce37438 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/OrientationRecordMapper.java @@ -0,0 +1,221 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.OrientationRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.OrientationRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface OrientationRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="config_attribute_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="template", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="view", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="group", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="x_position", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="y_position", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="width", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="height", javaType=Integer.class, jdbcType=JdbcType.INTEGER) + }) + OrientationRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="config_attribute_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="template", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="view", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="group", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="x_position", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="y_position", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="width", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="height", javaType=Integer.class, jdbcType=JdbcType.INTEGER) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(orientationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.506+01:00", comments="Source Table: orientation") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, orientationRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.507+01:00", comments="Source Table: orientation") + default int insert(OrientationRecord record) { + return insert(SqlBuilder.insert(record) + .into(orientationRecord) + .map(configAttributeId).toProperty("configAttributeId") + .map(template).toProperty("template") + .map(view).toProperty("view") + .map(group).toProperty("group") + .map(xPosition).toProperty("xPosition") + .map(yPosition).toProperty("yPosition") + .map(width).toProperty("width") + .map(height).toProperty("height") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.509+01:00", comments="Source Table: orientation") + default int insertSelective(OrientationRecord record) { + return insert(SqlBuilder.insert(record) + .into(orientationRecord) + .map(configAttributeId).toPropertyWhenPresent("configAttributeId", record::getConfigAttributeId) + .map(template).toPropertyWhenPresent("template", record::getTemplate) + .map(view).toPropertyWhenPresent("view", record::getView) + .map(group).toPropertyWhenPresent("group", record::getGroup) + .map(xPosition).toPropertyWhenPresent("xPosition", record::getxPosition) + .map(yPosition).toPropertyWhenPresent("yPosition", record::getyPosition) + .map(width).toPropertyWhenPresent("width", record::getWidth) + .map(height).toPropertyWhenPresent("height", record::getHeight) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) + .from(orientationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) + .from(orientationRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default OrientationRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, configAttributeId, template, view, group, xPosition, yPosition, width, height) + .from(orientationRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default UpdateDSL> updateByExample(OrientationRecord record) { + return UpdateDSL.updateWithMapper(this::update, orientationRecord) + .set(configAttributeId).equalTo(record::getConfigAttributeId) + .set(template).equalTo(record::getTemplate) + .set(view).equalTo(record::getView) + .set(group).equalTo(record::getGroup) + .set(xPosition).equalTo(record::getxPosition) + .set(yPosition).equalTo(record::getyPosition) + .set(width).equalTo(record::getWidth) + .set(height).equalTo(record::getHeight); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default UpdateDSL> updateByExampleSelective(OrientationRecord record) { + return UpdateDSL.updateWithMapper(this::update, orientationRecord) + .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) + .set(template).equalToWhenPresent(record::getTemplate) + .set(view).equalToWhenPresent(record::getView) + .set(group).equalToWhenPresent(record::getGroup) + .set(xPosition).equalToWhenPresent(record::getxPosition) + .set(yPosition).equalToWhenPresent(record::getyPosition) + .set(width).equalToWhenPresent(record::getWidth) + .set(height).equalToWhenPresent(record::getHeight); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default int updateByPrimaryKey(OrientationRecord record) { + return UpdateDSL.updateWithMapper(this::update, orientationRecord) + .set(configAttributeId).equalTo(record::getConfigAttributeId) + .set(template).equalTo(record::getTemplate) + .set(view).equalTo(record::getView) + .set(group).equalTo(record::getGroup) + .set(xPosition).equalTo(record::getxPosition) + .set(yPosition).equalTo(record::getyPosition) + .set(width).equalTo(record::getWidth) + .set(height).equalTo(record::getHeight) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.510+01:00", comments="Source Table: orientation") + default int updateByPrimaryKeySelective(OrientationRecord record) { + return UpdateDSL.updateWithMapper(this::update, orientationRecord) + .set(configAttributeId).equalToWhenPresent(record::getConfigAttributeId) + .set(template).equalToWhenPresent(record::getTemplate) + .set(view).equalToWhenPresent(record::getView) + .set(group).equalToWhenPresent(record::getGroup) + .set(xPosition).equalToWhenPresent(record::getxPosition) + .set(yPosition).equalToWhenPresent(record::getyPosition) + .set(width).equalToWhenPresent(record::getWidth) + .set(height).equalToWhenPresent(record::getHeight) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(orientationRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordDynamicSqlSupport.java new file mode 100644 index 00000000..9ecdac6d --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordDynamicSqlSupport.java @@ -0,0 +1,33 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class RoleRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + public static final RoleRecord roleRecord = new RoleRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.id") + public static final SqlColumn id = roleRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.user_id") + public static final SqlColumn userId = roleRecord.userId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.role_name") + public static final SqlColumn roleName = roleRecord.roleName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + public static final class RoleRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn userId = column("user_id", JDBCType.BIGINT); + + public final SqlColumn roleName = column("role_name", JDBCType.VARCHAR); + + public RoleRecord() { + super("user_role"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordMapper.java new file mode 100644 index 00000000..0789bf5f --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/RoleRecordMapper.java @@ -0,0 +1,173 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.RoleRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.RoleRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface RoleRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="user_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="role_name", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + RoleRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="user_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="role_name", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(roleRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, roleRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default int insert(RoleRecord record) { + return insert(SqlBuilder.insert(record) + .into(roleRecord) + .map(userId).toProperty("userId") + .map(roleName).toProperty("roleName") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default int insertSelective(RoleRecord record) { + return insert(SqlBuilder.insert(record) + .into(roleRecord) + .map(userId).toPropertyWhenPresent("userId", record::getUserId) + .map(roleName).toPropertyWhenPresent("roleName", record::getRoleName) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, userId, roleName) + .from(roleRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, userId, roleName) + .from(roleRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default RoleRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, userId, roleName) + .from(roleRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default UpdateDSL> updateByExample(RoleRecord record) { + return UpdateDSL.updateWithMapper(this::update, roleRecord) + .set(userId).equalTo(record::getUserId) + .set(roleName).equalTo(record::getRoleName); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default UpdateDSL> updateByExampleSelective(RoleRecord record) { + return UpdateDSL.updateWithMapper(this::update, roleRecord) + .set(userId).equalToWhenPresent(record::getUserId) + .set(roleName).equalToWhenPresent(record::getRoleName); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default int updateByPrimaryKey(RoleRecord record) { + return UpdateDSL.updateWithMapper(this::update, roleRecord) + .set(userId).equalTo(record::getUserId) + .set(roleName).equalTo(record::getRoleName) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.555+01:00", comments="Source Table: user_role") + default int updateByPrimaryKeySelective(RoleRecord record) { + return UpdateDSL.updateWithMapper(this::update, roleRecord) + .set(userId).equalToWhenPresent(record::getUserId) + .set(roleName).equalToWhenPresent(record::getRoleName) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(roleRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordDynamicSqlSupport.java new file mode 100644 index 00000000..f5ec80ee --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordDynamicSqlSupport.java @@ -0,0 +1,68 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class SebLmsSetupRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source Table: seb_lms_setup") + public static final SebLmsSetupRecord sebLmsSetupRecord = new SebLmsSetupRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.id") + public static final SqlColumn id = sebLmsSetupRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.institution_id") + public static final SqlColumn institutionId = sebLmsSetupRecord.institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.name") + public static final SqlColumn name = sebLmsSetupRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.lms_type") + public static final SqlColumn lmsType = sebLmsSetupRecord.lmsType; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.lms_url") + public static final SqlColumn lmsUrl = sebLmsSetupRecord.lmsUrl; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.lms_clientname") + public static final SqlColumn lmsClientname = sebLmsSetupRecord.lmsClientname; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.lms_clientsecret") + public static final SqlColumn lmsClientsecret = sebLmsSetupRecord.lmsClientsecret; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.lms_rest_api_token") + public static final SqlColumn lmsRestApiToken = sebLmsSetupRecord.lmsRestApiToken; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.seb_clientname") + public static final SqlColumn sebClientname = sebLmsSetupRecord.sebClientname; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source field: seb_lms_setup.seb_clientsecret") + public static final SqlColumn sebClientsecret = sebLmsSetupRecord.sebClientsecret; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source Table: seb_lms_setup") + public static final class SebLmsSetupRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn institutionId = column("institution_id", JDBCType.BIGINT); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn lmsType = column("lms_type", JDBCType.VARCHAR); + + public final SqlColumn lmsUrl = column("lms_url", JDBCType.VARCHAR); + + public final SqlColumn lmsClientname = column("lms_clientname", JDBCType.VARCHAR); + + public final SqlColumn lmsClientsecret = column("lms_clientsecret", JDBCType.VARCHAR); + + public final SqlColumn lmsRestApiToken = column("lms_rest_api_token", JDBCType.VARCHAR); + + public final SqlColumn sebClientname = column("seb_clientname", JDBCType.VARCHAR); + + public final SqlColumn sebClientsecret = column("seb_clientsecret", JDBCType.VARCHAR); + + public SebLmsSetupRecord() { + super("seb_lms_setup"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordMapper.java new file mode 100644 index 00000000..a4a5d707 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/SebLmsSetupRecordMapper.java @@ -0,0 +1,229 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.SebLmsSetupRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.model.SebLmsSetupRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface SebLmsSetupRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_url", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_clientname", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_clientsecret", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_rest_api_token", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="seb_clientname", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="seb_clientsecret", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + SebLmsSetupRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_type", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_url", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_clientname", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_clientsecret", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="lms_rest_api_token", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="seb_clientname", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="seb_clientsecret", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(sebLmsSetupRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, sebLmsSetupRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, sebLmsSetupRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + default int insert(SebLmsSetupRecord record) { + return insert(SqlBuilder.insert(record) + .into(sebLmsSetupRecord) + .map(institutionId).toProperty("institutionId") + .map(name).toProperty("name") + .map(lmsType).toProperty("lmsType") + .map(lmsUrl).toProperty("lmsUrl") + .map(lmsClientname).toProperty("lmsClientname") + .map(lmsClientsecret).toProperty("lmsClientsecret") + .map(lmsRestApiToken).toProperty("lmsRestApiToken") + .map(sebClientname).toProperty("sebClientname") + .map(sebClientsecret).toProperty("sebClientsecret") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.549+01:00", comments="Source Table: seb_lms_setup") + default int insertSelective(SebLmsSetupRecord record) { + return insert(SqlBuilder.insert(record) + .into(sebLmsSetupRecord) + .map(institutionId).toPropertyWhenPresent("institutionId", record::getInstitutionId) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(lmsType).toPropertyWhenPresent("lmsType", record::getLmsType) + .map(lmsUrl).toPropertyWhenPresent("lmsUrl", record::getLmsUrl) + .map(lmsClientname).toPropertyWhenPresent("lmsClientname", record::getLmsClientname) + .map(lmsClientsecret).toPropertyWhenPresent("lmsClientsecret", record::getLmsClientsecret) + .map(lmsRestApiToken).toPropertyWhenPresent("lmsRestApiToken", record::getLmsRestApiToken) + .map(sebClientname).toPropertyWhenPresent("sebClientname", record::getSebClientname) + .map(sebClientsecret).toPropertyWhenPresent("sebClientsecret", record::getSebClientsecret) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret) + .from(sebLmsSetupRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret) + .from(sebLmsSetupRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default SebLmsSetupRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, name, lmsType, lmsUrl, lmsClientname, lmsClientsecret, lmsRestApiToken, sebClientname, sebClientsecret) + .from(sebLmsSetupRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default UpdateDSL> updateByExample(SebLmsSetupRecord record) { + return UpdateDSL.updateWithMapper(this::update, sebLmsSetupRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(name).equalTo(record::getName) + .set(lmsType).equalTo(record::getLmsType) + .set(lmsUrl).equalTo(record::getLmsUrl) + .set(lmsClientname).equalTo(record::getLmsClientname) + .set(lmsClientsecret).equalTo(record::getLmsClientsecret) + .set(lmsRestApiToken).equalTo(record::getLmsRestApiToken) + .set(sebClientname).equalTo(record::getSebClientname) + .set(sebClientsecret).equalTo(record::getSebClientsecret); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default UpdateDSL> updateByExampleSelective(SebLmsSetupRecord record) { + return UpdateDSL.updateWithMapper(this::update, sebLmsSetupRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(name).equalToWhenPresent(record::getName) + .set(lmsType).equalToWhenPresent(record::getLmsType) + .set(lmsUrl).equalToWhenPresent(record::getLmsUrl) + .set(lmsClientname).equalToWhenPresent(record::getLmsClientname) + .set(lmsClientsecret).equalToWhenPresent(record::getLmsClientsecret) + .set(lmsRestApiToken).equalToWhenPresent(record::getLmsRestApiToken) + .set(sebClientname).equalToWhenPresent(record::getSebClientname) + .set(sebClientsecret).equalToWhenPresent(record::getSebClientsecret); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default int updateByPrimaryKey(SebLmsSetupRecord record) { + return UpdateDSL.updateWithMapper(this::update, sebLmsSetupRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(name).equalTo(record::getName) + .set(lmsType).equalTo(record::getLmsType) + .set(lmsUrl).equalTo(record::getLmsUrl) + .set(lmsClientname).equalTo(record::getLmsClientname) + .set(lmsClientsecret).equalTo(record::getLmsClientsecret) + .set(lmsRestApiToken).equalTo(record::getLmsRestApiToken) + .set(sebClientname).equalTo(record::getSebClientname) + .set(sebClientsecret).equalTo(record::getSebClientsecret) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: seb_lms_setup") + default int updateByPrimaryKeySelective(SebLmsSetupRecord record) { + return UpdateDSL.updateWithMapper(this::update, sebLmsSetupRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(name).equalToWhenPresent(record::getName) + .set(lmsType).equalToWhenPresent(record::getLmsType) + .set(lmsUrl).equalToWhenPresent(record::getLmsUrl) + .set(lmsClientname).equalToWhenPresent(record::getLmsClientname) + .set(lmsClientsecret).equalToWhenPresent(record::getLmsClientsecret) + .set(lmsRestApiToken).equalToWhenPresent(record::getLmsRestApiToken) + .set(sebClientname).equalToWhenPresent(record::getSebClientname) + .set(sebClientsecret).equalToWhenPresent(record::getSebClientsecret) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(sebLmsSetupRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordDynamicSqlSupport.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordDynamicSqlSupport.java new file mode 100644 index 00000000..58117e30 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordDynamicSqlSupport.java @@ -0,0 +1,74 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import java.sql.JDBCType; +import javax.annotation.Generated; +import org.joda.time.DateTime; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +public final class UserRecordDynamicSqlSupport { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source Table: user") + public static final UserRecord userRecord = new UserRecord(); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.id") + public static final SqlColumn id = userRecord.id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.institution_id") + public static final SqlColumn institutionId = userRecord.institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.uuid") + public static final SqlColumn uuid = userRecord.uuid; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.name") + public static final SqlColumn name = userRecord.name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.user_name") + public static final SqlColumn userName = userRecord.userName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.password") + public static final SqlColumn password = userRecord.password; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.email") + public static final SqlColumn email = userRecord.email; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.creation_date") + public static final SqlColumn creationDate = userRecord.creationDate; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.active") + public static final SqlColumn active = userRecord.active; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.locale") + public static final SqlColumn locale = userRecord.locale; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source field: user.timezone") + public static final SqlColumn timezone = userRecord.timezone; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source Table: user") + public static final class UserRecord extends SqlTable { + public final SqlColumn id = column("id", JDBCType.BIGINT); + + public final SqlColumn institutionId = column("institution_id", JDBCType.BIGINT); + + public final SqlColumn uuid = column("uuid", JDBCType.VARCHAR); + + public final SqlColumn name = column("name", JDBCType.VARCHAR); + + public final SqlColumn userName = column("user_name", JDBCType.VARCHAR); + + public final SqlColumn password = column("password", JDBCType.VARCHAR); + + public final SqlColumn email = column("email", JDBCType.VARCHAR); + + public final SqlColumn creationDate = column("creation_date", JDBCType.TIMESTAMP, "ch.ethz.seb.sebserver.ws.batis.JodaTimeTypeResolver"); + + public final SqlColumn active = column("active", JDBCType.INTEGER); + + public final SqlColumn locale = column("locale", JDBCType.VARCHAR); + + public final SqlColumn timezone = column("timezone", JDBCType.VARCHAR); + + public UserRecord() { + super("user"); + } + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordMapper.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordMapper.java new file mode 100644 index 00000000..eddbf9a6 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/mapper/UserRecordMapper.java @@ -0,0 +1,239 @@ +package ch.ethz.seb.sebserver.ws.batis.mapper; + +import static ch.ethz.seb.sebserver.ws.batis.mapper.UserRecordDynamicSqlSupport.*; +import static org.mybatis.dynamic.sql.SqlBuilder.*; + +import ch.ethz.seb.sebserver.ws.batis.JodaTimeTypeResolver; +import ch.ethz.seb.sebserver.ws.batis.model.UserRecord; +import java.util.List; +import javax.annotation.Generated; +import org.apache.ibatis.annotations.Arg; +import org.apache.ibatis.annotations.ConstructorArgs; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.joda.time.DateTime; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategy; +import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectDSL; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.mybatis.dynamic.sql.util.SqlProviderAdapter; + +@Mapper +public interface UserRecordMapper { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source Table: user") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + long count(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source Table: user") + @DeleteProvider(type=SqlProviderAdapter.class, method="delete") + int delete(DeleteStatementProvider deleteStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source Table: user") + @InsertProvider(type=SqlProviderAdapter.class, method="insert") + @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class) + int insert(InsertStatementProvider insertStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.552+01:00", comments="Source Table: user") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="user_name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="password", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="email", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="creation_date", javaType=DateTime.class, typeHandler=JodaTimeTypeResolver.class, jdbcType=JdbcType.TIMESTAMP), + @Arg(column="active", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="locale", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="timezone", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + UserRecord selectOne(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({ + @Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true), + @Arg(column="institution_id", javaType=Long.class, jdbcType=JdbcType.BIGINT), + @Arg(column="uuid", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="user_name", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="password", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="email", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="creation_date", javaType=DateTime.class, typeHandler=JodaTimeTypeResolver.class, jdbcType=JdbcType.TIMESTAMP), + @Arg(column="active", javaType=Integer.class, jdbcType=JdbcType.INTEGER), + @Arg(column="locale", javaType=String.class, jdbcType=JdbcType.VARCHAR), + @Arg(column="timezone", javaType=String.class, jdbcType=JdbcType.VARCHAR) + }) + List selectMany(SelectStatementProvider selectStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + @UpdateProvider(type=SqlProviderAdapter.class, method="update") + int update(UpdateStatementProvider updateStatement); + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default QueryExpressionDSL> countByExample() { + return SelectDSL.selectWithMapper(this::count, SqlBuilder.count()) + .from(userRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default DeleteDSL> deleteByExample() { + return DeleteDSL.deleteFromWithMapper(this::delete, userRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default int deleteByPrimaryKey(Long id_) { + return DeleteDSL.deleteFromWithMapper(this::delete, userRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default int insert(UserRecord record) { + return insert(SqlBuilder.insert(record) + .into(userRecord) + .map(institutionId).toProperty("institutionId") + .map(uuid).toProperty("uuid") + .map(name).toProperty("name") + .map(userName).toProperty("userName") + .map(password).toProperty("password") + .map(email).toProperty("email") + .map(creationDate).toProperty("creationDate") + .map(active).toProperty("active") + .map(locale).toProperty("locale") + .map(timezone).toProperty("timezone") + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default int insertSelective(UserRecord record) { + return insert(SqlBuilder.insert(record) + .into(userRecord) + .map(institutionId).toPropertyWhenPresent("institutionId", record::getInstitutionId) + .map(uuid).toPropertyWhenPresent("uuid", record::getUuid) + .map(name).toPropertyWhenPresent("name", record::getName) + .map(userName).toPropertyWhenPresent("userName", record::getUserName) + .map(password).toPropertyWhenPresent("password", record::getPassword) + .map(email).toPropertyWhenPresent("email", record::getEmail) + .map(creationDate).toPropertyWhenPresent("creationDate", record::getCreationDate) + .map(active).toPropertyWhenPresent("active", record::getActive) + .map(locale).toPropertyWhenPresent("locale", record::getLocale) + .map(timezone).toPropertyWhenPresent("timezone", record::getTimezone) + .build() + .render(RenderingStrategy.MYBATIS3)); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default QueryExpressionDSL>> selectByExample() { + return SelectDSL.selectWithMapper(this::selectMany, id, institutionId, uuid, name, userName, password, email, creationDate, active, locale, timezone) + .from(userRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default QueryExpressionDSL>> selectDistinctByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectMany, id, institutionId, uuid, name, userName, password, email, creationDate, active, locale, timezone) + .from(userRecord); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default UserRecord selectByPrimaryKey(Long id_) { + return SelectDSL.selectWithMapper(this::selectOne, id, institutionId, uuid, name, userName, password, email, creationDate, active, locale, timezone) + .from(userRecord) + .where(id, isEqualTo(id_)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default UpdateDSL> updateByExample(UserRecord record) { + return UpdateDSL.updateWithMapper(this::update, userRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(uuid).equalTo(record::getUuid) + .set(name).equalTo(record::getName) + .set(userName).equalTo(record::getUserName) + .set(password).equalTo(record::getPassword) + .set(email).equalTo(record::getEmail) + .set(creationDate).equalTo(record::getCreationDate) + .set(active).equalTo(record::getActive) + .set(locale).equalTo(record::getLocale) + .set(timezone).equalTo(record::getTimezone); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default UpdateDSL> updateByExampleSelective(UserRecord record) { + return UpdateDSL.updateWithMapper(this::update, userRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(uuid).equalToWhenPresent(record::getUuid) + .set(name).equalToWhenPresent(record::getName) + .set(userName).equalToWhenPresent(record::getUserName) + .set(password).equalToWhenPresent(record::getPassword) + .set(email).equalToWhenPresent(record::getEmail) + .set(creationDate).equalToWhenPresent(record::getCreationDate) + .set(active).equalToWhenPresent(record::getActive) + .set(locale).equalToWhenPresent(record::getLocale) + .set(timezone).equalToWhenPresent(record::getTimezone); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default int updateByPrimaryKey(UserRecord record) { + return UpdateDSL.updateWithMapper(this::update, userRecord) + .set(institutionId).equalTo(record::getInstitutionId) + .set(uuid).equalTo(record::getUuid) + .set(name).equalTo(record::getName) + .set(userName).equalTo(record::getUserName) + .set(password).equalTo(record::getPassword) + .set(email).equalTo(record::getEmail) + .set(creationDate).equalTo(record::getCreationDate) + .set(active).equalTo(record::getActive) + .set(locale).equalTo(record::getLocale) + .set(timezone).equalTo(record::getTimezone) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.553+01:00", comments="Source Table: user") + default int updateByPrimaryKeySelective(UserRecord record) { + return UpdateDSL.updateWithMapper(this::update, userRecord) + .set(institutionId).equalToWhenPresent(record::getInstitutionId) + .set(uuid).equalToWhenPresent(record::getUuid) + .set(name).equalToWhenPresent(record::getName) + .set(userName).equalToWhenPresent(record::getUserName) + .set(password).equalToWhenPresent(record::getPassword) + .set(email).equalToWhenPresent(record::getEmail) + .set(creationDate).equalToWhenPresent(record::getCreationDate) + .set(active).equalToWhenPresent(record::getActive) + .set(locale).equalToWhenPresent(record::getLocale) + .set(timezone).equalToWhenPresent(record::getTimezone) + .where(id, isEqualTo(record::getId)) + .build() + .execute(); + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="Source Table: exam") + @SelectProvider(type=SqlProviderAdapter.class, method="select") + @ConstructorArgs({@Arg(column="id", javaType=Long.class, jdbcType=JdbcType.BIGINT, id=true)}) + List selectIds(SelectStatementProvider select); + + default QueryExpressionDSL>> selectIdsByExample() { + return SelectDSL.selectDistinctWithMapper(this::selectIds, id) + .from(userRecord); + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientConnectionRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientConnectionRecord.java new file mode 100644 index 00000000..605dbff4 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientConnectionRecord.java @@ -0,0 +1,154 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ClientConnectionRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.533+01:00", comments="Source field: client_connection.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.533+01:00", comments="Source field: client_connection.exam_id") + private Long examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.status") + private String status; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.connection_token") + private String connectionToken; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.user_name") + private String userName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.vdi") + private Boolean vdi; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.client_address") + private String clientAddress; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.virtual_client_address") + private String virtualClientAddress; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.533+01:00", comments="Source Table: client_connection") + public ClientConnectionRecord(Long id, Long examId, String status, String connectionToken, String userName, Boolean vdi, String clientAddress, String virtualClientAddress) { + this.id = id; + this.examId = examId; + this.status = status; + this.connectionToken = connectionToken; + this.userName = userName; + this.vdi = vdi; + this.clientAddress = clientAddress; + this.virtualClientAddress = virtualClientAddress; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.533+01:00", comments="Source field: client_connection.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.exam_id") + public Long getExamId() { + return examId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.status") + public String getStatus() { + return status; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.connection_token") + public String getConnectionToken() { + return connectionToken; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.user_name") + public String getUserName() { + return userName; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.vdi") + public Boolean getVdi() { + return vdi; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.client_address") + public String getClientAddress() { + return clientAddress; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.534+01:00", comments="Source field: client_connection.virtual_client_address") + public String getVirtualClientAddress() { + return virtualClientAddress; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_connection + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", examId=").append(examId); + sb.append(", status=").append(status); + sb.append(", connectionToken=").append(connectionToken); + sb.append(", userName=").append(userName); + sb.append(", vdi=").append(vdi); + sb.append(", clientAddress=").append(clientAddress); + sb.append(", virtualClientAddress=").append(virtualClientAddress); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_connection + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ClientConnectionRecord other = (ClientConnectionRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getExamId() == null ? other.getExamId() == null : this.getExamId().equals(other.getExamId())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getConnectionToken() == null ? other.getConnectionToken() == null : this.getConnectionToken().equals(other.getConnectionToken())) + && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) + && (this.getVdi() == null ? other.getVdi() == null : this.getVdi().equals(other.getVdi())) + && (this.getClientAddress() == null ? other.getClientAddress() == null : this.getClientAddress().equals(other.getClientAddress())) + && (this.getVirtualClientAddress() == null ? other.getVirtualClientAddress() == null : this.getVirtualClientAddress().equals(other.getVirtualClientAddress())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_connection + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getExamId() == null) ? 0 : getExamId().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getConnectionToken() == null) ? 0 : getConnectionToken().hashCode()); + result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); + result = prime * result + ((getVdi() == null) ? 0 : getVdi().hashCode()); + result = prime * result + ((getClientAddress() == null) ? 0 : getClientAddress().hashCode()); + result = prime * result + ((getVirtualClientAddress() == null) ? 0 : getVirtualClientAddress().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientEventRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientEventRecord.java new file mode 100644 index 00000000..026ce839 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ClientEventRecord.java @@ -0,0 +1,143 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import java.math.BigDecimal; +import javax.annotation.Generated; + +public class ClientEventRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.connection_id") + private Long connectionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.user_identifier") + private String userIdentifier; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.type") + private Integer type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.timestamp") + private Long timestamp; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.numeric_value") + private BigDecimal numericValue; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.text") + private String text; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source Table: client_event") + public ClientEventRecord(Long id, Long connectionId, String userIdentifier, Integer type, Long timestamp, BigDecimal numericValue, String text) { + this.id = id; + this.connectionId = connectionId; + this.userIdentifier = userIdentifier; + this.type = type; + this.timestamp = timestamp; + this.numericValue = numericValue; + this.text = text; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.connection_id") + public Long getConnectionId() { + return connectionId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.user_identifier") + public String getUserIdentifier() { + return userIdentifier; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.538+01:00", comments="Source field: client_event.type") + public Integer getType() { + return type; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.timestamp") + public Long getTimestamp() { + return timestamp; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.numeric_value") + public BigDecimal getNumericValue() { + return numericValue; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.539+01:00", comments="Source field: client_event.text") + public String getText() { + return text; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_event + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", connectionId=").append(connectionId); + sb.append(", userIdentifier=").append(userIdentifier); + sb.append(", type=").append(type); + sb.append(", timestamp=").append(timestamp); + sb.append(", numericValue=").append(numericValue); + sb.append(", text=").append(text); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_event + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ClientEventRecord other = (ClientEventRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getConnectionId() == null ? other.getConnectionId() == null : this.getConnectionId().equals(other.getConnectionId())) + && (this.getUserIdentifier() == null ? other.getUserIdentifier() == null : this.getUserIdentifier().equals(other.getUserIdentifier())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getTimestamp() == null ? other.getTimestamp() == null : this.getTimestamp().equals(other.getTimestamp())) + && (this.getNumericValue() == null ? other.getNumericValue() == null : this.getNumericValue().equals(other.getNumericValue())) + && (this.getText() == null ? other.getText() == null : this.getText().equals(other.getText())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table client_event + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getConnectionId() == null) ? 0 : getConnectionId().hashCode()); + result = prime * result + ((getUserIdentifier() == null) ? 0 : getUserIdentifier().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); + result = prime * result + ((getNumericValue() == null) ? 0 : getNumericValue().hashCode()); + result = prime * result + ((getText() == null) ? 0 : getText().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationAttributeRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationAttributeRecord.java new file mode 100644 index 00000000..edb8781d --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationAttributeRecord.java @@ -0,0 +1,154 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ConfigurationAttributeRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.376+01:00", comments="Source field: configuration_attribute.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.type") + private String type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.parent_id") + private Long parentId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.378+01:00", comments="Source field: configuration_attribute.resources") + private String resources; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.378+01:00", comments="Source field: configuration_attribute.validator") + private String validator; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.379+01:00", comments="Source field: configuration_attribute.dependencies") + private String dependencies; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.379+01:00", comments="Source field: configuration_attribute.default_value") + private String defaultValue; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.372+01:00", comments="Source Table: configuration_attribute") + public ConfigurationAttributeRecord(Long id, String name, String type, Long parentId, String resources, String validator, String dependencies, String defaultValue) { + this.id = id; + this.name = name; + this.type = type; + this.parentId = parentId; + this.resources = resources; + this.validator = validator; + this.dependencies = dependencies; + this.defaultValue = defaultValue; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.377+01:00", comments="Source field: configuration_attribute.type") + public String getType() { + return type; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.378+01:00", comments="Source field: configuration_attribute.parent_id") + public Long getParentId() { + return parentId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.378+01:00", comments="Source field: configuration_attribute.resources") + public String getResources() { + return resources; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.379+01:00", comments="Source field: configuration_attribute.validator") + public String getValidator() { + return validator; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.379+01:00", comments="Source field: configuration_attribute.dependencies") + public String getDependencies() { + return dependencies; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.379+01:00", comments="Source field: configuration_attribute.default_value") + public String getDefaultValue() { + return defaultValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_attribute + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", name=").append(name); + sb.append(", type=").append(type); + sb.append(", parentId=").append(parentId); + sb.append(", resources=").append(resources); + sb.append(", validator=").append(validator); + sb.append(", dependencies=").append(dependencies); + sb.append(", defaultValue=").append(defaultValue); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_attribute + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ConfigurationAttributeRecord other = (ConfigurationAttributeRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId())) + && (this.getResources() == null ? other.getResources() == null : this.getResources().equals(other.getResources())) + && (this.getValidator() == null ? other.getValidator() == null : this.getValidator().equals(other.getValidator())) + && (this.getDependencies() == null ? other.getDependencies() == null : this.getDependencies().equals(other.getDependencies())) + && (this.getDefaultValue() == null ? other.getDefaultValue() == null : this.getDefaultValue().equals(other.getDefaultValue())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_attribute + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode()); + result = prime * result + ((getResources() == null) ? 0 : getResources().hashCode()); + result = prime * result + ((getValidator() == null) ? 0 : getValidator().hashCode()); + result = prime * result + ((getDependencies() == null) ? 0 : getDependencies().hashCode()); + result = prime * result + ((getDefaultValue() == null) ? 0 : getDefaultValue().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationNodeRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationNodeRecord.java new file mode 100644 index 00000000..f76f0945 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationNodeRecord.java @@ -0,0 +1,142 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ConfigurationNodeRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.institution_id") + private Long institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.owner") + private String owner; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.description") + private String description; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.type") + private String type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.template") + private String template; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source Table: configuration_node") + public ConfigurationNodeRecord(Long id, Long institutionId, String owner, String name, String description, String type, String template) { + this.id = id; + this.institutionId = institutionId; + this.owner = owner; + this.name = name; + this.description = description; + this.type = type; + this.template = template; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.institution_id") + public Long getInstitutionId() { + return institutionId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.522+01:00", comments="Source field: configuration_node.owner") + public String getOwner() { + return owner; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.description") + public String getDescription() { + return description; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.type") + public String getType() { + return type; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.523+01:00", comments="Source field: configuration_node.template") + public String getTemplate() { + return template; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_node + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", institutionId=").append(institutionId); + sb.append(", owner=").append(owner); + sb.append(", name=").append(name); + sb.append(", description=").append(description); + sb.append(", type=").append(type); + sb.append(", template=").append(template); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_node + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ConfigurationNodeRecord other = (ConfigurationNodeRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getInstitutionId() == null ? other.getInstitutionId() == null : this.getInstitutionId().equals(other.getInstitutionId())) + && (this.getOwner() == null ? other.getOwner() == null : this.getOwner().equals(other.getOwner())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getTemplate() == null ? other.getTemplate() == null : this.getTemplate().equals(other.getTemplate())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_node + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getInstitutionId() == null) ? 0 : getInstitutionId().hashCode()); + result = prime * result + ((getOwner() == null) ? 0 : getOwner().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getTemplate() == null) ? 0 : getTemplate().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationRecord.java new file mode 100644 index 00000000..1315bdbf --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationRecord.java @@ -0,0 +1,119 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; +import org.joda.time.DateTime; + +public class ConfigurationRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.513+01:00", comments="Source field: configuration.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.513+01:00", comments="Source field: configuration.configuration_node_id") + private Long configurationNodeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.version") + private String version; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.version_date") + private DateTime versionDate; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.followup") + private Integer followup; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.512+01:00", comments="Source Table: configuration") + public ConfigurationRecord(Long id, Long configurationNodeId, String version, DateTime versionDate, Integer followup) { + this.id = id; + this.configurationNodeId = configurationNodeId; + this.version = version; + this.versionDate = versionDate; + this.followup = followup; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.513+01:00", comments="Source field: configuration.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.513+01:00", comments="Source field: configuration.configuration_node_id") + public Long getConfigurationNodeId() { + return configurationNodeId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.version") + public String getVersion() { + return version; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.version_date") + public DateTime getVersionDate() { + return versionDate; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.515+01:00", comments="Source field: configuration.followup") + public Integer getFollowup() { + return followup; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", configurationNodeId=").append(configurationNodeId); + sb.append(", version=").append(version); + sb.append(", versionDate=").append(versionDate); + sb.append(", followup=").append(followup); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ConfigurationRecord other = (ConfigurationRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getConfigurationNodeId() == null ? other.getConfigurationNodeId() == null : this.getConfigurationNodeId().equals(other.getConfigurationNodeId())) + && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion())) + && (this.getVersionDate() == null ? other.getVersionDate() == null : this.getVersionDate().equals(other.getVersionDate())) + && (this.getFollowup() == null ? other.getFollowup() == null : this.getFollowup().equals(other.getFollowup())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getConfigurationNodeId() == null) ? 0 : getConfigurationNodeId().hashCode()); + result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode()); + result = prime * result + ((getVersionDate() == null) ? 0 : getVersionDate().hashCode()); + result = prime * result + ((getFollowup() == null) ? 0 : getFollowup().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationValueRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationValueRecord.java new file mode 100644 index 00000000..f8ee3d52 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ConfigurationValueRecord.java @@ -0,0 +1,130 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ConfigurationValueRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.configuration_id") + private Long configurationId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.configuration_attribute_id") + private Long configurationAttributeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.list_index") + private Integer listIndex; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.value") + private String value; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.text") + private String text; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source Table: configuration_value") + public ConfigurationValueRecord(Long id, Long configurationId, Long configurationAttributeId, Integer listIndex, String value, String text) { + this.id = id; + this.configurationId = configurationId; + this.configurationAttributeId = configurationAttributeId; + this.listIndex = listIndex; + this.value = value; + this.text = text; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.configuration_id") + public Long getConfigurationId() { + return configurationId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.configuration_attribute_id") + public Long getConfigurationAttributeId() { + return configurationAttributeId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.list_index") + public Integer getListIndex() { + return listIndex; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.value") + public String getValue() { + return value; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.496+01:00", comments="Source field: configuration_value.text") + public String getText() { + return text; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_value + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", configurationId=").append(configurationId); + sb.append(", configurationAttributeId=").append(configurationAttributeId); + sb.append(", listIndex=").append(listIndex); + sb.append(", value=").append(value); + sb.append(", text=").append(text); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_value + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ConfigurationValueRecord other = (ConfigurationValueRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getConfigurationId() == null ? other.getConfigurationId() == null : this.getConfigurationId().equals(other.getConfigurationId())) + && (this.getConfigurationAttributeId() == null ? other.getConfigurationAttributeId() == null : this.getConfigurationAttributeId().equals(other.getConfigurationAttributeId())) + && (this.getListIndex() == null ? other.getListIndex() == null : this.getListIndex().equals(other.getListIndex())) + && (this.getValue() == null ? other.getValue() == null : this.getValue().equals(other.getValue())) + && (this.getText() == null ? other.getText() == null : this.getText().equals(other.getText())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table configuration_value + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getConfigurationId() == null) ? 0 : getConfigurationId().hashCode()); + result = prime * result + ((getConfigurationAttributeId() == null) ? 0 : getConfigurationAttributeId().hashCode()); + result = prime * result + ((getListIndex() == null) ? 0 : getListIndex().hashCode()); + result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode()); + result = prime * result + ((getText() == null) ? 0 : getText().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamConfigurationMapRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamConfigurationMapRecord.java new file mode 100644 index 00000000..18f3d20d --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamConfigurationMapRecord.java @@ -0,0 +1,106 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ExamConfigurationMapRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source field: exam_configuration_map.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.exam_id") + private Long examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + private Long configurationNodeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.user_names") + private String userNames; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source Table: exam_configuration_map") + public ExamConfigurationMapRecord(Long id, Long examId, Long configurationNodeId, String userNames) { + this.id = id; + this.examId = examId; + this.configurationNodeId = configurationNodeId; + this.userNames = userNames; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.525+01:00", comments="Source field: exam_configuration_map.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.exam_id") + public Long getExamId() { + return examId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.configuration_node_id") + public Long getConfigurationNodeId() { + return configurationNodeId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.526+01:00", comments="Source field: exam_configuration_map.user_names") + public String getUserNames() { + return userNames; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam_configuration_map + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", examId=").append(examId); + sb.append(", configurationNodeId=").append(configurationNodeId); + sb.append(", userNames=").append(userNames); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam_configuration_map + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ExamConfigurationMapRecord other = (ExamConfigurationMapRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getExamId() == null ? other.getExamId() == null : this.getExamId().equals(other.getExamId())) + && (this.getConfigurationNodeId() == null ? other.getConfigurationNodeId() == null : this.getConfigurationNodeId().equals(other.getConfigurationNodeId())) + && (this.getUserNames() == null ? other.getUserNames() == null : this.getUserNames().equals(other.getUserNames())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam_configuration_map + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getExamId() == null) ? 0 : getExamId().hashCode()); + result = prime * result + ((getConfigurationNodeId() == null) ? 0 : getConfigurationNodeId().hashCode()); + result = prime * result + ((getUserNames() == null) ? 0 : getUserNames().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamRecord.java new file mode 100644 index 00000000..a9552865 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/ExamRecord.java @@ -0,0 +1,130 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class ExamRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.lms_setup_id") + private Long lmsSetupId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.external_uuid") + private String externalUuid; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.owner") + private String owner; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.supporter") + private String supporter; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.530+01:00", comments="Source field: exam.type") + private String type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source Table: exam") + public ExamRecord(Long id, Long lmsSetupId, String externalUuid, String owner, String supporter, String type) { + this.id = id; + this.lmsSetupId = lmsSetupId; + this.externalUuid = externalUuid; + this.owner = owner; + this.supporter = supporter; + this.type = type; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.lms_setup_id") + public Long getLmsSetupId() { + return lmsSetupId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.external_uuid") + public String getExternalUuid() { + return externalUuid; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.owner") + public String getOwner() { + return owner; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.529+01:00", comments="Source field: exam.supporter") + public String getSupporter() { + return supporter; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.530+01:00", comments="Source field: exam.type") + public String getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", lmsSetupId=").append(lmsSetupId); + sb.append(", externalUuid=").append(externalUuid); + sb.append(", owner=").append(owner); + sb.append(", supporter=").append(supporter); + sb.append(", type=").append(type); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ExamRecord other = (ExamRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getLmsSetupId() == null ? other.getLmsSetupId() == null : this.getLmsSetupId().equals(other.getLmsSetupId())) + && (this.getExternalUuid() == null ? other.getExternalUuid() == null : this.getExternalUuid().equals(other.getExternalUuid())) + && (this.getOwner() == null ? other.getOwner() == null : this.getOwner().equals(other.getOwner())) + && (this.getSupporter() == null ? other.getSupporter() == null : this.getSupporter().equals(other.getSupporter())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table exam + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getLmsSetupId() == null) ? 0 : getLmsSetupId().hashCode()); + result = prime * result + ((getExternalUuid() == null) ? 0 : getExternalUuid().hashCode()); + result = prime * result + ((getOwner() == null) ? 0 : getOwner().hashCode()); + result = prime * result + ((getSupporter() == null) ? 0 : getSupporter().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/IndicatorRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/IndicatorRecord.java new file mode 100644 index 00000000..eec8e7e8 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/IndicatorRecord.java @@ -0,0 +1,118 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class IndicatorRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.exam_id") + private Long examId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.type") + private String type; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.color") + private String color; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.541+01:00", comments="Source Table: indicator") + public IndicatorRecord(Long id, Long examId, String type, String name, String color) { + this.id = id; + this.examId = examId; + this.type = type; + this.name = name; + this.color = color; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.exam_id") + public Long getExamId() { + return examId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.type") + public String getType() { + return type; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.542+01:00", comments="Source field: indicator.color") + public String getColor() { + return color; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table indicator + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", examId=").append(examId); + sb.append(", type=").append(type); + sb.append(", name=").append(name); + sb.append(", color=").append(color); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table indicator + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + IndicatorRecord other = (IndicatorRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getExamId() == null ? other.getExamId() == null : this.getExamId().equals(other.getExamId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getColor() == null ? other.getColor() == null : this.getColor().equals(other.getColor())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table indicator + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getExamId() == null) ? 0 : getExamId().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getColor() == null) ? 0 : getColor().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/InstitutionRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/InstitutionRecord.java new file mode 100644 index 00000000..416defcf --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/InstitutionRecord.java @@ -0,0 +1,94 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class InstitutionRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.authtype") + private String authtype; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source Table: institution") + public InstitutionRecord(Long id, String name, String authtype) { + this.id = id; + this.name = name; + this.authtype = authtype; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.545+01:00", comments="Source field: institution.authtype") + public String getAuthtype() { + return authtype; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table institution + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", name=").append(name); + sb.append(", authtype=").append(authtype); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table institution + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + InstitutionRecord other = (InstitutionRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getAuthtype() == null ? other.getAuthtype() == null : this.getAuthtype().equals(other.getAuthtype())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table institution + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getAuthtype() == null) ? 0 : getAuthtype().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/OrientationRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/OrientationRecord.java new file mode 100644 index 00000000..f6d0d1ad --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/OrientationRecord.java @@ -0,0 +1,166 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class OrientationRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.config_attribute_id") + private Long configAttributeId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.template") + private String template; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.view") + private String view; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.group") + private String group; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.x_position") + private Integer xPosition; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.y_position") + private Integer yPosition; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.width") + private Integer width; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.504+01:00", comments="Source field: orientation.height") + private Integer height; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source Table: orientation") + public OrientationRecord(Long id, Long configAttributeId, String template, String view, String group, Integer xPosition, Integer yPosition, Integer width, Integer height) { + this.id = id; + this.configAttributeId = configAttributeId; + this.template = template; + this.view = view; + this.group = group; + this.xPosition = xPosition; + this.yPosition = yPosition; + this.width = width; + this.height = height; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.config_attribute_id") + public Long getConfigAttributeId() { + return configAttributeId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.template") + public String getTemplate() { + return template; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.view") + public String getView() { + return view; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.group") + public String getGroup() { + return group; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.x_position") + public Integer getxPosition() { + return xPosition; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.y_position") + public Integer getyPosition() { + return yPosition; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.503+01:00", comments="Source field: orientation.width") + public Integer getWidth() { + return width; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.504+01:00", comments="Source field: orientation.height") + public Integer getHeight() { + return height; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table orientation + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", configAttributeId=").append(configAttributeId); + sb.append(", template=").append(template); + sb.append(", view=").append(view); + sb.append(", group=").append(group); + sb.append(", xPosition=").append(xPosition); + sb.append(", yPosition=").append(yPosition); + sb.append(", width=").append(width); + sb.append(", height=").append(height); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table orientation + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + OrientationRecord other = (OrientationRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getConfigAttributeId() == null ? other.getConfigAttributeId() == null : this.getConfigAttributeId().equals(other.getConfigAttributeId())) + && (this.getTemplate() == null ? other.getTemplate() == null : this.getTemplate().equals(other.getTemplate())) + && (this.getView() == null ? other.getView() == null : this.getView().equals(other.getView())) + && (this.getGroup() == null ? other.getGroup() == null : this.getGroup().equals(other.getGroup())) + && (this.getxPosition() == null ? other.getxPosition() == null : this.getxPosition().equals(other.getxPosition())) + && (this.getyPosition() == null ? other.getyPosition() == null : this.getyPosition().equals(other.getyPosition())) + && (this.getWidth() == null ? other.getWidth() == null : this.getWidth().equals(other.getWidth())) + && (this.getHeight() == null ? other.getHeight() == null : this.getHeight().equals(other.getHeight())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table orientation + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getConfigAttributeId() == null) ? 0 : getConfigAttributeId().hashCode()); + result = prime * result + ((getTemplate() == null) ? 0 : getTemplate().hashCode()); + result = prime * result + ((getView() == null) ? 0 : getView().hashCode()); + result = prime * result + ((getGroup() == null) ? 0 : getGroup().hashCode()); + result = prime * result + ((getxPosition() == null) ? 0 : getxPosition().hashCode()); + result = prime * result + ((getyPosition() == null) ? 0 : getyPosition().hashCode()); + result = prime * result + ((getWidth() == null) ? 0 : getWidth().hashCode()); + result = prime * result + ((getHeight() == null) ? 0 : getHeight().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/RoleRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/RoleRecord.java new file mode 100644 index 00000000..9cb95523 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/RoleRecord.java @@ -0,0 +1,94 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class RoleRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.user_id") + private Long userId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.role_name") + private String roleName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source Table: user_role") + public RoleRecord(Long id, Long userId, String roleName) { + this.id = id; + this.userId = userId; + this.roleName = roleName; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.user_id") + public Long getUserId() { + return userId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.554+01:00", comments="Source field: user_role.role_name") + public String getRoleName() { + return roleName; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_role + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", roleName=").append(roleName); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_role + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + RoleRecord other = (RoleRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getRoleName() == null ? other.getRoleName() == null : this.getRoleName().equals(other.getRoleName())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user_role + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/SebLmsSetupRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/SebLmsSetupRecord.java new file mode 100644 index 00000000..982a8ec3 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/SebLmsSetupRecord.java @@ -0,0 +1,178 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; + +public class SebLmsSetupRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.institution_id") + private Long institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.lms_type") + private String lmsType; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_url") + private String lmsUrl; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_clientname") + private String lmsClientname; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_clientsecret") + private String lmsClientsecret; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_rest_api_token") + private String lmsRestApiToken; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.seb_clientname") + private String sebClientname; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.seb_clientsecret") + private String sebClientsecret; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source Table: seb_lms_setup") + public SebLmsSetupRecord(Long id, Long institutionId, String name, String lmsType, String lmsUrl, String lmsClientname, String lmsClientsecret, String lmsRestApiToken, String sebClientname, String sebClientsecret) { + this.id = id; + this.institutionId = institutionId; + this.name = name; + this.lmsType = lmsType; + this.lmsUrl = lmsUrl; + this.lmsClientname = lmsClientname; + this.lmsClientsecret = lmsClientsecret; + this.lmsRestApiToken = lmsRestApiToken; + this.sebClientname = sebClientname; + this.sebClientsecret = sebClientsecret; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.institution_id") + public Long getInstitutionId() { + return institutionId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.547+01:00", comments="Source field: seb_lms_setup.lms_type") + public String getLmsType() { + return lmsType; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_url") + public String getLmsUrl() { + return lmsUrl; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_clientname") + public String getLmsClientname() { + return lmsClientname; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_clientsecret") + public String getLmsClientsecret() { + return lmsClientsecret; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.lms_rest_api_token") + public String getLmsRestApiToken() { + return lmsRestApiToken; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.seb_clientname") + public String getSebClientname() { + return sebClientname; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.548+01:00", comments="Source field: seb_lms_setup.seb_clientsecret") + public String getSebClientsecret() { + return sebClientsecret; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table seb_lms_setup + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", institutionId=").append(institutionId); + sb.append(", name=").append(name); + sb.append(", lmsType=").append(lmsType); + sb.append(", lmsUrl=").append(lmsUrl); + sb.append(", lmsClientname=").append(lmsClientname); + sb.append(", lmsClientsecret=").append(lmsClientsecret); + sb.append(", lmsRestApiToken=").append(lmsRestApiToken); + sb.append(", sebClientname=").append(sebClientname); + sb.append(", sebClientsecret=").append(sebClientsecret); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table seb_lms_setup + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SebLmsSetupRecord other = (SebLmsSetupRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getInstitutionId() == null ? other.getInstitutionId() == null : this.getInstitutionId().equals(other.getInstitutionId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getLmsType() == null ? other.getLmsType() == null : this.getLmsType().equals(other.getLmsType())) + && (this.getLmsUrl() == null ? other.getLmsUrl() == null : this.getLmsUrl().equals(other.getLmsUrl())) + && (this.getLmsClientname() == null ? other.getLmsClientname() == null : this.getLmsClientname().equals(other.getLmsClientname())) + && (this.getLmsClientsecret() == null ? other.getLmsClientsecret() == null : this.getLmsClientsecret().equals(other.getLmsClientsecret())) + && (this.getLmsRestApiToken() == null ? other.getLmsRestApiToken() == null : this.getLmsRestApiToken().equals(other.getLmsRestApiToken())) + && (this.getSebClientname() == null ? other.getSebClientname() == null : this.getSebClientname().equals(other.getSebClientname())) + && (this.getSebClientsecret() == null ? other.getSebClientsecret() == null : this.getSebClientsecret().equals(other.getSebClientsecret())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table seb_lms_setup + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getInstitutionId() == null) ? 0 : getInstitutionId().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getLmsType() == null) ? 0 : getLmsType().hashCode()); + result = prime * result + ((getLmsUrl() == null) ? 0 : getLmsUrl().hashCode()); + result = prime * result + ((getLmsClientname() == null) ? 0 : getLmsClientname().hashCode()); + result = prime * result + ((getLmsClientsecret() == null) ? 0 : getLmsClientsecret().hashCode()); + result = prime * result + ((getLmsRestApiToken() == null) ? 0 : getLmsRestApiToken().hashCode()); + result = prime * result + ((getSebClientname() == null) ? 0 : getSebClientname().hashCode()); + result = prime * result + ((getSebClientsecret() == null) ? 0 : getSebClientsecret().hashCode()); + return result; + } +} \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/UserRecord.java b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/UserRecord.java new file mode 100644 index 00000000..37fed70b --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/ws/batis/model/UserRecord.java @@ -0,0 +1,191 @@ +package ch.ethz.seb.sebserver.ws.batis.model; + +import javax.annotation.Generated; +import org.joda.time.DateTime; + +public class UserRecord { + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.id") + private Long id; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.institution_id") + private Long institutionId; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.uuid") + private String uuid; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.name") + private String name; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.user_name") + private String userName; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.password") + private String password; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.email") + private String email; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.creation_date") + private DateTime creationDate; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.active") + private Integer active; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.locale") + private String locale; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.timezone") + private String timezone; + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source Table: user") + public UserRecord(Long id, Long institutionId, String uuid, String name, String userName, String password, String email, DateTime creationDate, Integer active, String locale, String timezone) { + this.id = id; + this.institutionId = institutionId; + this.uuid = uuid; + this.name = name; + this.userName = userName; + this.password = password; + this.email = email; + this.creationDate = creationDate; + this.active = active; + this.locale = locale; + this.timezone = timezone; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.id") + public Long getId() { + return id; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.institution_id") + public Long getInstitutionId() { + return institutionId; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.uuid") + public String getUuid() { + return uuid; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.550+01:00", comments="Source field: user.name") + public String getName() { + return name; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.user_name") + public String getUserName() { + return userName; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.password") + public String getPassword() { + return password; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.email") + public String getEmail() { + return email; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.creation_date") + public DateTime getCreationDate() { + return creationDate; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.active") + public Integer getActive() { + return active; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.locale") + public String getLocale() { + return locale; + } + + @Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2018-11-12T16:16:23.551+01:00", comments="Source field: user.timezone") + public String getTimezone() { + return timezone; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", institutionId=").append(institutionId); + sb.append(", uuid=").append(uuid); + sb.append(", name=").append(name); + sb.append(", userName=").append(userName); + sb.append(", password=").append(password); + sb.append(", email=").append(email); + sb.append(", creationDate=").append(creationDate); + sb.append(", active=").append(active); + sb.append(", locale=").append(locale); + sb.append(", timezone=").append(timezone); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + UserRecord other = (UserRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getInstitutionId() == null ? other.getInstitutionId() == null : this.getInstitutionId().equals(other.getInstitutionId())) + && (this.getUuid() == null ? other.getUuid() == null : this.getUuid().equals(other.getUuid())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) + && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) + && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail())) + && (this.getCreationDate() == null ? other.getCreationDate() == null : this.getCreationDate().equals(other.getCreationDate())) + && (this.getActive() == null ? other.getActive() == null : this.getActive().equals(other.getActive())) + && (this.getLocale() == null ? other.getLocale() == null : this.getLocale().equals(other.getLocale())) + && (this.getTimezone() == null ? other.getTimezone() == null : this.getTimezone().equals(other.getTimezone())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table user + * + * @mbg.generated Mon Nov 12 16:16:23 CET 2018 + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getInstitutionId() == null) ? 0 : getInstitutionId().hashCode()); + result = prime * result + ((getUuid() == null) ? 0 : getUuid().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); + result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); + result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode()); + result = prime * result + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); + result = prime * result + ((getActive() == null) ? 0 : getActive().hashCode()); + result = prime * result + ((getLocale() == null) ? 0 : getLocale().hashCode()); + result = prime * result + ((getTimezone() == null) ? 0 : getTimezone().hashCode()); + return result; + } +} \ No newline at end of file