commit 770510fa4231ed65eac81f25484cf1d568b603bb Author: jotty Date: Mon Feb 4 12:17:31 2019 +0100 from branch of project todolist diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..c9a4de3 --- /dev/null +++ b/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc6e088 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.gradle/ +/bin/ +/build/ diff --git a/.project b/.project new file mode 100644 index 0000000..1109f4c --- /dev/null +++ b/.project @@ -0,0 +1,36 @@ + + + timetrack + track work times + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..3e0ca82 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +# +#Tue May 15 12:58:17 CEST 2018 +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..03283f6 --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..cea524a --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6dcaaa6 --- /dev/null +++ b/build.gradle @@ -0,0 +1,112 @@ +buildscript { + repositories { + mavenLocal() + mavenCentral() + maven { url "https://repo.maven.apache.org/maven2" } + maven { url "https://plugins.gradle.org/m2/" } + jcenter() + } + dependencies { + classpath 'com.google.code.gson:gson:2.8.5' + classpath 'org.jooq:jooq-codegen:3.11.9' + classpath 'org.postgresql:postgresql:42.2.5' + classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:latest.release' + classpath 'nu.studer:gradle-jooq-plugin:3.0.2' + } +} + +apply plugin: 'java' +apply plugin: 'maven' +apply plugin: 'war' +apply plugin: 'eclipse' +apply plugin: 'nu.studer.jooq' + +group = 'jottyfan' +version = '1.0.1' + +description = """timetrack""" + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + +repositories { + mavenLocal() + mavenCentral() + maven { url "http://jottyfan.de/mvnrepo" } + maven { url "https://repo.maven.apache.org/maven2" } +} + +dependencies { + compile 'org.apache.myfaces.core:myfaces-api:2.2.12' + compile 'org.apache.myfaces.core:myfaces-impl:2.2.12' + compile 'net.bootsfaces:bootsfaces:1.4.1' + compile 'de.jooqFaces:jooqFaces:0.1.3-SNAPSHOT' + compile 'org.postgresql:postgresql:42.2.5' + compile 'org.jooq:jooq:3.11.9' + compile 'org.jooq:jooq-codegen:3.11.9' + compile 'com.google.code.gson:gson:2.8.5' + compile 'org.jasypt:jasypt:1.9.2' + compile 'javax.servlet:javax.servlet-api:3.1.0' + compile 'org.apache.logging.log4j:log4j-core:2.11.1' + compile 'org.apache.logging.log4j:log4j-api:2.11.1' + + testCompile 'junit:junit:4.12' + + runtime 'org.postgresql:postgresql:42.2.5' + + jooqRuntime 'org.postgresql:postgresql:42.2.5' +} + +jooq { + edition = 'OSS' + version = '3.11.9' + timetrack (sourceSets.main) { + jdbc { + driver = 'org.postgresql.Driver' + url = 'jdbc:postgresql://localhost:5432/timetrack' + user = "jooq" + password = "" + } + generator { + name = 'org.jooq.codegen.DefaultGenerator' + database { + name = 'org.jooq.meta.postgres.PostgresDatabase' + schemata { + schema { + inputSchema = 'done' + } + schema { + inputSchema = 'profile' + } + schema { + inputSchema = 'contact' + } + schema { + inputSchema = 'note' + } + } + includes = '.*' + } + generate { + relations = true + records = true + } + target { + packageName = 'de.jottyfan.timetrack.db' + directory = 'src/jooq/java' + } + } + } +} + +war { + archiveName 'timetrack.war' +} +// removes the task dependency from compileJava to generateTimetrackJooqSchemaSource +project.tasks.getByName('compileJava').dependsOn -= 'generateTimetrackJooqSchemaSource' + + diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4453cce --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..5e245f0 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'timetrack' diff --git a/src/jooq/java/de/jottyfan/timetrack/db/DefaultCatalog.java b/src/jooq/java/de/jottyfan/timetrack/db/DefaultCatalog.java new file mode 100644 index 0000000..f5924f7 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/DefaultCatalog.java @@ -0,0 +1,83 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + +import de.jottyfan.timetrack.db.contact.Contact; +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.note.Note; +import de.jottyfan.timetrack.db.profile.Profile; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 2027686892; + + /** + * The reference instance of + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema contact. + */ + public final Contact CONTACT = de.jottyfan.timetrack.db.contact.Contact.CONTACT; + + /** + * The schema done. + */ + public final Done DONE = de.jottyfan.timetrack.db.done.Done.DONE; + + /** + * The schema note. + */ + public final Note NOTE = de.jottyfan.timetrack.db.note.Note.NOTE; + + /** + * The schema profile. + */ + public final Profile PROFILE = de.jottyfan.timetrack.db.profile.Profile.PROFILE; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + List result = new ArrayList(); + result.addAll(getSchemas0()); + return result; + } + + private final List getSchemas0() { + return Arrays.asList( + Contact.CONTACT, + Done.DONE, + Note.NOTE, + Profile.PROFILE); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/Contact.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/Contact.java new file mode 100644 index 0000000..dfc34f1 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/Contact.java @@ -0,0 +1,73 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import de.jottyfan.timetrack.db.DefaultCatalog; +import de.jottyfan.timetrack.db.contact.tables.TContact; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Contact extends SchemaImpl { + + private static final long serialVersionUID = -206762222; + + /** + * The reference instance of contact + */ + public static final Contact CONTACT = new Contact(); + + /** + * The table contact.t_contact. + */ + public final TContact T_CONTACT = de.jottyfan.timetrack.db.contact.tables.TContact.T_CONTACT; + + /** + * No further instances allowed + */ + private Contact() { + super("contact", null); + } + + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + TContact.T_CONTACT); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/Indexes.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/Indexes.java new file mode 100644 index 0000000..2e03647 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/Indexes.java @@ -0,0 +1,42 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact; + + +import javax.annotation.Generated; + +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.Internal; + +import de.jottyfan.timetrack.db.contact.tables.TContact; + + +/** + * A class modelling indexes of tables of the contact schema. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index T_CONTACT_PKEY = Indexes0.T_CONTACT_PKEY; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Indexes0 { + public static Index T_CONTACT_PKEY = Internal.createIndex("t_contact_pkey", TContact.T_CONTACT, new OrderField[] { TContact.T_CONTACT.PK }, true); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/Tables.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/Tables.java new file mode 100644 index 0000000..c187456 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/Tables.java @@ -0,0 +1,29 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact; + + +import javax.annotation.Generated; + +import de.jottyfan.timetrack.db.contact.tables.TContact; + + +/** + * Convenience access to all tables in contact + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Tables { + + /** + * The table contact.t_contact. + */ + public static final TContact T_CONTACT = de.jottyfan.timetrack.db.contact.tables.TContact.T_CONTACT; +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/enums/EnumContacttype.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/enums/EnumContacttype.java new file mode 100644 index 0000000..532ee5d --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/enums/EnumContacttype.java @@ -0,0 +1,76 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact.enums; + + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +import de.jottyfan.timetrack.db.contact.Contact; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public enum EnumContacttype implements EnumType { + + privat("privat"), + + mobil("mobil"), + + dienstlich("dienstlich"), + + E_Mail("E-Mail"), + + Skype("Skype"); + + private final String literal; + + private EnumContacttype(String literal) { + this.literal = literal; + } + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Contact.CONTACT; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "enum_contacttype"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getLiteral() { + return literal; + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/TContact.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/TContact.java new file mode 100644 index 0000000..f0902ee --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/TContact.java @@ -0,0 +1,162 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact.tables; + + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.contact.Contact; +import de.jottyfan.timetrack.db.contact.Indexes; +import de.jottyfan.timetrack.db.contact.enums.EnumContacttype; +import de.jottyfan.timetrack.db.contact.tables.records.TContactRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TContact extends TableImpl { + + private static final long serialVersionUID = 1349495675; + + /** + * The reference instance of contact.t_contact + */ + public static final TContact T_CONTACT = new TContact(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TContactRecord.class; + } + + /** + * The column contact.t_contact.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column contact.t_contact.forename. + */ + public final TableField FORENAME = createField("forename", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column contact.t_contact.surname. + */ + public final TableField SURNAME = createField("surname", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column contact.t_contact.contact. + */ + public final TableField CONTACT = createField("contact", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column contact.t_contact.type. + */ + public final TableField TYPE = createField("type", org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(de.jottyfan.timetrack.db.contact.enums.EnumContacttype.class), this, ""); + + /** + * Create a contact.t_contact table reference + */ + public TContact() { + this(DSL.name("t_contact"), null); + } + + /** + * Create an aliased contact.t_contact table reference + */ + public TContact(String alias) { + this(DSL.name(alias), T_CONTACT); + } + + /** + * Create an aliased contact.t_contact table reference + */ + public TContact(Name alias) { + this(alias, T_CONTACT); + } + + private TContact(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TContact(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TContact(Table child, ForeignKey key) { + super(child, key, T_CONTACT); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Contact.CONTACT; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_CONTACT_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TContact as(String alias) { + return new TContact(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TContact as(Name alias) { + return new TContact(alias, this); + } + + /** + * Rename this table + */ + @Override + public TContact rename(String name) { + return new TContact(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TContact rename(Name name) { + return new TContact(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/records/TContactRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/records/TContactRecord.java new file mode 100644 index 0000000..17cd523 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/contact/tables/records/TContactRecord.java @@ -0,0 +1,324 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.contact.tables.records; + + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.contact.enums.EnumContacttype; +import de.jottyfan.timetrack.db.contact.tables.TContact; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TContactRecord extends TableRecordImpl implements Record5 { + + private static final long serialVersionUID = 815817311; + + /** + * Setter for contact.t_contact.pk. + */ + public void setPk(Integer value) { + set(0, value); + } + + /** + * Getter for contact.t_contact.pk. + */ + public Integer getPk() { + return (Integer) get(0); + } + + /** + * Setter for contact.t_contact.forename. + */ + public void setForename(String value) { + set(1, value); + } + + /** + * Getter for contact.t_contact.forename. + */ + public String getForename() { + return (String) get(1); + } + + /** + * Setter for contact.t_contact.surname. + */ + public void setSurname(String value) { + set(2, value); + } + + /** + * Getter for contact.t_contact.surname. + */ + public String getSurname() { + return (String) get(2); + } + + /** + * Setter for contact.t_contact.contact. + */ + public void setContact(String value) { + set(3, value); + } + + /** + * Getter for contact.t_contact.contact. + */ + public String getContact() { + return (String) get(3); + } + + /** + * Setter for contact.t_contact.type. + */ + public void setType(EnumContacttype value) { + set(4, value); + } + + /** + * Getter for contact.t_contact.type. + */ + public EnumContacttype getType() { + return (EnumContacttype) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TContact.T_CONTACT.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TContact.T_CONTACT.FORENAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TContact.T_CONTACT.SURNAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return TContact.T_CONTACT.CONTACT; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return TContact.T_CONTACT.TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component1() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component2() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component4() { + return getContact(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumContacttype component5() { + return getType(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value1() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getContact(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumContacttype value5() { + return getType(); + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord value1(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord value2(String value) { + setForename(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord value3(String value) { + setSurname(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord value4(String value) { + setContact(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord value5(EnumContacttype value) { + setType(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TContactRecord values(Integer value1, String value2, String value3, String value4, EnumContacttype value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TContactRecord + */ + public TContactRecord() { + super(TContact.T_CONTACT); + } + + /** + * Create a detached, initialised TContactRecord + */ + public TContactRecord(Integer pk, String forename, String surname, String contact, EnumContacttype type) { + super(TContact.T_CONTACT); + + set(0, pk); + set(1, forename); + set(2, surname); + set(3, contact); + set(4, type); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java new file mode 100644 index 0000000..5cbc150 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java @@ -0,0 +1,108 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import de.jottyfan.timetrack.db.DefaultCatalog; +import de.jottyfan.timetrack.db.done.tables.TDone; +import de.jottyfan.timetrack.db.done.tables.TJob; +import de.jottyfan.timetrack.db.done.tables.TModule; +import de.jottyfan.timetrack.db.done.tables.TProject; +import de.jottyfan.timetrack.db.done.tables.VTasklist; +import de.jottyfan.timetrack.db.done.tables.VTotalofday; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Done extends SchemaImpl { + + private static final long serialVersionUID = 1049524459; + + /** + * The reference instance of done + */ + public static final Done DONE = new Done(); + + /** + * The table done.t_done. + */ + public final TDone T_DONE = de.jottyfan.timetrack.db.done.tables.TDone.T_DONE; + + /** + * The table done.t_job. + */ + public final TJob T_JOB = de.jottyfan.timetrack.db.done.tables.TJob.T_JOB; + + /** + * The table done.t_module. + */ + public final TModule T_MODULE = de.jottyfan.timetrack.db.done.tables.TModule.T_MODULE; + + /** + * The table done.t_project. + */ + public final TProject T_PROJECT = de.jottyfan.timetrack.db.done.tables.TProject.T_PROJECT; + + /** + * The table done.v_tasklist. + */ + public final VTasklist V_TASKLIST = de.jottyfan.timetrack.db.done.tables.VTasklist.V_TASKLIST; + + /** + * The table done.v_totalofday. + */ + public final VTotalofday V_TOTALOFDAY = de.jottyfan.timetrack.db.done.tables.VTotalofday.V_TOTALOFDAY; + + /** + * No further instances allowed + */ + private Done() { + super("done", null); + } + + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + TDone.T_DONE, + TJob.T_JOB, + TModule.T_MODULE, + TProject.T_PROJECT, + VTasklist.V_TASKLIST, + VTotalofday.V_TOTALOFDAY); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Indexes.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Indexes.java new file mode 100644 index 0000000..aff8631 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Indexes.java @@ -0,0 +1,57 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done; + + +import javax.annotation.Generated; + +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.Internal; + +import de.jottyfan.timetrack.db.done.tables.TDone; +import de.jottyfan.timetrack.db.done.tables.TJob; +import de.jottyfan.timetrack.db.done.tables.TModule; +import de.jottyfan.timetrack.db.done.tables.TProject; + + +/** + * A class modelling indexes of tables of the done schema. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index T_DONE_PKEY = Indexes0.T_DONE_PKEY; + public static final Index T_CATEGORY_NAME_KEY = Indexes0.T_CATEGORY_NAME_KEY; + public static final Index T_CATEGORY_PKEY = Indexes0.T_CATEGORY_PKEY; + public static final Index T_JOB_NAME_KEY = Indexes0.T_JOB_NAME_KEY; + public static final Index T_JOB_PKEY = Indexes0.T_JOB_PKEY; + public static final Index T_PROJECT_NAME_KEY = Indexes0.T_PROJECT_NAME_KEY; + public static final Index T_PROJECT_PKEY = Indexes0.T_PROJECT_PKEY; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Indexes0 { + public static Index T_DONE_PKEY = Internal.createIndex("t_done_pkey", TDone.T_DONE, new OrderField[] { TDone.T_DONE.PK }, true); + public static Index T_CATEGORY_NAME_KEY = Internal.createIndex("t_category_name_key", TJob.T_JOB, new OrderField[] { TJob.T_JOB.NAME }, true); + public static Index T_CATEGORY_PKEY = Internal.createIndex("t_category_pkey", TJob.T_JOB, new OrderField[] { TJob.T_JOB.PK }, true); + public static Index T_JOB_NAME_KEY = Internal.createIndex("t_job_name_key", TModule.T_MODULE, new OrderField[] { TModule.T_MODULE.NAME }, true); + public static Index T_JOB_PKEY = Internal.createIndex("t_job_pkey", TModule.T_MODULE, new OrderField[] { TModule.T_MODULE.PK }, true); + public static Index T_PROJECT_NAME_KEY = Internal.createIndex("t_project_name_key", TProject.T_PROJECT, new OrderField[] { TProject.T_PROJECT.NAME }, true); + public static Index T_PROJECT_PKEY = Internal.createIndex("t_project_pkey", TProject.T_PROJECT, new OrderField[] { TProject.T_PROJECT.PK }, true); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java new file mode 100644 index 0000000..00e47b8 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java @@ -0,0 +1,59 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done; + + +import javax.annotation.Generated; + +import de.jottyfan.timetrack.db.done.tables.TDone; +import de.jottyfan.timetrack.db.done.tables.TJob; +import de.jottyfan.timetrack.db.done.tables.TModule; +import de.jottyfan.timetrack.db.done.tables.TProject; +import de.jottyfan.timetrack.db.done.tables.VTasklist; +import de.jottyfan.timetrack.db.done.tables.VTotalofday; + + +/** + * Convenience access to all tables in done + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Tables { + + /** + * The table done.t_done. + */ + public static final TDone T_DONE = de.jottyfan.timetrack.db.done.tables.TDone.T_DONE; + + /** + * The table done.t_job. + */ + public static final TJob T_JOB = de.jottyfan.timetrack.db.done.tables.TJob.T_JOB; + + /** + * The table done.t_module. + */ + public static final TModule T_MODULE = de.jottyfan.timetrack.db.done.tables.TModule.T_MODULE; + + /** + * The table done.t_project. + */ + public static final TProject T_PROJECT = de.jottyfan.timetrack.db.done.tables.TProject.T_PROJECT; + + /** + * The table done.v_tasklist. + */ + public static final VTasklist V_TASKLIST = de.jottyfan.timetrack.db.done.tables.VTasklist.V_TASKLIST; + + /** + * The table done.v_totalofday. + */ + public static final VTotalofday V_TOTALOFDAY = de.jottyfan.timetrack.db.done.tables.VTotalofday.V_TOTALOFDAY; +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java new file mode 100644 index 0000000..7685de4 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java @@ -0,0 +1,177 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.Indexes; +import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TDone extends TableImpl { + + private static final long serialVersionUID = 47529789; + + /** + * The reference instance of done.t_done + */ + public static final TDone T_DONE = new TDone(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TDoneRecord.class; + } + + /** + * The column done.t_done.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column done.t_done.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column done.t_done.time_from. + */ + public final TableField TIME_FROM = createField("time_from", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column done.t_done.time_until. + */ + public final TableField TIME_UNTIL = createField("time_until", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column done.t_done.fk_project. + */ + public final TableField FK_PROJECT = createField("fk_project", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column done.t_done.fk_module. + */ + public final TableField FK_MODULE = createField("fk_module", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column done.t_done.fk_job. + */ + public final TableField FK_JOB = createField("fk_job", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column done.t_done.fk_login. + */ + public final TableField FK_LOGIN = createField("fk_login", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a done.t_done table reference + */ + public TDone() { + this(DSL.name("t_done"), null); + } + + /** + * Create an aliased done.t_done table reference + */ + public TDone(String alias) { + this(DSL.name(alias), T_DONE); + } + + /** + * Create an aliased done.t_done table reference + */ + public TDone(Name alias) { + this(alias, T_DONE); + } + + private TDone(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TDone(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TDone(Table child, ForeignKey key) { + super(child, key, T_DONE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_DONE_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TDone as(String alias) { + return new TDone(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TDone as(Name alias) { + return new TDone(alias, this); + } + + /** + * Rename this table + */ + @Override + public TDone rename(String name) { + return new TDone(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TDone rename(Name name) { + return new TDone(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TJob.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TJob.java new file mode 100644 index 0000000..c407a6b --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TJob.java @@ -0,0 +1,152 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.Indexes; +import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TJob extends TableImpl { + + private static final long serialVersionUID = -1617909635; + + /** + * The reference instance of done.t_job + */ + public static final TJob T_JOB = new TJob(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TJobRecord.class; + } + + /** + * The column done.t_job.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column done.t_job.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column done.t_job.name. + */ + public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a done.t_job table reference + */ + public TJob() { + this(DSL.name("t_job"), null); + } + + /** + * Create an aliased done.t_job table reference + */ + public TJob(String alias) { + this(DSL.name(alias), T_JOB); + } + + /** + * Create an aliased done.t_job table reference + */ + public TJob(Name alias) { + this(alias, T_JOB); + } + + private TJob(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TJob(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TJob(Table child, ForeignKey key) { + super(child, key, T_JOB); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_CATEGORY_NAME_KEY, Indexes.T_CATEGORY_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TJob as(String alias) { + return new TJob(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TJob as(Name alias) { + return new TJob(alias, this); + } + + /** + * Rename this table + */ + @Override + public TJob rename(String name) { + return new TJob(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TJob rename(Name name) { + return new TJob(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TModule.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TModule.java new file mode 100644 index 0000000..37692dd --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TModule.java @@ -0,0 +1,152 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.Indexes; +import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TModule extends TableImpl { + + private static final long serialVersionUID = -173305798; + + /** + * The reference instance of done.t_module + */ + public static final TModule T_MODULE = new TModule(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TModuleRecord.class; + } + + /** + * The column done.t_module.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column done.t_module.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column done.t_module.name. + */ + public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a done.t_module table reference + */ + public TModule() { + this(DSL.name("t_module"), null); + } + + /** + * Create an aliased done.t_module table reference + */ + public TModule(String alias) { + this(DSL.name(alias), T_MODULE); + } + + /** + * Create an aliased done.t_module table reference + */ + public TModule(Name alias) { + this(alias, T_MODULE); + } + + private TModule(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TModule(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TModule(Table child, ForeignKey key) { + super(child, key, T_MODULE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_JOB_NAME_KEY, Indexes.T_JOB_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TModule as(String alias) { + return new TModule(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TModule as(Name alias) { + return new TModule(alias, this); + } + + /** + * Rename this table + */ + @Override + public TModule rename(String name) { + return new TModule(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TModule rename(Name name) { + return new TModule(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TProject.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TProject.java new file mode 100644 index 0000000..68ab7f8 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TProject.java @@ -0,0 +1,152 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.Indexes; +import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TProject extends TableImpl { + + private static final long serialVersionUID = -1855268291; + + /** + * The reference instance of done.t_project + */ + public static final TProject T_PROJECT = new TProject(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TProjectRecord.class; + } + + /** + * The column done.t_project.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column done.t_project.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column done.t_project.name. + */ + public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a done.t_project table reference + */ + public TProject() { + this(DSL.name("t_project"), null); + } + + /** + * Create an aliased done.t_project table reference + */ + public TProject(String alias) { + this(DSL.name(alias), T_PROJECT); + } + + /** + * Create an aliased done.t_project table reference + */ + public TProject(Name alias) { + this(alias, T_PROJECT); + } + + private TProject(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TProject(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TProject(Table child, ForeignKey key) { + super(child, key, T_PROJECT); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_PROJECT_NAME_KEY, Indexes.T_PROJECT_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TProject as(String alias) { + return new TProject(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TProject as(Name alias) { + return new TProject(alias, this); + } + + /** + * Rename this table + */ + @Override + public TProject rename(String name) { + return new TProject(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TProject rename(Name name) { + return new TProject(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTasklist.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTasklist.java new file mode 100644 index 0000000..32dbfd8 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTasklist.java @@ -0,0 +1,153 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.tables.records.VTasklistRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VTasklist extends TableImpl { + + private static final long serialVersionUID = -1582867869; + + /** + * The reference instance of done.v_tasklist + */ + public static final VTasklist V_TASKLIST = new VTasklist(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return VTasklistRecord.class; + } + + /** + * The column done.v_tasklist.day. + */ + public final TableField DAY = createField("day", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_tasklist.duration. + */ + public final TableField DURATION = createField("duration", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_tasklist.project_name. + */ + public final TableField PROJECT_NAME = createField("project_name", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_tasklist.module_name. + */ + public final TableField MODULE_NAME = createField("module_name", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_tasklist.job_name. + */ + public final TableField JOB_NAME = createField("job_name", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_tasklist.fk_login. + */ + public final TableField FK_LOGIN = createField("fk_login", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * Create a done.v_tasklist table reference + */ + public VTasklist() { + this(DSL.name("v_tasklist"), null); + } + + /** + * Create an aliased done.v_tasklist table reference + */ + public VTasklist(String alias) { + this(DSL.name(alias), V_TASKLIST); + } + + /** + * Create an aliased done.v_tasklist table reference + */ + public VTasklist(Name alias) { + this(alias, V_TASKLIST); + } + + private VTasklist(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private VTasklist(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public VTasklist(Table child, ForeignKey key) { + super(child, key, V_TASKLIST); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklist as(String alias) { + return new VTasklist(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklist as(Name alias) { + return new VTasklist(alias, this); + } + + /** + * Rename this table + */ + @Override + public VTasklist rename(String name) { + return new VTasklist(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public VTasklist rename(Name name) { + return new VTasklist(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTotalofday.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTotalofday.java new file mode 100644 index 0000000..9e6b0b1 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VTotalofday.java @@ -0,0 +1,153 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.tables.records.VTotalofdayRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VTotalofday extends TableImpl { + + private static final long serialVersionUID = -893085978; + + /** + * The reference instance of done.v_totalofday + */ + public static final VTotalofday V_TOTALOFDAY = new VTotalofday(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return VTotalofdayRecord.class; + } + + /** + * The column done.v_totalofday.breaktime. + */ + public final TableField BREAKTIME = createField("breaktime", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_totalofday.worktime. + */ + public final TableField WORKTIME = createField("worktime", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_totalofday.starttime. + */ + public final TableField STARTTIME = createField("starttime", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_totalofday.endtime. + */ + public final TableField ENDTIME = createField("endtime", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_totalofday.day. + */ + public final TableField DAY = createField("day", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column done.v_totalofday.fk_login. + */ + public final TableField FK_LOGIN = createField("fk_login", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * Create a done.v_totalofday table reference + */ + public VTotalofday() { + this(DSL.name("v_totalofday"), null); + } + + /** + * Create an aliased done.v_totalofday table reference + */ + public VTotalofday(String alias) { + this(DSL.name(alias), V_TOTALOFDAY); + } + + /** + * Create an aliased done.v_totalofday table reference + */ + public VTotalofday(Name alias) { + this(alias, V_TOTALOFDAY); + } + + private VTotalofday(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private VTotalofday(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public VTotalofday(Table child, ForeignKey key) { + super(child, key, V_TOTALOFDAY); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Done.DONE; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofday as(String alias) { + return new VTotalofday(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofday as(Name alias) { + return new VTotalofday(alias, this); + } + + /** + * Rename this table + */ + @Override + public VTotalofday rename(String name) { + return new VTotalofday(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public VTotalofday rename(Name name) { + return new VTotalofday(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java new file mode 100644 index 0000000..a54d495 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java @@ -0,0 +1,472 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record8; +import org.jooq.Row8; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.TDone; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TDoneRecord extends TableRecordImpl implements Record8 { + + private static final long serialVersionUID = 626421558; + + /** + * Setter for done.t_done.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for done.t_done.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for done.t_done.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for done.t_done.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for done.t_done.time_from. + */ + public void setTimeFrom(Timestamp value) { + set(2, value); + } + + /** + * Getter for done.t_done.time_from. + */ + public Timestamp getTimeFrom() { + return (Timestamp) get(2); + } + + /** + * Setter for done.t_done.time_until. + */ + public void setTimeUntil(Timestamp value) { + set(3, value); + } + + /** + * Getter for done.t_done.time_until. + */ + public Timestamp getTimeUntil() { + return (Timestamp) get(3); + } + + /** + * Setter for done.t_done.fk_project. + */ + public void setFkProject(Integer value) { + set(4, value); + } + + /** + * Getter for done.t_done.fk_project. + */ + public Integer getFkProject() { + return (Integer) get(4); + } + + /** + * Setter for done.t_done.fk_module. + */ + public void setFkModule(Integer value) { + set(5, value); + } + + /** + * Getter for done.t_done.fk_module. + */ + public Integer getFkModule() { + return (Integer) get(5); + } + + /** + * Setter for done.t_done.fk_job. + */ + public void setFkJob(Integer value) { + set(6, value); + } + + /** + * Getter for done.t_done.fk_job. + */ + public Integer getFkJob() { + return (Integer) get(6); + } + + /** + * Setter for done.t_done.fk_login. + */ + public void setFkLogin(Integer value) { + set(7, value); + } + + /** + * Getter for done.t_done.fk_login. + */ + public Integer getFkLogin() { + return (Integer) get(7); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TDone.T_DONE.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TDone.T_DONE.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TDone.T_DONE.TIME_FROM; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return TDone.T_DONE.TIME_UNTIL; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return TDone.T_DONE.FK_PROJECT; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return TDone.T_DONE.FK_MODULE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field7() { + return TDone.T_DONE.FK_JOB; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field8() { + return TDone.T_DONE.FK_LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component3() { + return getTimeFrom(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component4() { + return getTimeUntil(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component5() { + return getFkProject(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component6() { + return getFkModule(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component7() { + return getFkJob(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component8() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value3() { + return getTimeFrom(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value4() { + return getTimeUntil(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value5() { + return getFkProject(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value6() { + return getFkModule(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value7() { + return getFkJob(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value8() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value3(Timestamp value) { + setTimeFrom(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value4(Timestamp value) { + setTimeUntil(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value5(Integer value) { + setFkProject(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value6(Integer value) { + setFkModule(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value7(Integer value) { + setFkJob(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord value8(Integer value) { + setFkLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TDoneRecord values(Timestamp value1, Integer value2, Timestamp value3, Timestamp value4, Integer value5, Integer value6, Integer value7, Integer value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TDoneRecord + */ + public TDoneRecord() { + super(TDone.T_DONE); + } + + /** + * Create a detached, initialised TDoneRecord + */ + public TDoneRecord(Timestamp lastchange, Integer pk, Timestamp timeFrom, Timestamp timeUntil, Integer fkProject, Integer fkModule, Integer fkJob, Integer fkLogin) { + super(TDone.T_DONE); + + set(0, lastchange); + set(1, pk); + set(2, timeFrom); + set(3, timeUntil); + set(4, fkProject); + set(5, fkModule); + set(6, fkJob); + set(7, fkLogin); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TJobRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TJobRecord.java new file mode 100644 index 0000000..84fcbdf --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TJobRecord.java @@ -0,0 +1,227 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.TJob; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TJobRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 2822323; + + /** + * Setter for done.t_job.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for done.t_job.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for done.t_job.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for done.t_job.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for done.t_job.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for done.t_job.name. + */ + public String getName() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TJob.T_JOB.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TJob.T_JOB.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TJob.T_JOB.NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public TJobRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TJobRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TJobRecord value3(String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TJobRecord values(Timestamp value1, Integer value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TJobRecord + */ + public TJobRecord() { + super(TJob.T_JOB); + } + + /** + * Create a detached, initialised TJobRecord + */ + public TJobRecord(Timestamp lastchange, Integer pk, String name) { + super(TJob.T_JOB); + + set(0, lastchange); + set(1, pk); + set(2, name); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TModuleRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TModuleRecord.java new file mode 100644 index 0000000..a40aed7 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TModuleRecord.java @@ -0,0 +1,227 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.TModule; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TModuleRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1076253804; + + /** + * Setter for done.t_module.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for done.t_module.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for done.t_module.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for done.t_module.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for done.t_module.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for done.t_module.name. + */ + public String getName() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TModule.T_MODULE.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TModule.T_MODULE.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TModule.T_MODULE.NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public TModuleRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TModuleRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TModuleRecord value3(String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TModuleRecord values(Timestamp value1, Integer value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TModuleRecord + */ + public TModuleRecord() { + super(TModule.T_MODULE); + } + + /** + * Create a detached, initialised TModuleRecord + */ + public TModuleRecord(Timestamp lastchange, Integer pk, String name) { + super(TModule.T_MODULE); + + set(0, lastchange); + set(1, pk); + set(2, name); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TProjectRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TProjectRecord.java new file mode 100644 index 0000000..f9ef8d9 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TProjectRecord.java @@ -0,0 +1,227 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.TProject; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TProjectRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1558586881; + + /** + * Setter for done.t_project.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for done.t_project.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for done.t_project.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for done.t_project.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for done.t_project.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for done.t_project.name. + */ + public String getName() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TProject.T_PROJECT.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TProject.T_PROJECT.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TProject.T_PROJECT.NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public TProjectRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TProjectRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TProjectRecord value3(String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TProjectRecord values(Timestamp value1, Integer value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TProjectRecord + */ + public TProjectRecord() { + super(TProject.T_PROJECT); + } + + /** + * Create a detached, initialised TProjectRecord + */ + public TProjectRecord(Timestamp lastchange, Integer pk, String name) { + super(TProject.T_PROJECT); + + set(0, lastchange); + set(1, pk); + set(2, name); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTasklistRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTasklistRecord.java new file mode 100644 index 0000000..756af8c --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTasklistRecord.java @@ -0,0 +1,372 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.VTasklist; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VTasklistRecord extends TableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1829630400; + + /** + * Setter for done.v_tasklist.day. + */ + public void setDay(String value) { + set(0, value); + } + + /** + * Getter for done.v_tasklist.day. + */ + public String getDay() { + return (String) get(0); + } + + /** + * Setter for done.v_tasklist.duration. + */ + public void setDuration(String value) { + set(1, value); + } + + /** + * Getter for done.v_tasklist.duration. + */ + public String getDuration() { + return (String) get(1); + } + + /** + * Setter for done.v_tasklist.project_name. + */ + public void setProjectName(String value) { + set(2, value); + } + + /** + * Getter for done.v_tasklist.project_name. + */ + public String getProjectName() { + return (String) get(2); + } + + /** + * Setter for done.v_tasklist.module_name. + */ + public void setModuleName(String value) { + set(3, value); + } + + /** + * Getter for done.v_tasklist.module_name. + */ + public String getModuleName() { + return (String) get(3); + } + + /** + * Setter for done.v_tasklist.job_name. + */ + public void setJobName(String value) { + set(4, value); + } + + /** + * Getter for done.v_tasklist.job_name. + */ + public String getJobName() { + return (String) get(4); + } + + /** + * Setter for done.v_tasklist.fk_login. + */ + public void setFkLogin(Integer value) { + set(5, value); + } + + /** + * Getter for done.v_tasklist.fk_login. + */ + public Integer getFkLogin() { + return (Integer) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return VTasklist.V_TASKLIST.DAY; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return VTasklist.V_TASKLIST.DURATION; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return VTasklist.V_TASKLIST.PROJECT_NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return VTasklist.V_TASKLIST.MODULE_NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return VTasklist.V_TASKLIST.JOB_NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return VTasklist.V_TASKLIST.FK_LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public String component1() { + return getDay(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component2() { + return getDuration(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getProjectName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component4() { + return getModuleName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component5() { + return getJobName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component6() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value1() { + return getDay(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getDuration(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getProjectName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getModuleName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getJobName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value6() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value1(String value) { + setDay(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value2(String value) { + setDuration(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value3(String value) { + setProjectName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value4(String value) { + setModuleName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value5(String value) { + setJobName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord value6(Integer value) { + setFkLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTasklistRecord values(String value1, String value2, String value3, String value4, String value5, Integer value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached VTasklistRecord + */ + public VTasklistRecord() { + super(VTasklist.V_TASKLIST); + } + + /** + * Create a detached, initialised VTasklistRecord + */ + public VTasklistRecord(String day, String duration, String projectName, String moduleName, String jobName, Integer fkLogin) { + super(VTasklist.V_TASKLIST); + + set(0, day); + set(1, duration); + set(2, projectName); + set(3, moduleName); + set(4, jobName); + set(5, fkLogin); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTotalofdayRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTotalofdayRecord.java new file mode 100644 index 0000000..82cb495 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VTotalofdayRecord.java @@ -0,0 +1,372 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.done.tables.VTotalofday; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VTotalofdayRecord extends TableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1188298937; + + /** + * Setter for done.v_totalofday.breaktime. + */ + public void setBreaktime(String value) { + set(0, value); + } + + /** + * Getter for done.v_totalofday.breaktime. + */ + public String getBreaktime() { + return (String) get(0); + } + + /** + * Setter for done.v_totalofday.worktime. + */ + public void setWorktime(String value) { + set(1, value); + } + + /** + * Getter for done.v_totalofday.worktime. + */ + public String getWorktime() { + return (String) get(1); + } + + /** + * Setter for done.v_totalofday.starttime. + */ + public void setStarttime(String value) { + set(2, value); + } + + /** + * Getter for done.v_totalofday.starttime. + */ + public String getStarttime() { + return (String) get(2); + } + + /** + * Setter for done.v_totalofday.endtime. + */ + public void setEndtime(String value) { + set(3, value); + } + + /** + * Getter for done.v_totalofday.endtime. + */ + public String getEndtime() { + return (String) get(3); + } + + /** + * Setter for done.v_totalofday.day. + */ + public void setDay(String value) { + set(4, value); + } + + /** + * Getter for done.v_totalofday.day. + */ + public String getDay() { + return (String) get(4); + } + + /** + * Setter for done.v_totalofday.fk_login. + */ + public void setFkLogin(Integer value) { + set(5, value); + } + + /** + * Getter for done.v_totalofday.fk_login. + */ + public Integer getFkLogin() { + return (Integer) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return VTotalofday.V_TOTALOFDAY.BREAKTIME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return VTotalofday.V_TOTALOFDAY.WORKTIME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return VTotalofday.V_TOTALOFDAY.STARTTIME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return VTotalofday.V_TOTALOFDAY.ENDTIME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return VTotalofday.V_TOTALOFDAY.DAY; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return VTotalofday.V_TOTALOFDAY.FK_LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public String component1() { + return getBreaktime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component2() { + return getWorktime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getStarttime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component4() { + return getEndtime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component5() { + return getDay(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component6() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value1() { + return getBreaktime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getWorktime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getStarttime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getEndtime(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getDay(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value6() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value1(String value) { + setBreaktime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value2(String value) { + setWorktime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value3(String value) { + setStarttime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value4(String value) { + setEndtime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value5(String value) { + setDay(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord value6(Integer value) { + setFkLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VTotalofdayRecord values(String value1, String value2, String value3, String value4, String value5, Integer value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached VTotalofdayRecord + */ + public VTotalofdayRecord() { + super(VTotalofday.V_TOTALOFDAY); + } + + /** + * Create a detached, initialised VTotalofdayRecord + */ + public VTotalofdayRecord(String breaktime, String worktime, String starttime, String endtime, String day, Integer fkLogin) { + super(VTotalofday.V_TOTALOFDAY); + + set(0, breaktime); + set(1, worktime); + set(2, starttime); + set(3, endtime); + set(4, day); + set(5, fkLogin); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/Indexes.java b/src/jooq/java/de/jottyfan/timetrack/db/note/Indexes.java new file mode 100644 index 0000000..1e7682d --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/Indexes.java @@ -0,0 +1,42 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note; + + +import javax.annotation.Generated; + +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.Internal; + +import de.jottyfan.timetrack.db.note.tables.TNote; + + +/** + * A class modelling indexes of tables of the note schema. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index T_NOTE_PKEY = Indexes0.T_NOTE_PKEY; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Indexes0 { + public static Index T_NOTE_PKEY = Internal.createIndex("t_note_pkey", TNote.T_NOTE, new OrderField[] { TNote.T_NOTE.PK }, true); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/Note.java b/src/jooq/java/de/jottyfan/timetrack/db/note/Note.java new file mode 100644 index 0000000..f8b20e8 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/Note.java @@ -0,0 +1,73 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import de.jottyfan.timetrack.db.DefaultCatalog; +import de.jottyfan.timetrack.db.note.tables.TNote; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Note extends SchemaImpl { + + private static final long serialVersionUID = -1806178126; + + /** + * The reference instance of note + */ + public static final Note NOTE = new Note(); + + /** + * The table note.t_note. + */ + public final TNote T_NOTE = de.jottyfan.timetrack.db.note.tables.TNote.T_NOTE; + + /** + * No further instances allowed + */ + private Note() { + super("note", null); + } + + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + TNote.T_NOTE); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/Tables.java b/src/jooq/java/de/jottyfan/timetrack/db/note/Tables.java new file mode 100644 index 0000000..9aac9ab --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/Tables.java @@ -0,0 +1,29 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note; + + +import javax.annotation.Generated; + +import de.jottyfan.timetrack.db.note.tables.TNote; + + +/** + * Convenience access to all tables in note + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Tables { + + /** + * The table note.t_note. + */ + public static final TNote T_NOTE = de.jottyfan.timetrack.db.note.tables.TNote.T_NOTE; +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumCategory.java b/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumCategory.java new file mode 100644 index 0000000..f9d8a56 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumCategory.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note.enums; + + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +import de.jottyfan.timetrack.db.note.Note; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public enum EnumCategory implements EnumType { + + PostgreSQL("PostgreSQL"), + + R("R"), + + Bootsfaces("Bootsfaces"), + + MyFaces("MyFaces"), + + Java("Java"), + + Bash("Bash"), + + Apache("Apache"), + + Tomcat("Tomcat"); + + private final String literal; + + private EnumCategory(String literal) { + this.literal = literal; + } + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Note.NOTE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "enum_category"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getLiteral() { + return literal; + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumNotetype.java b/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumNotetype.java new file mode 100644 index 0000000..06bf6d2 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/enums/EnumNotetype.java @@ -0,0 +1,70 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note.enums; + + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + +import de.jottyfan.timetrack.db.note.Note; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public enum EnumNotetype implements EnumType { + + Administration("Administration"), + + HowTo("HowTo"); + + private final String literal; + + private EnumNotetype(String literal) { + this.literal = literal; + } + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Note.NOTE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "enum_notetype"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getLiteral() { + return literal; + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/tables/TNote.java b/src/jooq/java/de/jottyfan/timetrack/db/note/tables/TNote.java new file mode 100644 index 0000000..b1d04d2 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/tables/TNote.java @@ -0,0 +1,169 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.note.Indexes; +import de.jottyfan.timetrack.db.note.Note; +import de.jottyfan.timetrack.db.note.enums.EnumCategory; +import de.jottyfan.timetrack.db.note.enums.EnumNotetype; +import de.jottyfan.timetrack.db.note.tables.records.TNoteRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TNote extends TableImpl { + + private static final long serialVersionUID = -505401304; + + /** + * The reference instance of note.t_note + */ + public static final TNote T_NOTE = new TNote(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TNoteRecord.class; + } + + /** + * The column note.t_note.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column note.t_note.title. + */ + public final TableField TITLE = createField("title", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column note.t_note.category. + */ + public final TableField CATEGORY = createField("category", org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(de.jottyfan.timetrack.db.note.enums.EnumCategory.class), this, ""); + + /** + * The column note.t_note.notetype. + */ + public final TableField NOTETYPE = createField("notetype", org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(de.jottyfan.timetrack.db.note.enums.EnumNotetype.class), this, ""); + + /** + * The column note.t_note.content. + */ + public final TableField CONTENT = createField("content", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column note.t_note.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * Create a note.t_note table reference + */ + public TNote() { + this(DSL.name("t_note"), null); + } + + /** + * Create an aliased note.t_note table reference + */ + public TNote(String alias) { + this(DSL.name(alias), T_NOTE); + } + + /** + * Create an aliased note.t_note table reference + */ + public TNote(Name alias) { + this(alias, T_NOTE); + } + + private TNote(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TNote(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TNote(Table child, ForeignKey key) { + super(child, key, T_NOTE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Note.NOTE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_NOTE_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TNote as(String alias) { + return new TNote(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TNote as(Name alias) { + return new TNote(alias, this); + } + + /** + * Rename this table + */ + @Override + public TNote rename(String name) { + return new TNote(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TNote rename(Name name) { + return new TNote(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/note/tables/records/TNoteRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/note/tables/records/TNoteRecord.java new file mode 100644 index 0000000..dc73e78 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/note/tables/records/TNoteRecord.java @@ -0,0 +1,376 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.note.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.note.enums.EnumCategory; +import de.jottyfan.timetrack.db.note.enums.EnumNotetype; +import de.jottyfan.timetrack.db.note.tables.TNote; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TNoteRecord extends TableRecordImpl implements Record6 { + + private static final long serialVersionUID = -1124958042; + + /** + * Setter for note.t_note.pk. + */ + public void setPk(Integer value) { + set(0, value); + } + + /** + * Getter for note.t_note.pk. + */ + public Integer getPk() { + return (Integer) get(0); + } + + /** + * Setter for note.t_note.title. + */ + public void setTitle(String value) { + set(1, value); + } + + /** + * Getter for note.t_note.title. + */ + public String getTitle() { + return (String) get(1); + } + + /** + * Setter for note.t_note.category. + */ + public void setCategory(EnumCategory value) { + set(2, value); + } + + /** + * Getter for note.t_note.category. + */ + public EnumCategory getCategory() { + return (EnumCategory) get(2); + } + + /** + * Setter for note.t_note.notetype. + */ + public void setNotetype(EnumNotetype value) { + set(3, value); + } + + /** + * Getter for note.t_note.notetype. + */ + public EnumNotetype getNotetype() { + return (EnumNotetype) get(3); + } + + /** + * Setter for note.t_note.content. + */ + public void setContent(String value) { + set(4, value); + } + + /** + * Getter for note.t_note.content. + */ + public String getContent() { + return (String) get(4); + } + + /** + * Setter for note.t_note.lastchange. + */ + public void setLastchange(Timestamp value) { + set(5, value); + } + + /** + * Getter for note.t_note.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TNote.T_NOTE.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TNote.T_NOTE.TITLE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TNote.T_NOTE.CATEGORY; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return TNote.T_NOTE.NOTETYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return TNote.T_NOTE.CONTENT; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return TNote.T_NOTE.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component1() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component2() { + return getTitle(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumCategory component3() { + return getCategory(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumNotetype component4() { + return getNotetype(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component5() { + return getContent(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component6() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value1() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getTitle(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumCategory value3() { + return getCategory(); + } + + /** + * {@inheritDoc} + */ + @Override + public EnumNotetype value4() { + return getNotetype(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getContent(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value6() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value1(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value2(String value) { + setTitle(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value3(EnumCategory value) { + setCategory(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value4(EnumNotetype value) { + setNotetype(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value5(String value) { + setContent(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord value6(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TNoteRecord values(Integer value1, String value2, EnumCategory value3, EnumNotetype value4, String value5, Timestamp value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TNoteRecord + */ + public TNoteRecord() { + super(TNote.T_NOTE); + } + + /** + * Create a detached, initialised TNoteRecord + */ + public TNoteRecord(Integer pk, String title, EnumCategory category, EnumNotetype notetype, String content, Timestamp lastchange) { + super(TNote.T_NOTE); + + set(0, pk); + set(1, title); + set(2, category); + set(3, notetype); + set(4, content); + set(5, lastchange); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/Indexes.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/Indexes.java new file mode 100644 index 0000000..07f92bd --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/Indexes.java @@ -0,0 +1,54 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile; + + +import javax.annotation.Generated; + +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.Internal; + +import de.jottyfan.timetrack.db.profile.tables.TLogin; +import de.jottyfan.timetrack.db.profile.tables.TLoginrole; +import de.jottyfan.timetrack.db.profile.tables.TRole; + + +/** + * A class modelling indexes of tables of the profile schema. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index T_LOGIN_LOGIN_KEY = Indexes0.T_LOGIN_LOGIN_KEY; + public static final Index T_LOGIN_PKEY = Indexes0.T_LOGIN_PKEY; + public static final Index T_LOGINROLE_FK_LOGIN_FK_ROLE_KEY = Indexes0.T_LOGINROLE_FK_LOGIN_FK_ROLE_KEY; + public static final Index T_LOGINROLE_PKEY = Indexes0.T_LOGINROLE_PKEY; + public static final Index T_ROLE_NAME_KEY = Indexes0.T_ROLE_NAME_KEY; + public static final Index T_ROLE_PKEY = Indexes0.T_ROLE_PKEY; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Indexes0 { + public static Index T_LOGIN_LOGIN_KEY = Internal.createIndex("t_login_login_key", TLogin.T_LOGIN, new OrderField[] { TLogin.T_LOGIN.LOGIN }, true); + public static Index T_LOGIN_PKEY = Internal.createIndex("t_login_pkey", TLogin.T_LOGIN, new OrderField[] { TLogin.T_LOGIN.PK }, true); + public static Index T_LOGINROLE_FK_LOGIN_FK_ROLE_KEY = Internal.createIndex("t_loginrole_fk_login_fk_role_key", TLoginrole.T_LOGINROLE, new OrderField[] { TLoginrole.T_LOGINROLE.FK_LOGIN, TLoginrole.T_LOGINROLE.FK_ROLE }, true); + public static Index T_LOGINROLE_PKEY = Internal.createIndex("t_loginrole_pkey", TLoginrole.T_LOGINROLE, new OrderField[] { TLoginrole.T_LOGINROLE.PK }, true); + public static Index T_ROLE_NAME_KEY = Internal.createIndex("t_role_name_key", TRole.T_ROLE, new OrderField[] { TRole.T_ROLE.NAME }, true); + public static Index T_ROLE_PKEY = Internal.createIndex("t_role_pkey", TRole.T_ROLE, new OrderField[] { TRole.T_ROLE.PK }, true); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/Profile.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/Profile.java new file mode 100644 index 0000000..4d51f3b --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/Profile.java @@ -0,0 +1,94 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import de.jottyfan.timetrack.db.DefaultCatalog; +import de.jottyfan.timetrack.db.profile.tables.TLogin; +import de.jottyfan.timetrack.db.profile.tables.TLoginrole; +import de.jottyfan.timetrack.db.profile.tables.TRole; +import de.jottyfan.timetrack.db.profile.tables.VLoginrole; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Profile extends SchemaImpl { + + private static final long serialVersionUID = 1056847603; + + /** + * The reference instance of profile + */ + public static final Profile PROFILE = new Profile(); + + /** + * The table profile.t_login. + */ + public final TLogin T_LOGIN = de.jottyfan.timetrack.db.profile.tables.TLogin.T_LOGIN; + + /** + * The table profile.t_loginrole. + */ + public final TLoginrole T_LOGINROLE = de.jottyfan.timetrack.db.profile.tables.TLoginrole.T_LOGINROLE; + + /** + * The table profile.t_role. + */ + public final TRole T_ROLE = de.jottyfan.timetrack.db.profile.tables.TRole.T_ROLE; + + /** + * The table profile.v_loginrole. + */ + public final VLoginrole V_LOGINROLE = de.jottyfan.timetrack.db.profile.tables.VLoginrole.V_LOGINROLE; + + /** + * No further instances allowed + */ + private Profile() { + super("profile", null); + } + + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + TLogin.T_LOGIN, + TLoginrole.T_LOGINROLE, + TRole.T_ROLE, + VLoginrole.V_LOGINROLE); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/Tables.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/Tables.java new file mode 100644 index 0000000..0c5af88 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/Tables.java @@ -0,0 +1,47 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile; + + +import javax.annotation.Generated; + +import de.jottyfan.timetrack.db.profile.tables.TLogin; +import de.jottyfan.timetrack.db.profile.tables.TLoginrole; +import de.jottyfan.timetrack.db.profile.tables.TRole; +import de.jottyfan.timetrack.db.profile.tables.VLoginrole; + + +/** + * Convenience access to all tables in profile + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Tables { + + /** + * The table profile.t_login. + */ + public static final TLogin T_LOGIN = de.jottyfan.timetrack.db.profile.tables.TLogin.T_LOGIN; + + /** + * The table profile.t_loginrole. + */ + public static final TLoginrole T_LOGINROLE = de.jottyfan.timetrack.db.profile.tables.TLoginrole.T_LOGINROLE; + + /** + * The table profile.t_role. + */ + public static final TRole T_ROLE = de.jottyfan.timetrack.db.profile.tables.TRole.T_ROLE; + + /** + * The table profile.v_loginrole. + */ + public static final VLoginrole V_LOGINROLE = de.jottyfan.timetrack.db.profile.tables.VLoginrole.V_LOGINROLE; +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLogin.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLogin.java new file mode 100644 index 0000000..f40b7f1 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLogin.java @@ -0,0 +1,172 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.profile.Indexes; +import de.jottyfan.timetrack.db.profile.Profile; +import de.jottyfan.timetrack.db.profile.tables.records.TLoginRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TLogin extends TableImpl { + + private static final long serialVersionUID = -417515373; + + /** + * The reference instance of profile.t_login + */ + public static final TLogin T_LOGIN = new TLogin(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TLoginRecord.class; + } + + /** + * The column profile.t_login.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column profile.t_login.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column profile.t_login.login. + */ + public final TableField LOGIN = createField("login", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column profile.t_login.forename. + */ + public final TableField FORENAME = createField("forename", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column profile.t_login.surname. + */ + public final TableField SURNAME = createField("surname", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column profile.t_login.duedate. + */ + public final TableField DUEDATE = createField("duedate", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column profile.t_login.password. + */ + public final TableField PASSWORD = createField("password", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a profile.t_login table reference + */ + public TLogin() { + this(DSL.name("t_login"), null); + } + + /** + * Create an aliased profile.t_login table reference + */ + public TLogin(String alias) { + this(DSL.name(alias), T_LOGIN); + } + + /** + * Create an aliased profile.t_login table reference + */ + public TLogin(Name alias) { + this(alias, T_LOGIN); + } + + private TLogin(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TLogin(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TLogin(Table child, ForeignKey key) { + super(child, key, T_LOGIN); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Profile.PROFILE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_LOGIN_LOGIN_KEY, Indexes.T_LOGIN_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TLogin as(String alias) { + return new TLogin(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TLogin as(Name alias) { + return new TLogin(alias, this); + } + + /** + * Rename this table + */ + @Override + public TLogin rename(String name) { + return new TLogin(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TLogin rename(Name name) { + return new TLogin(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLoginrole.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLoginrole.java new file mode 100644 index 0000000..c64450d --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TLoginrole.java @@ -0,0 +1,157 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.profile.Indexes; +import de.jottyfan.timetrack.db.profile.Profile; +import de.jottyfan.timetrack.db.profile.tables.records.TLoginroleRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TLoginrole extends TableImpl { + + private static final long serialVersionUID = -808655490; + + /** + * The reference instance of profile.t_loginrole + */ + public static final TLoginrole T_LOGINROLE = new TLoginrole(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TLoginroleRecord.class; + } + + /** + * The column profile.t_loginrole.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column profile.t_loginrole.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column profile.t_loginrole.fk_login. + */ + public final TableField FK_LOGIN = createField("fk_login", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column profile.t_loginrole.fk_role. + */ + public final TableField FK_ROLE = createField("fk_role", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a profile.t_loginrole table reference + */ + public TLoginrole() { + this(DSL.name("t_loginrole"), null); + } + + /** + * Create an aliased profile.t_loginrole table reference + */ + public TLoginrole(String alias) { + this(DSL.name(alias), T_LOGINROLE); + } + + /** + * Create an aliased profile.t_loginrole table reference + */ + public TLoginrole(Name alias) { + this(alias, T_LOGINROLE); + } + + private TLoginrole(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TLoginrole(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TLoginrole(Table child, ForeignKey key) { + super(child, key, T_LOGINROLE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Profile.PROFILE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_LOGINROLE_FK_LOGIN_FK_ROLE_KEY, Indexes.T_LOGINROLE_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginrole as(String alias) { + return new TLoginrole(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginrole as(Name alias) { + return new TLoginrole(alias, this); + } + + /** + * Rename this table + */ + @Override + public TLoginrole rename(String name) { + return new TLoginrole(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TLoginrole rename(Name name) { + return new TLoginrole(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TRole.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TRole.java new file mode 100644 index 0000000..95fe108 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/TRole.java @@ -0,0 +1,152 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables; + + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.profile.Indexes; +import de.jottyfan.timetrack.db.profile.Profile; +import de.jottyfan.timetrack.db.profile.tables.records.TRoleRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TRole extends TableImpl { + + private static final long serialVersionUID = -1679621514; + + /** + * The reference instance of profile.t_role + */ + public static final TRole T_ROLE = new TRole(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TRoleRecord.class; + } + + /** + * The column profile.t_role.lastchange. + */ + public final TableField LASTCHANGE = createField("lastchange", org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column profile.t_role.pk. + */ + public final TableField PK = createField("pk", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column profile.t_role.name. + */ + public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a profile.t_role table reference + */ + public TRole() { + this(DSL.name("t_role"), null); + } + + /** + * Create an aliased profile.t_role table reference + */ + public TRole(String alias) { + this(DSL.name(alias), T_ROLE); + } + + /** + * Create an aliased profile.t_role table reference + */ + public TRole(Name alias) { + this(alias, T_ROLE); + } + + private TRole(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TRole(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public TRole(Table child, ForeignKey key) { + super(child, key, T_ROLE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Profile.PROFILE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getIndexes() { + return Arrays.asList(Indexes.T_ROLE_NAME_KEY, Indexes.T_ROLE_PKEY); + } + + /** + * {@inheritDoc} + */ + @Override + public TRole as(String alias) { + return new TRole(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public TRole as(Name alias) { + return new TRole(alias, this); + } + + /** + * Rename this table + */ + @Override + public TRole rename(String name) { + return new TRole(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TRole rename(Name name) { + return new TRole(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/VLoginrole.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/VLoginrole.java new file mode 100644 index 0000000..98336b2 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/VLoginrole.java @@ -0,0 +1,150 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import de.jottyfan.timetrack.db.profile.Profile; +import de.jottyfan.timetrack.db.profile.tables.records.VLoginroleRecord; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VLoginrole extends TableImpl { + + private static final long serialVersionUID = 1191046808; + + /** + * The reference instance of profile.v_loginrole + */ + public static final VLoginrole V_LOGINROLE = new VLoginrole(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return VLoginroleRecord.class; + } + + /** + * The column profile.v_loginrole.login. + */ + public final TableField LOGIN = createField("login", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column profile.v_loginrole.forename. + */ + public final TableField FORENAME = createField("forename", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column profile.v_loginrole.surname. + */ + public final TableField SURNAME = createField("surname", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column profile.v_loginrole.duedate. + */ + public final TableField DUEDATE = createField("duedate", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column profile.v_loginrole.role_name. + */ + public final TableField ROLE_NAME = createField("role_name", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * Create a profile.v_loginrole table reference + */ + public VLoginrole() { + this(DSL.name("v_loginrole"), null); + } + + /** + * Create an aliased profile.v_loginrole table reference + */ + public VLoginrole(String alias) { + this(DSL.name(alias), V_LOGINROLE); + } + + /** + * Create an aliased profile.v_loginrole table reference + */ + public VLoginrole(Name alias) { + this(alias, V_LOGINROLE); + } + + private VLoginrole(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private VLoginrole(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public VLoginrole(Table child, ForeignKey key) { + super(child, key, V_LOGINROLE); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Profile.PROFILE; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginrole as(String alias) { + return new VLoginrole(DSL.name(alias), this); + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginrole as(Name alias) { + return new VLoginrole(alias, this); + } + + /** + * Rename this table + */ + @Override + public VLoginrole rename(String name) { + return new VLoginrole(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public VLoginrole rename(Name name) { + return new VLoginrole(name, null); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginRecord.java new file mode 100644 index 0000000..aecadf0 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginRecord.java @@ -0,0 +1,423 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.profile.tables.TLogin; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TLoginRecord extends TableRecordImpl implements Record7 { + + private static final long serialVersionUID = 1603391159; + + /** + * Setter for profile.t_login.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for profile.t_login.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for profile.t_login.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for profile.t_login.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for profile.t_login.login. + */ + public void setLogin(String value) { + set(2, value); + } + + /** + * Getter for profile.t_login.login. + */ + public String getLogin() { + return (String) get(2); + } + + /** + * Setter for profile.t_login.forename. + */ + public void setForename(String value) { + set(3, value); + } + + /** + * Getter for profile.t_login.forename. + */ + public String getForename() { + return (String) get(3); + } + + /** + * Setter for profile.t_login.surname. + */ + public void setSurname(String value) { + set(4, value); + } + + /** + * Getter for profile.t_login.surname. + */ + public String getSurname() { + return (String) get(4); + } + + /** + * Setter for profile.t_login.duedate. + */ + public void setDuedate(Timestamp value) { + set(5, value); + } + + /** + * Getter for profile.t_login.duedate. + */ + public Timestamp getDuedate() { + return (Timestamp) get(5); + } + + /** + * Setter for profile.t_login.password. + */ + public void setPassword(String value) { + set(6, value); + } + + /** + * Getter for profile.t_login.password. + */ + public String getPassword() { + return (String) get(6); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TLogin.T_LOGIN.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TLogin.T_LOGIN.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TLogin.T_LOGIN.LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return TLogin.T_LOGIN.FORENAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return TLogin.T_LOGIN.SURNAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return TLogin.T_LOGIN.DUEDATE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field7() { + return TLogin.T_LOGIN.PASSWORD; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component4() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component5() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component6() { + return getDuedate(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component7() { + return getPassword(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value6() { + return getDuedate(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value7() { + return getPassword(); + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value3(String value) { + setLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value4(String value) { + setForename(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value5(String value) { + setSurname(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value6(Timestamp value) { + setDuedate(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord value7(String value) { + setPassword(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginRecord values(Timestamp value1, Integer value2, String value3, String value4, String value5, Timestamp value6, String value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TLoginRecord + */ + public TLoginRecord() { + super(TLogin.T_LOGIN); + } + + /** + * Create a detached, initialised TLoginRecord + */ + public TLoginRecord(Timestamp lastchange, Integer pk, String login, String forename, String surname, Timestamp duedate, String password) { + super(TLogin.T_LOGIN); + + set(0, lastchange); + set(1, pk); + set(2, login); + set(3, forename); + set(4, surname); + set(5, duedate); + set(6, password); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginroleRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginroleRecord.java new file mode 100644 index 0000000..9e73621 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TLoginroleRecord.java @@ -0,0 +1,276 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.profile.tables.TLoginrole; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TLoginroleRecord extends TableRecordImpl implements Record4 { + + private static final long serialVersionUID = -558353766; + + /** + * Setter for profile.t_loginrole.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for profile.t_loginrole.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for profile.t_loginrole.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for profile.t_loginrole.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for profile.t_loginrole.fk_login. + */ + public void setFkLogin(Integer value) { + set(2, value); + } + + /** + * Getter for profile.t_loginrole.fk_login. + */ + public Integer getFkLogin() { + return (Integer) get(2); + } + + /** + * Setter for profile.t_loginrole.fk_role. + */ + public void setFkRole(Integer value) { + set(3, value); + } + + /** + * Getter for profile.t_loginrole.fk_role. + */ + public Integer getFkRole() { + return (Integer) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TLoginrole.T_LOGINROLE.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TLoginrole.T_LOGINROLE.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TLoginrole.T_LOGINROLE.FK_LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return TLoginrole.T_LOGINROLE.FK_ROLE; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component3() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component4() { + return getFkRole(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value3() { + return getFkLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value4() { + return getFkRole(); + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginroleRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginroleRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginroleRecord value3(Integer value) { + setFkLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginroleRecord value4(Integer value) { + setFkRole(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TLoginroleRecord values(Timestamp value1, Integer value2, Integer value3, Integer value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TLoginroleRecord + */ + public TLoginroleRecord() { + super(TLoginrole.T_LOGINROLE); + } + + /** + * Create a detached, initialised TLoginroleRecord + */ + public TLoginroleRecord(Timestamp lastchange, Integer pk, Integer fkLogin, Integer fkRole) { + super(TLoginrole.T_LOGINROLE); + + set(0, lastchange); + set(1, pk); + set(2, fkLogin); + set(3, fkRole); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TRoleRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TRoleRecord.java new file mode 100644 index 0000000..03c83e3 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/TRoleRecord.java @@ -0,0 +1,227 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.profile.tables.TRole; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TRoleRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1670931490; + + /** + * Setter for profile.t_role.lastchange. + */ + public void setLastchange(Timestamp value) { + set(0, value); + } + + /** + * Getter for profile.t_role.lastchange. + */ + public Timestamp getLastchange() { + return (Timestamp) get(0); + } + + /** + * Setter for profile.t_role.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for profile.t_role.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for profile.t_role.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for profile.t_role.name. + */ + public String getName() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return TRole.T_ROLE.LASTCHANGE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return TRole.T_ROLE.PK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return TRole.T_ROLE.NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer component2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value1() { + return getLastchange(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value2() { + return getPk(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public TRoleRecord value1(Timestamp value) { + setLastchange(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TRoleRecord value2(Integer value) { + setPk(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TRoleRecord value3(String value) { + setName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TRoleRecord values(Timestamp value1, Integer value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TRoleRecord + */ + public TRoleRecord() { + super(TRole.T_ROLE); + } + + /** + * Create a detached, initialised TRoleRecord + */ + public TRoleRecord(Timestamp lastchange, Integer pk, String name) { + super(TRole.T_ROLE); + + set(0, lastchange); + set(1, pk); + set(2, name); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/VLoginroleRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/VLoginroleRecord.java new file mode 100644 index 0000000..20da953 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/profile/tables/records/VLoginroleRecord.java @@ -0,0 +1,325 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.profile.tables.records; + + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.TableRecordImpl; + +import de.jottyfan.timetrack.db.profile.tables.VLoginrole; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.11.9" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class VLoginroleRecord extends TableRecordImpl implements Record5 { + + private static final long serialVersionUID = 1656842842; + + /** + * Setter for profile.v_loginrole.login. + */ + public void setLogin(String value) { + set(0, value); + } + + /** + * Getter for profile.v_loginrole.login. + */ + public String getLogin() { + return (String) get(0); + } + + /** + * Setter for profile.v_loginrole.forename. + */ + public void setForename(String value) { + set(1, value); + } + + /** + * Getter for profile.v_loginrole.forename. + */ + public String getForename() { + return (String) get(1); + } + + /** + * Setter for profile.v_loginrole.surname. + */ + public void setSurname(String value) { + set(2, value); + } + + /** + * Getter for profile.v_loginrole.surname. + */ + public String getSurname() { + return (String) get(2); + } + + /** + * Setter for profile.v_loginrole.duedate. + */ + public void setDuedate(Timestamp value) { + set(3, value); + } + + /** + * Getter for profile.v_loginrole.duedate. + */ + public Timestamp getDuedate() { + return (Timestamp) get(3); + } + + /** + * Setter for profile.v_loginrole.role_name. + */ + public void setRoleName(String value) { + set(4, value); + } + + /** + * Getter for profile.v_loginrole.role_name. + */ + public String getRoleName() { + return (String) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return VLoginrole.V_LOGINROLE.LOGIN; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return VLoginrole.V_LOGINROLE.FORENAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return VLoginrole.V_LOGINROLE.SURNAME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return VLoginrole.V_LOGINROLE.DUEDATE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return VLoginrole.V_LOGINROLE.ROLE_NAME; + } + + /** + * {@inheritDoc} + */ + @Override + public String component1() { + return getLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component2() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component3() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp component4() { + return getDuedate(); + } + + /** + * {@inheritDoc} + */ + @Override + public String component5() { + return getRoleName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value1() { + return getLogin(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getForename(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getSurname(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value4() { + return getDuedate(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getRoleName(); + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord value1(String value) { + setLogin(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord value2(String value) { + setForename(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord value3(String value) { + setSurname(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord value4(Timestamp value) { + setDuedate(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord value5(String value) { + setRoleName(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VLoginroleRecord values(String value1, String value2, String value3, Timestamp value4, String value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached VLoginroleRecord + */ + public VLoginroleRecord() { + super(VLoginrole.V_LOGINROLE); + } + + /** + * Create a detached, initialised VLoginroleRecord + */ + public VLoginroleRecord(String login, String forename, String surname, Timestamp duedate, String roleName) { + super(VLoginrole.V_LOGINROLE); + + set(0, login); + set(1, forename); + set(2, surname); + set(3, duedate); + set(4, roleName); + } +} diff --git a/src/main/java/de/jottyfan/timetrack/help/Application.java b/src/main/java/de/jottyfan/timetrack/help/Application.java new file mode 100644 index 0000000..08fd7d7 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/help/Application.java @@ -0,0 +1,18 @@ +package de.jottyfan.timetrack.help; + +public enum Application +{ + CONNECTION("connection"); + + private final String value; + + private Application(String value) + { + this.value = value; + } + + public String get() + { + return value; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/help/EncodingFilter.java b/src/main/java/de/jottyfan/timetrack/help/EncodingFilter.java new file mode 100644 index 0000000..90a9657 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/help/EncodingFilter.java @@ -0,0 +1,37 @@ +package de.jottyfan.timetrack.help; + +import java.io.*; + +import javax.servlet.*; + +/** + * + * @author henkej + * + */ +public class EncodingFilter implements Filter +{ + private String encoding; + + @Override + public void destroy() + { + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException + { + servletRequest.setCharacterEncoding(encoding); + filterChain.doFilter(servletRequest, servletResponse); + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException + { + encoding = filterConfig.getInitParameter("encoding"); + if (encoding == null) + { + encoding = "UTF-8"; + } + } +} diff --git a/src/main/java/de/jottyfan/timetrack/help/Navigation.java b/src/main/java/de/jottyfan/timetrack/help/Navigation.java new file mode 100644 index 0000000..d56d8c6 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/help/Navigation.java @@ -0,0 +1,20 @@ +package de.jottyfan.timetrack.help; + +/** + * + * @author henkej + * + */ +public abstract class Navigation +{ + /** + * navigate to page referenced by p + * + * @param p + * @return + */ + public String navigateTo(Pages p) + { + return p.get(); + } +} diff --git a/src/main/java/de/jottyfan/timetrack/help/Pages.java b/src/main/java/de/jottyfan/timetrack/help/Pages.java new file mode 100644 index 0000000..199308f --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/help/Pages.java @@ -0,0 +1,90 @@ +package de.jottyfan.timetrack.help; + +/** + * + * @author henkej + * + */ +public enum Pages +{ + /** + * contact list + */ + CONTACT_LIST("/pages/contact/list.jsf"), + /** + * contact item + */ + CONTACT_ITEM("/pages/contact/item.jsf"), + /** + * note list + */ + NOTE_LIST("/pages/note/list.jsf"), + /** + * note item + */ + NOTE_ITEM("/pages/note/item.jsf"), + /** + * todo list + */ + TODO_LIST("/pages/todo/list.jsf"), + /** + * todo item + */ + TODO_ITEM("/pages/todo/item.jsf"), + /** + * done init + */ + DONE_INIT("/pages/done/init.jsf"), + /** + * done edit + */ + DONE_EDIT("/pages/done/edit.jsf"), + /** + * done delete + */ + DONE_DELETE("/pages/done/delete.jsf"), + /** + * done add + */ + DONE_ADD("/pages/done/add.jsf"), + /** + * done clear + */ + DONE_CLEAR("/pages/done/clear.jsf"), + /** + * organize init + */ + ORGANIZE_LIST("/pages/organize/list.jsf"), + /** + * organize week + */ + ORGANIZE_WEEK("/pages/organize/week.jsf"), + /** + * organize delete + */ + ORGANIZE_DELETE("/pages/organize/delete.jsf"), + /** + * organize add + */ + ORGANIZE_ADD("/pages/organize/add.jsf"), + /** + * organize edit + */ + ORGANIZE_EDIT("/pages/organize/edit.jsf"), + /** + * start + */ + START("/pages/start.jsf"); + + private final String value; + + private Pages(String value) + { + this.value = value; + } + + public String get() + { + return value; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/help/ThemeBean.java b/src/main/java/de/jottyfan/timetrack/help/ThemeBean.java new file mode 100644 index 0000000..27eec75 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/help/ThemeBean.java @@ -0,0 +1,55 @@ +package de.jottyfan.timetrack.help; + +import java.util.*; + +import javax.faces.bean.*; + +/** + * + * @author henkej + * + */ +@ManagedBean +@SessionScoped +public class ThemeBean +{ + private String currentTheme; + + public List getValidThemes(){ + List list = new ArrayList<>(); + list.add("cerulean"); + list.add("cosmo"); + list.add("cyborg"); + list.add("darkly"); + list.add("default"); + list.add("flatly"); + list.add("journal"); + list.add("lumen"); + list.add("other"); + list.add("paper"); + list.add("readable"); + list.add("sandstone"); + list.add("simplex"); + list.add("slate"); + list.add("spacelab"); + list.add("superhero"); + list.add("united"); + list.add("yeti"); + return list; + } + + public void setCurrentTheme(String currentTheme) + { + this.currentTheme = currentTheme; + } + + /** + * contains current theme for web.xml's theme chooser + * + * @return current theme + */ + public String getCurrentTheme() + { + return currentTheme == null ? "default" : (getValidThemes().contains(currentTheme) ? currentTheme : "default"); + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/Bean.java b/src/main/java/de/jottyfan/timetrack/modules/Bean.java new file mode 100644 index 0000000..434a999 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/Bean.java @@ -0,0 +1,10 @@ +package de.jottyfan.timetrack.modules; + +/** + * + * @author henkej + * + */ +public interface Bean +{ +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/ControlInterface.java b/src/main/java/de/jottyfan/timetrack/modules/ControlInterface.java new file mode 100644 index 0000000..ae8b60c --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/ControlInterface.java @@ -0,0 +1,24 @@ +package de.jottyfan.timetrack.modules; + +/** + * + * @author henkej + * + */ +public interface ControlInterface +{ + /** + * navigate to init page of module + * + * @return + * @throws DBException + */ + public String toList(); + + /** + * return model of bean container + * + * @return + */ + public Model getModel(); +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/JooqGateway.java b/src/main/java/de/jottyfan/timetrack/modules/JooqGateway.java new file mode 100644 index 0000000..5655931 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/JooqGateway.java @@ -0,0 +1,44 @@ +package de.jottyfan.timetrack.modules; + +import javax.faces.context.FacesContext; + +import org.jooq.DSLContext; +import org.jooq.TableLike; + +import de.jooqFaces.EJooqApplicationScope; + +/** + * + * @author henkej + * + */ +public class JooqGateway +{ + private final FacesContext facesContext; + + public JooqGateway(FacesContext facesContext) + { + this.facesContext = facesContext; + } + + public DSLContext getJooq() + { + return (DSLContext) facesContext.getExternalContext().getApplicationMap().get(EJooqApplicationScope.JOOQ_FACES_DSLCONTEXT.get()); + } + + public Integer getFkLogin() { + // TODO: make a login, add the profile id to the session and read it here from facesContext + return 1; + } + + /** + * return amount of "select count(1) as amount " + subQuery + * + * @param subQuery + * @return number of entries + */ + public Long getAmount(TableLike table) + { + return getJooq().selectCount().from(table).fetchOne(0, long.class); + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/Model.java b/src/main/java/de/jottyfan/timetrack/modules/Model.java new file mode 100644 index 0000000..dab29f5 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/Model.java @@ -0,0 +1,16 @@ +package de.jottyfan.timetrack.modules; + +/** + * + * @author henkej + * + */ +public interface Model +{ + /** + * get bean of model + * + * @return bean + */ + public Bean getBean(); +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/SessionBean.java b/src/main/java/de/jottyfan/timetrack/modules/SessionBean.java new file mode 100644 index 0000000..70945f7 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/SessionBean.java @@ -0,0 +1,79 @@ +package de.jottyfan.timetrack.modules; + +import java.io.Serializable; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; + +import org.jasypt.util.password.StrongPasswordEncryptor; + +/** + * + * @author henkej + * + */ +@ManagedBean +@SessionScoped +public class SessionBean implements Serializable { + private static final long serialVersionUID = 1L; + + private Integer login; + private String username; + private String secret; + private String forename; + private String surname; + + public Boolean getHasLogin() { + return login != null; + } + + public Boolean getHasNoLogin() { + return login == null; + } + + public Integer getLogin() { + return login; + } + + public void setLogin(Integer login) { + this.login = login; + } + + public String getSecret() { + StrongPasswordEncryptor spe = new StrongPasswordEncryptor(); + return spe.encryptPassword(secret); + } + + public boolean checkSecret(String encrypted) { + StrongPasswordEncryptor spe = new StrongPasswordEncryptor(); + return spe.checkPassword(secret, encrypted); + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public String getForename() { + return forename; + } + + public void setForename(String forename) { + this.forename = forename; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/SessionControl.java b/src/main/java/de/jottyfan/timetrack/modules/SessionControl.java new file mode 100644 index 0000000..3d7370d --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/SessionControl.java @@ -0,0 +1,52 @@ +package de.jottyfan.timetrack.modules; + +import javax.faces.bean.RequestScoped; +import javax.faces.context.FacesContext; + +import de.jottyfan.timetrack.help.Pages; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ManagedProperty; + +/** + * + * @author henkej + * + */ +@ManagedBean +@RequestScoped +public class SessionControl { + + @ManagedProperty(value = "#{facesContext}") + private FacesContext facesContext; + + @ManagedProperty(value = "#{sessionBean}") + private SessionBean bean; + + public String doLogin() { + SessionModel model = new SessionModel(); + model.doLogin(facesContext, bean); + return Pages.START.get(); + } + + public String doLogout() { + bean.setLogin(null); + return Pages.START.get(); + } + + public FacesContext getFacesContext() { + return facesContext; + } + + public void setFacesContext(FacesContext facesContext) { + this.facesContext = facesContext; + } + + public SessionBean getBean() { + return bean; + } + + public void setBean(SessionBean bean) { + this.bean = bean; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/SessionGateway.java b/src/main/java/de/jottyfan/timetrack/modules/SessionGateway.java new file mode 100644 index 0000000..d248ae6 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/SessionGateway.java @@ -0,0 +1,59 @@ +package de.jottyfan.timetrack.modules; + +import static de.jottyfan.timetrack.db.profile.Tables.T_LOGIN; + +import javax.faces.context.FacesContext; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jooq.Record4; +import org.jooq.SelectConditionStep; +import org.jooq.exception.DataAccessException; + +/** + * + * @author henkej + * + */ +public class SessionGateway extends JooqGateway { + private static final Logger LOGGER = LogManager.getLogger(); + + public SessionGateway(FacesContext facesContext) { + super(facesContext); + } + + /** + * seek login and set bean's login to that; if not found, return false + * + * @param bean + * the bean + * @return true or false + */ + public boolean seekAndSetLogin(SessionBean bean) { + SelectConditionStep> sql = getJooq() + // @formatter:off + .select(T_LOGIN.PK, + T_LOGIN.FORENAME, + T_LOGIN.SURNAME, + T_LOGIN.PASSWORD) + .from(T_LOGIN) + .where(T_LOGIN.LOGIN.eq(bean.getUsername())); + // @formatter:on + LOGGER.debug(sql.toString()); + Record4 r = sql.fetchOne(); + if (r != null) { + String encrypted = r.get(T_LOGIN.PASSWORD); + if (bean.checkSecret(encrypted)) { + bean.setLogin(r.get(T_LOGIN.PK)); + bean.setForename(r.get(T_LOGIN.FORENAME)); + bean.setSurname(r.get(T_LOGIN.SURNAME)); + return true; + } else { + throw new DataAccessException("wrong password"); + } + } else { + return false; + } + } + +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/SessionModel.java b/src/main/java/de/jottyfan/timetrack/modules/SessionModel.java new file mode 100644 index 0000000..35a9284 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/SessionModel.java @@ -0,0 +1,25 @@ +package de.jottyfan.timetrack.modules; + +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; + +import org.jooq.exception.DataAccessException; + +/** + * + * @author henkej + * + */ +public class SessionModel { + + public boolean doLogin(FacesContext facesContext, SessionBean bean) { + try { + return new SessionGateway(facesContext).seekAndSetLogin(bean); + } catch (DataAccessException e) { + FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on login", e.getMessage()); + facesContext.addMessage(null, msg); + return false; + } + } + +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/contact/ContactBean.java b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactBean.java new file mode 100644 index 0000000..1216ade --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactBean.java @@ -0,0 +1,81 @@ +package de.jottyfan.timetrack.modules.contact; + +import java.io.Serializable; + +import de.jottyfan.timetrack.db.contact.enums.EnumContacttype; +import de.jottyfan.timetrack.modules.Bean; + +/** + * + * @author jotty + * + */ +public class ContactBean implements Bean, Serializable, Comparable { + private static final long serialVersionUID = 1L; + + private final Integer pk; + private String forename; + private String surname; + private String contact; + private EnumContacttype type; + + public ContactBean(Integer pk) { + super(); + this.pk = pk; + } + + @Override + public int compareTo(ContactBean o) { + return o == null ? 0 : getSortname().compareTo(o.getSortname()); + } + + public String getSortname() { + StringBuilder buf = new StringBuilder(); + buf.append(surname).append(forename); + return buf.toString().toLowerCase(); + } + + public String getFullname() { + StringBuilder buf = new StringBuilder(); + buf.append(forename).append(" "); + buf.append(surname); + return buf.toString(); + } + + public String getForename() { + return forename; + } + + public void setForename(String forename) { + this.forename = forename; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public String getContact() { + return contact; + } + + public void setContact(String contact) { + this.contact = contact; + } + + public EnumContacttype getType() { + return type; + } + + public void setType(EnumContacttype type) { + this.type = type; + } + + public Integer getPk() { + return pk; + } + +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/contact/ContactControl.java b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactControl.java new file mode 100644 index 0000000..18bf086 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactControl.java @@ -0,0 +1,79 @@ +package de.jottyfan.timetrack.modules.contact; + +import java.io.Serializable; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ManagedProperty; +import javax.faces.bean.RequestScoped; + +import de.jooqFaces.JooqFacesContext; +import de.jottyfan.timetrack.help.Navigation; +import de.jottyfan.timetrack.help.Pages; +import de.jottyfan.timetrack.modules.ControlInterface; + +/** + * + * @author jotty + * + */ +@ManagedBean +@RequestScoped +public class ContactControl extends Navigation implements ControlInterface, Serializable { + private static final long serialVersionUID = 1L; + + @ManagedProperty(value = "#{contactModel}") + private ContactModel model; + + @ManagedProperty(value = "#{facesContext}") + private JooqFacesContext facesContext; + + public String toStart() { + return navigateTo(Pages.START); + } + + public String toList() { + boolean ready = model.init(facesContext); + return ready ? navigateTo(Pages.CONTACT_LIST) : toStart(); + } + + public String toItem(ContactBean bean) { + model.setBean(bean); + return navigateTo(Pages.CONTACT_ITEM); + } + + public String toItem() { + model.setBean(new ContactBean(null)); + return navigateTo(Pages.CONTACT_ITEM); + } + + public String doAdd() { + boolean ready = model.add(facesContext); + return ready ? toList() : navigateTo(Pages.CONTACT_ITEM); + } + + public String doUpdate() { + boolean ready = model.update(facesContext); + return ready ? toList() : navigateTo(Pages.CONTACT_ITEM); + } + + public String doDelete() { + boolean ready = model.delete(facesContext); + return ready ? toList() : navigateTo(Pages.CONTACT_ITEM); + } + + public Integer getAmount() { + return model.getAmount(facesContext); + } + + public ContactModel getModel() { + return model; + } + + public void setModel(ContactModel model) { + this.model = model; + } + + public void setFacesContext(JooqFacesContext facesContext) { + this.facesContext = facesContext; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/contact/ContactGateway.java b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactGateway.java new file mode 100644 index 0000000..3321fc9 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactGateway.java @@ -0,0 +1,149 @@ +package de.jottyfan.timetrack.modules.contact; + +import static de.jottyfan.timetrack.db.contact.Tables.T_CONTACT; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.faces.context.FacesContext; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jooq.DeleteConditionStep; +import org.jooq.InsertValuesStep4; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.SelectJoinStep; +import org.jooq.UpdateConditionStep; +import org.jooq.impl.DSL; + +import de.jottyfan.timetrack.db.contact.enums.EnumContacttype; +import de.jottyfan.timetrack.db.contact.tables.records.TContactRecord; +import de.jottyfan.timetrack.modules.JooqGateway; + +/** + * + * @author jotty + * + */ +public class ContactGateway extends JooqGateway { + private static final Logger LOGGER = LogManager.getLogger(ContactGateway.class); + + public ContactGateway(FacesContext facesContext) { + super(facesContext); + } + + /** + * get sorted list of contacts + * + * @return a list (an empty one at least) + */ + public List getAll() { + SelectJoinStep> sql = getJooq() + // @formatter:off + .select(T_CONTACT.PK, + T_CONTACT.FORENAME, + T_CONTACT.SURNAME, + T_CONTACT.CONTACT, + T_CONTACT.TYPE) + .from(T_CONTACT); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + List list = new ArrayList<>(); + for (Record5 r : sql.fetch()) { + ContactBean bean = new ContactBean(r.get(T_CONTACT.PK)); + bean.setForename(r.get(T_CONTACT.FORENAME)); + bean.setSurname(r.get(T_CONTACT.SURNAME)); + bean.setContact(r.get(T_CONTACT.CONTACT)); + bean.setType(r.get(T_CONTACT.TYPE)); + list.add(bean); + } + list.sort((o1, o2) -> o1 == null ? 0 : o1.compareTo(o2)); + return list; + } + + /** + * delete a contact from the database + * + * @param pk + * the id of the contact + * @return the number of affected database rows, should be 1 + */ + public Integer delete(Integer pk) { + DeleteConditionStep sql = getJooq() + // @formatter:off + .deleteFrom(T_CONTACT) + .where(T_CONTACT.PK.eq(pk)); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + return sql.execute(); + + } + + /** + * add a contact to the database + * + * @param bean + * the contact information + * @return the number of affected database rows, should be 1 + */ + public Integer add(ContactBean bean) { + InsertValuesStep4 sql = getJooq() + // @formatter:off + .insertInto(T_CONTACT, + T_CONTACT.FORENAME, + T_CONTACT.SURNAME, + T_CONTACT.CONTACT, + T_CONTACT.TYPE) + .values(bean.getForename(), bean.getSurname(), bean.getContact(), bean.getType()); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + return sql.execute(); + } + + /** + * update a contact in the database, referencing its pk + * + * @param bean + * the contact information + * @return the number of affected database rows, should be 1 + */ + public Integer update(ContactBean bean) { + UpdateConditionStep sql = getJooq() + // @formatter:off + .update(T_CONTACT) + .set(T_CONTACT.FORENAME, bean.getForename()) + .set(T_CONTACT.SURNAME, bean.getSurname()) + .set(T_CONTACT.CONTACT, bean.getContact()) + .set(T_CONTACT.TYPE, bean.getType()) + .where(T_CONTACT.PK.eq(bean.getPk())); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + return sql.execute(); + } + + /** + * get number of entries in t_contact + * + * @return number of entries + */ + public Integer getAmount() { + SelectJoinStep> sql = getJooq() + // @formatter:off + .selectCount() + .from(T_CONTACT); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + return sql.fetchOne(DSL.count()); + } + + /** + * get all enum types + * + * @return list of enum types + */ + public List getTypes() { + return new ArrayList<>(Arrays.asList(EnumContacttype.values())); + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/contact/ContactModel.java b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactModel.java new file mode 100644 index 0000000..1d439da --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/contact/ContactModel.java @@ -0,0 +1,110 @@ +package de.jottyfan.timetrack.modules.contact; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.faces.application.FacesMessage; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; + +import org.jooq.exception.DataAccessException; + +import de.jooqFaces.JooqFacesContext; +import de.jottyfan.timetrack.db.contact.enums.EnumContacttype; +import de.jottyfan.timetrack.modules.Model; + +/** + * + * @author jotty + * + */ +@ManagedBean +@SessionScoped +public class ContactModel implements Model, Serializable { + private static final long serialVersionUID = 1L; + + private ContactBean bean; + private List list; + private List types; + + public boolean init(JooqFacesContext facesContext) { + bean = new ContactBean(null); + try { + ContactGateway gw = new ContactGateway(facesContext); + list = gw.getAll(); + types = gw.getTypes(); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on loading data from db", e.getMessage())); + list = new ArrayList<>(); + types = new ArrayList<>(); + return false; + } + } + + public boolean delete(JooqFacesContext facesContext) { + try { + Integer affected = new ContactGateway(facesContext).delete(bean.getPk()); + return affected.equals(1); + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on deleting data from db", e.getMessage())); + return false; + } + } + + public boolean add(JooqFacesContext facesContext) { + try { + Integer affected = new ContactGateway(facesContext).add(bean); + return affected.equals(1); + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on adding data to db", e.getMessage())); + return false; + } + } + + public boolean update(JooqFacesContext facesContext) { + try { + Integer affected = new ContactGateway(facesContext).update(bean); + return affected.equals(1); + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on updating data to db", e.getMessage())); + return false; + } + } + + public Integer getAmount(JooqFacesContext facesContext) { + try { + return new ContactGateway(facesContext).getAmount(); + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on getting size of contacts", e.getMessage())); + return 0; + } + } + + public List getList() { + return list; + } + + public void setBean(ContactBean bean) { + this.bean = bean; + } + + @Override + public ContactBean getBean() { + return bean; + } + + public List getTypes() { + return types; + } + + public void setTypes(List types) { + this.types = types; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java new file mode 100644 index 0000000..c07abd1 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java @@ -0,0 +1,37 @@ +package de.jottyfan.timetrack.modules.done; + +/** + * + * @author henkej + * + */ +public class DailySummaryBean { + private final String projectName; + private final String moduleName; + private final String jobName; + private final String duration; + + public DailySummaryBean(String projectName, String moduleName, String jobName, String duration) { + super(); + this.projectName = projectName; + this.moduleName = moduleName; + this.jobName = jobName; + this.duration = duration; + } + + public String getProjectName() { + return projectName; + } + + public String getModuleName() { + return moduleName; + } + + public String getJobName() { + return jobName; + } + + public String getDuration() { + return duration; + }; +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java new file mode 100644 index 0000000..8a0152b --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java @@ -0,0 +1,166 @@ +package de.jottyfan.timetrack.modules.done; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.Map; + +import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; +import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; +import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; +import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; +import de.jottyfan.timetrack.modules.Bean; + +/** + * + * @author henkej + * + */ +public class DoneBean implements Bean, Serializable, Comparable { + private static final long serialVersionUID = 1L; + + private Integer pk; + private Timestamp timeFrom; + private Timestamp timeUntil; + private TProjectRecord project; + private TModuleRecord module; + private TJobRecord activity; + + public DoneBean() { + } + + public DoneBean(TDoneRecord r, Map projectMap, Map moduleMap, + Map jobMap) { + this.pk = r.getPk(); + this.timeFrom = r.getTimeFrom(); + this.timeUntil = r.getTimeUntil(); + this.project = projectMap.get(r.getFkProject()); + this.module = moduleMap.get(r.getFkModule()); + this.activity = jobMap.get(r.getFkJob()); + } + + public String getTimeSummary() { + StringBuilder buf = new StringBuilder(); + if (timeFrom != null) { + buf.append(new SimpleDateFormat("HH:mm").format(timeFrom)); + } + if (timeUntil != null) { + buf.append(" - "); + buf.append(new SimpleDateFormat("HH:mm").format(timeUntil)); + } + return buf.toString(); + } + + @Override + public int compareTo(DoneBean o) { + return o == null || timeFrom == null || o.getTimeFrom() == null ? 0 : timeFrom.compareTo(o.getTimeFrom()); + } + + public String getTimeDiff() { + LocalDateTime earlier = timeFrom != null ? timeFrom.toLocalDateTime() : LocalDateTime.now(); + LocalDateTime later = timeUntil != null ? timeUntil.toLocalDateTime() : LocalDateTime.now(); + Duration diff = Duration.between(earlier, later); + return String.format("%02d:%02d", diff.toHours(), diff.toMinutes() % 60); + } + + public LocalDateTime getLocalDateTimeFromHHmm(String s) { + if (s == null || s.trim().isEmpty()) { + return null; + } + String[] hm = s.split(":"); + Integer hours = 0; + Integer minutes = 0; + if (hm.length > 0) { + hours = Integer.valueOf(hm[0]); + } + if (hm.length > 1) { + minutes = Integer.valueOf(hm[1]); + } + LocalDateTime ldt = LocalDateTime.now(); + ldt = ldt.withHour(hours); + ldt = ldt.withMinute(minutes); + ldt = ldt.withSecond(0); + ldt = ldt.withNano(0); + return ldt; + } + + public String getProjectName() { + return project == null ? "" : project.getName(); + } + + public String getModuleName() { + return module == null ? "" : module.getName(); + } + + public String getJobName() { + return activity == null ? "" : activity.getName(); + } + + public String getTimeFromString() { + return timeFrom == null ? "" : new SimpleDateFormat("HH:mm").format(timeFrom); + } + + public void setTimeFromString(String s) { + LocalDateTime ldt = getLocalDateTimeFromHHmm(s); + this.timeFrom = ldt == null ? null : Timestamp.valueOf(ldt); + } + + public String getTimeUntilString() { + return timeUntil == null ? "" : new SimpleDateFormat("HH:mm").format(timeUntil); + } + + public void setTimeUntilString(String s) { + LocalDateTime ldt = getLocalDateTimeFromHHmm(s); + this.timeUntil = ldt == null ? null : Timestamp.valueOf(ldt); + } + + public Integer getPk() { + return this.pk; + } + + public void setPk(Integer pk) { + this.pk = pk; + } + + public Timestamp getTimeFrom() { + return timeFrom; + } + + public void setTimeFrom(Timestamp timeFrom) { + this.timeFrom = timeFrom; + } + + public Timestamp getTimeUntil() { + return timeUntil; + } + + public void setTimeUntil(Timestamp timeUntil) { + this.timeUntil = timeUntil; + } + + public TProjectRecord getProject() { + return project; + } + + public void setProject(TProjectRecord project) { + this.project = project; + } + + public TModuleRecord getModule() { + return module; + } + + public void setModule(TModuleRecord module) { + this.module = module; + } + + public TJobRecord getActivity() { + return activity; + } + + public void setActivity(TJobRecord activity) { + this.activity = activity; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneControl.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneControl.java new file mode 100644 index 0000000..ea9b6c9 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneControl.java @@ -0,0 +1,95 @@ +package de.jottyfan.timetrack.modules.done; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ManagedProperty; +import javax.faces.bean.RequestScoped; +import javax.faces.context.FacesContext; + +import de.jottyfan.timetrack.help.Navigation; +import de.jottyfan.timetrack.help.Pages; +import de.jottyfan.timetrack.modules.ControlInterface; + +/** + * + * @author henkej + * + */ +@ManagedBean +@RequestScoped +public class DoneControl extends Navigation implements ControlInterface, Serializable { + private static final long serialVersionUID = 1L; + + @ManagedProperty(value = "#{doneModel}") + private DoneModel model; + + @ManagedProperty(value = "#{facesContext}") + private FacesContext facesContext; + + public String toStart() { + return navigateTo(Pages.START); + } + + public String toList() { + boolean ready = model.init(facesContext); + return ready ? navigateTo(Pages.DONE_INIT) : toStart(); + } + + public String toAdd() { + DoneBean bean = new DoneBean(); + bean.setTimeFrom(getCurrentDate()); + model.setBean(bean); + boolean ready = model.loadDefaults(facesContext); + return ready ? navigateTo(Pages.DONE_ADD) : toList(); + } + + public String toEdit(DoneBean bean) { + model.setBean(bean); + boolean ready = model.loadDefaults(facesContext); + return ready ? navigateTo(Pages.DONE_EDIT) : toList(); + } + + public String toDelete(DoneBean bean) { + model.setBean(bean); + return navigateTo(Pages.DONE_DELETE); + } + + public String doUpdate() { + boolean ready = model.update(facesContext); + return ready ? toList() : toEdit(model.getBean()); + } + + public String doDelete() { + boolean ready = model.delete(facesContext); + return ready ? toList() : toDelete(model.getBean()); + } + + public String doAdd() { + boolean ready = model.insert(facesContext); + return ready ? toList() : toAdd(); + } + + public String getCurrentTimeAsString() { + return new SimpleDateFormat("HH:mm:ss").format(getCurrentDate()); + } + + public Timestamp getCurrentDate() { + return Timestamp.valueOf(LocalDateTime.now()); + } + + public DoneModel getModel() { + return model; + } + + public void setModel(DoneModel model) { + this.model = model; + } + + public void setFacesContext(FacesContext facesContext) { + this.facesContext = facesContext; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java new file mode 100644 index 0000000..73ea1fe --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java @@ -0,0 +1,290 @@ +package de.jottyfan.timetrack.modules.done; + +import static de.jottyfan.timetrack.db.done.Tables.T_DONE; +import static de.jottyfan.timetrack.db.done.Tables.T_JOB; +import static de.jottyfan.timetrack.db.done.Tables.T_MODULE; +import static de.jottyfan.timetrack.db.done.Tables.T_PROJECT; +import static de.jottyfan.timetrack.db.done.Tables.V_TASKLIST; +import static de.jottyfan.timetrack.db.done.Tables.V_TOTALOFDAY; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jooq.DeleteConditionStep; +import org.jooq.InsertValuesStep6; +import org.jooq.Record; +import org.jooq.Record4; +import org.jooq.SelectConditionStep; +import org.jooq.SelectWhereStep; +import org.jooq.UpdateConditionStep; +import org.jooq.exception.DataAccessException; + +import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; +import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; +import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; +import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; +import de.jottyfan.timetrack.modules.JooqGateway; + +/** + * + * @author henkej + * + */ +public class DoneGateway extends JooqGateway { + private final static Logger LOGGER = LogManager.getLogger(DoneGateway.class); + + public DoneGateway(FacesContext facesContext) { + super(facesContext); + } + + /** + * get all modules from db + * + * @return modules + */ + public List getAllModules() throws DataAccessException { + List list = new ArrayList<>(); + SelectWhereStep sql = getJooq().selectFrom(T_MODULE); + LOGGER.debug(sql.toString()); + for (TModuleRecord r : sql.fetch()) { + list.add(r); + } + list.sort((o1, o2) -> o1 == null || o2 == null || o1.getName() == null || o2.getName() == null ? 0 + : o1.getName().compareTo(o2.getName())); + return list; + } + + /** + * get all activities from db + * + * @return activities + */ + public List getAllActivities() throws DataAccessException { + List list = new ArrayList<>(); + SelectWhereStep sql = getJooq().selectFrom(T_JOB); + LOGGER.debug(sql.toString()); + for (TJobRecord r : sql.fetch()) { + list.add(r); + } + list.sort((o1, o2) -> o1 == null || o2 == null || o1.getName() == null || o2.getName() == null ? 0 + : o1.getName().compareTo(o2.getName())); + return list; + } + + /** + * get all projects from db + * + * @return projects + */ + public List getAllProjects() throws DataAccessException { + List list = new ArrayList<>(); + SelectWhereStep sql = getJooq().selectFrom(T_PROJECT); + LOGGER.debug(sql.toString()); + for (TProjectRecord r : sql.fetch()) { + list.add(r); + } + list.sort((o1, o2) -> o1 == null || o2 == null || o1.getName() == null || o2.getName() == null ? 0 + : o1.getName().compareTo(o2.getName())); + return list; + } + + private Map generateProjectMap(List list) { + Map map = new HashMap<>(); + for (TProjectRecord r : list) { + map.put(r.getPk(), r); + } + return map; + } + + private Map generateModuleMap(List list) { + Map map = new HashMap<>(); + for (TModuleRecord r : list) { + map.put(r.getPk(), r); + } + return map; + } + + private Map generateJobMap(List list) { + Map map = new HashMap<>(); + for (TJobRecord r : list) { + map.put(r.getPk(), r); + } + return map; + } + + /** + * get all from t_done of the given day + * + * @param day + * the day; if null, the current date is used + * + * @return a list of found times, an empty one at least + */ + public List getAll(LocalDateTime day) throws DataAccessException { + Map projectMap = generateProjectMap(getAllProjects()); + Map moduleMap = generateModuleMap(getAllModules()); + Map jobMap = generateJobMap(getAllActivities()); + + if (day == null) { + day = LocalDateTime.now(); + } + LocalDateTime yesterday = day.minusDays(1).withHour(23).withMinute(0).withSecond(0).withNano(0); + LocalDateTime tomorrow = day.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); + + List list = new ArrayList<>(); + SelectConditionStep sql = getJooq() + // @formatter:off + .selectFrom(T_DONE) + .where(T_DONE.FK_LOGIN.eq(getFkLogin())) + .and(T_DONE.TIME_FROM.isNull() + .or(T_DONE.TIME_FROM.greaterThan(Timestamp.valueOf(yesterday)) + .and(T_DONE.TIME_FROM.lessThan(Timestamp.valueOf(tomorrow))))) + .and(T_DONE.TIME_UNTIL.isNull() + .or(T_DONE.TIME_UNTIL.lessThan(Timestamp.valueOf(tomorrow)) + .and(T_DONE.TIME_UNTIL.greaterThan(Timestamp.valueOf(yesterday))))); + // @formatter:on + LOGGER.debug(sql.toString()); + for (TDoneRecord r : sql.fetch()) { + list.add(new DoneBean(r, projectMap, moduleMap, jobMap)); + } + list.sort((o1, o2) -> o1 == null || o2 == null ? 0 : o1.compareTo(o2)); + return list; + } + + /** + * insert data into t_done + * + * @param bean + */ + public void insert(DoneBean bean) throws DataAccessException { + Integer fkProject = bean.getProject() == null ? null : bean.getProject().getPk(); + Integer fkModule = bean.getModule() == null ? null : bean.getModule().getPk(); + Integer fkJob = bean.getActivity() == null ? null : bean.getActivity().getPk(); + Integer fkLogin = getFkLogin(); + + InsertValuesStep6 sql = getJooq() + // @formatter:off + .insertInto(T_DONE, + T_DONE.TIME_FROM, + T_DONE.TIME_UNTIL, + T_DONE.FK_PROJECT, + T_DONE.FK_MODULE, + T_DONE.FK_JOB, + T_DONE.FK_LOGIN) + .values(bean.getTimeFrom(), bean.getTimeUntil(), fkProject, fkModule, fkJob, fkLogin); + // @formatter:on + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * update bean in t_done + * + * @param bean + */ + public void update(DoneBean bean) throws DataAccessException { + UpdateConditionStep sql = getJooq() + // @formatter:off + .update(T_DONE) + .set(T_DONE.TIME_FROM, bean.getTimeFrom()) + .set(T_DONE.TIME_UNTIL, bean.getTimeUntil()) + .set(T_DONE.FK_PROJECT, bean.getProject() == null ? null : bean.getProject().getPk()) + .set(T_DONE.FK_JOB, bean.getActivity() == null ? null : bean.getActivity().getPk()) + .set(T_DONE.FK_MODULE, bean.getModule() == null ? null : bean.getModule().getPk()) + .where(T_DONE.PK.eq(bean.getPk())); + // @formatter:on + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * delete bean from t_done + * + * @param bean + */ + public void delete(DoneBean bean) throws DataAccessException { + DeleteConditionStep sql = getJooq().deleteFrom(T_DONE).where(T_DONE.PK.eq(bean.getPk())); + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * get day summary + * + * @param day + * the day + * @return the day summary if found, an empty map otherwise + */ + public WholeDaySummaryBean getDaySummary(Date day) { + SelectConditionStep> sql = getJooq() + // @formatter:off + .select(V_TOTALOFDAY.STARTTIME, + V_TOTALOFDAY.ENDTIME, + V_TOTALOFDAY.WORKTIME, + V_TOTALOFDAY.BREAKTIME) + .from(V_TOTALOFDAY) + .where(V_TOTALOFDAY.DAY.eq(new SimpleDateFormat("yyyy-MM-dd").format(day))) + .and(V_TOTALOFDAY.FK_LOGIN.eq(getFkLogin())); + // @formatter:on + LOGGER.debug(sql.toString()); + Record r = sql.fetchOne(); + if (r != null) { + String startTime = r.get(V_TOTALOFDAY.STARTTIME); + String endTime = r.get(V_TOTALOFDAY.ENDTIME); + String workTime = r.get(V_TOTALOFDAY.WORKTIME); + String breakTime = r.get(V_TOTALOFDAY.BREAKTIME); + return new WholeDaySummaryBean(startTime, endTime, workTime, breakTime); + } + return new WholeDaySummaryBean("", "", "", ""); + } + + private String toStringFromDuration(Duration i) { + StringBuilder buf = new StringBuilder(); + if (i != null) { + buf.append(i.toHours()).append(":"); + buf.append(i.toMinutes() % 60); + } + return buf.toString(); + } + + /** + * get all jobs of day + * + * @param day + * the day + * @return list of found jobs; an empty list at least + */ + public List getAllJobs(Date day) { + SelectConditionStep> sql = getJooq() + // @formatter:off + .select(V_TASKLIST.DURATION, + V_TASKLIST.PROJECT_NAME, + V_TASKLIST.MODULE_NAME, + V_TASKLIST.JOB_NAME) + .from(V_TASKLIST) + .where(V_TASKLIST.DAY.eq(new SimpleDateFormat("yyyy-MM-dd").format(day))) + .and(V_TASKLIST.FK_LOGIN.eq(getFkLogin())); + // @formatter:on + LOGGER.debug(sql.toString()); + List list = new ArrayList<>(); + for (Record4 r : sql.fetch()) { + String duration = r.get(V_TASKLIST.DURATION); + String projectName = r.get(V_TASKLIST.PROJECT_NAME); + String moduleName = r.get(V_TASKLIST.MODULE_NAME); + String jobName = r.get(V_TASKLIST.JOB_NAME); + list.add(new DailySummaryBean(projectName, moduleName, jobName, duration)); + } + return list; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java new file mode 100644 index 0000000..c19c0d9 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java @@ -0,0 +1,205 @@ +package de.jottyfan.timetrack.modules.done; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.List; +import java.util.TimeZone; + +import javax.faces.application.FacesMessage; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; + +import org.jooq.exception.DataAccessException; + +import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; +import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; +import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; +import de.jottyfan.timetrack.modules.Model; + +/** + * + * @author henkej + * + */ +@ManagedBean +@SessionScoped +public class DoneModel implements Model, Serializable { + private static final long serialVersionUID = 1L; + + private DoneBean bean; + private List beans; + private List projects; + private List modules; + private List activities; + private List times; + private List allJobs; + private WholeDaySummaryBean daySummary; + private Date day; + + public boolean init(FacesContext facesContext) { + try { + day = day == null ? new Date() : day; + beans = getAllOfDay(facesContext, day); + DoneGateway gw = new DoneGateway(facesContext); + modules = gw.getAllModules(); + activities = gw.getAllActivities(); + projects = gw.getAllProjects(); + daySummary = gw.getDaySummary(day); + allJobs = gw.getAllJobs(day); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean loadDefaults(FacesContext facesContext) { + try { + defineTimes(); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, + new FacesMessage(FacesMessage.SEVERITY_ERROR, "error loading defaults", e.getMessage())); + return false; + } + } + + private void defineTimes() { + times = new ArrayList<>(); + Integer currentHour = getCurrentTime().get(GregorianCalendar.HOUR_OF_DAY); + Integer currentMinute = getCurrentTime().get(GregorianCalendar.MINUTE); + if (currentMinute < 15) { + currentMinute = 0; + } else if (currentMinute < 30) { + currentMinute = 15; + } else if (currentMinute < 45) { + currentMinute = 30; + } else { + currentMinute = 45; + } + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 120), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 105), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 90), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 75), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 60), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 45), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 30), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute - 15), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute), "default")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute + 15), "default")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute + 30), "link")); + times.add(new TimeBean(defineNewTime(currentHour, currentMinute + 45), "link")); + } + + private Calendar getCurrentTime() { + return new GregorianCalendar(TimeZone.getTimeZone("Europe/Berlin")); + } + + private Calendar defineNewTime(Integer hours, Integer minutes) { + Calendar cal = new GregorianCalendar(); + if (minutes < 0) { + hours--; + minutes += 60; + } else if (minutes > 59) { + hours++; + minutes -= 60; + } + cal.set(0, 0, 0, hours, minutes, 0); + return cal; + } + + /** + * get all entries of t_done + * + * @param facesContext + * @param day + * the day to look up for + * @param login + * the user to look up for + * @return all entries + */ + private List getAllOfDay(FacesContext facesContext, Date day) throws DataAccessException { + LocalDateTime ldt = day.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + return new DoneGateway(facesContext).getAll(ldt); + } + + public boolean insert(FacesContext facesContext) { + try { + new DoneGateway(facesContext).insert(bean); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean update(FacesContext facesContext) { + try { + new DoneGateway(facesContext).update(bean); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean delete(FacesContext facesContext) { + try { + new DoneGateway(facesContext).delete(bean); + return true; + } catch (DataAccessException e) { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public void setBean(DoneBean bean) { + this.bean = bean; + } + + public DoneBean getBean() { + return bean; + } + + public List getProjects() { + return projects; + } + + public List getModules() { + return modules; + } + + public List getActivities() { + return activities; + } + + public List getAllJobs() { + return allJobs; + } + + public WholeDaySummaryBean getDaySummary() { + return daySummary; + } + + public List getBeans() { + return beans; + } + + public List getTimes() { + return times; + } + + public Date getDay() { + return day; + } + + public void setDay(Date day) { + this.day = day; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/TimeBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/TimeBean.java new file mode 100644 index 0000000..00c211a --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/TimeBean.java @@ -0,0 +1,32 @@ +package de.jottyfan.timetrack.modules.done; + +import java.text.SimpleDateFormat; +import java.util.Calendar; + +/** + * + * @author henkej + * + */ +public class TimeBean { + private final String value; + private final String look; + + public TimeBean(String value, String look) { + super(); + this.value = value; + this.look = look; + } + + public TimeBean(Calendar calendar, String look) { + this(new SimpleDateFormat("HH:mm").format(calendar.getTime()), look); + } + + public String getValue() { + return value; + } + + public String getLook() { + return look; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/WholeDaySummaryBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/WholeDaySummaryBean.java new file mode 100644 index 0000000..54ce2eb --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/done/WholeDaySummaryBean.java @@ -0,0 +1,63 @@ +package de.jottyfan.timetrack.modules.done; + +/** + * + * @author henkej + * + */ +public class WholeDaySummaryBean { + private final String startTime; + private final String endTime; + private final String workTime; + private final String breakTime; + + public WholeDaySummaryBean(String startTime, String endTime, String workTime, String breakTime) { + super(); + this.startTime = startTime; + this.endTime = endTime; + this.workTime = workTime; + this.breakTime = breakTime; + } + + public String getOvertime() { + if (workTime != null && !workTime.trim().isEmpty() && workTime.contains(":")) { + try { + Integer hours = Integer.valueOf(workTime.substring(0, workTime.indexOf(":"))); + Integer minutes = Integer.valueOf(workTime.substring(workTime.indexOf(":") + 1)); + Integer wholeMinutes = hours * 60 + minutes; + Integer overtime = wholeMinutes - (7 * 60 + 48); + Integer overtimeHours = overtime / 60; + Integer overtimeMinutes = overtime % 60; + StringBuilder buf = new StringBuilder(); + if (overtime < 0) { + buf.append("-"); + overtimeHours *= -1; + overtimeMinutes *= -1; + } + buf.append(String.format("%02d", overtimeHours)); + buf.append(":"); + buf.append(String.format("%02d", overtimeMinutes)); + return buf.toString(); + } catch (NumberFormatException e) { + return ""; + } + } + return "-07:48"; + } + + public String getStartTime() { + return startTime; + } + + public String getEndTime() { + return endTime; + } + + public String getWorkTime() { + return workTime; + } + + public String getBreakTime() { + return breakTime; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/note/NoteBean.java b/src/main/java/de/jottyfan/timetrack/modules/note/NoteBean.java new file mode 100644 index 0000000..8c1cc15 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/note/NoteBean.java @@ -0,0 +1,91 @@ +package de.jottyfan.timetrack.modules.note; + +import java.io.*; +import java.util.*; + +import de.jottyfan.timetrack.db.note.enums.EnumCategory; +import de.jottyfan.timetrack.db.note.enums.EnumNotetype; +import de.jottyfan.timetrack.modules.Bean; + +/** + * + * @author henkej + * + */ +public class NoteBean implements Bean, Serializable +{ + private static final long serialVersionUID = 1L; + + private final Integer pk; + private String title; + private EnumCategory category; + private EnumNotetype type; + private String content; + private Date lastchange; + + public NoteBean(Integer pk) + { + super(); + this.pk = pk; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public EnumCategory getCategory() + { + return category; + } + + public void setCategory(EnumCategory category) + { + this.category = category; + } + + public EnumNotetype getType() + { + return type; + } + + public void setType(EnumNotetype type) + { + this.type = type; + } + + public String getContent() + { + return content; + } + + public void setContent(String content) + { + this.content = content; + } + + public Date getLastchange() + { + return lastchange; + } + + public void setLastchange(Date lastchange) + { + this.lastchange = lastchange; + } + + public static long getSerialversionuid() + { + return serialVersionUID; + } + + public Integer getPk() + { + return pk; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/note/NoteControl.java b/src/main/java/de/jottyfan/timetrack/modules/note/NoteControl.java new file mode 100644 index 0000000..4d24908 --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/note/NoteControl.java @@ -0,0 +1,122 @@ +package de.jottyfan.timetrack.modules.note; + +import java.io.Serializable; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ManagedProperty; +import javax.faces.bean.RequestScoped; +import javax.faces.context.FacesContext; + +import de.jottyfan.timetrack.help.Navigation; +import de.jottyfan.timetrack.help.Pages; +import de.jottyfan.timetrack.modules.ControlInterface; +import de.jottyfan.timetrack.modules.Model; + +/** + * + * @author henkej + * + */ +@ManagedBean +@RequestScoped +public class NoteControl extends Navigation implements ControlInterface, Serializable +{ + private static final long serialVersionUID = 1L; + + @ManagedProperty(value = "#{noteModel}") + private NoteModel model; + + @ManagedProperty(value = "#{facesContext}") + private FacesContext facesContext; + + public String toStart() + { + return navigateTo(Pages.START); + } + + public String toList() + { + boolean ready = model.init(facesContext); + return ready ? navigateTo(Pages.NOTE_LIST) : ""; + } + + public String toItem(NoteBean bean) + { + model.setBean(bean); + return navigateTo(Pages.NOTE_ITEM); + } + + public String toAdd() + { + return toItem(new NoteBean(null)); + } + + public String doAdd() + { + boolean ready = model.add(facesContext); + return ready ? toList() : toItem(model.getBean()); + } + + public String doUpdate() + { + boolean ready = model.update(facesContext); + return ready ? toList() : toItem(model.getBean()); + } + + public String doDelete() + { + boolean ready = model.delete(facesContext); + return ready ? toList() : toItem(model.getBean()); + } + + /** + * trim s to maxLength; if s > maxLength, append ... + * + * @param s + * @param maxLength + * @return + */ + public String trimTo(String s, Integer maxLength) + { + if (s == null) + { + return s; + } + else + { + String firstLine = s.contains("\n") ? s.substring(0, s.indexOf("\n")) : s; + if (firstLine.length() > maxLength) + { + return firstLine.substring(0, maxLength).concat("..."); + } + else if (s.contains("\n")) + { + return firstLine.concat("..."); + } + else + { + return firstLine; + } + } + } + + public Long getAmount() { + return model.getAmount(facesContext); + } + + @Override + public Model getModel() + { + return model; + } + + public void setModel(NoteModel model) + { + this.model = model; + } + + public void setFacesContext(FacesContext facesContext) + { + this.facesContext = facesContext; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/note/NoteGateway.java b/src/main/java/de/jottyfan/timetrack/modules/note/NoteGateway.java new file mode 100644 index 0000000..bcb865b --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/note/NoteGateway.java @@ -0,0 +1,102 @@ +package de.jottyfan.timetrack.modules.note; + +import static de.jottyfan.timetrack.db.note.Tables.T_NOTE; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.context.FacesContext; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jooq.DeleteConditionStep; +import org.jooq.InsertValuesStep4; +import org.jooq.Record; +import org.jooq.SelectJoinStep; +import org.jooq.UpdateConditionStep; +import org.jooq.exception.DataAccessException; + +import de.jottyfan.timetrack.db.note.enums.EnumCategory; +import de.jottyfan.timetrack.db.note.enums.EnumNotetype; +import de.jottyfan.timetrack.db.note.tables.records.TNoteRecord; +import de.jottyfan.timetrack.modules.JooqGateway; + +/** + * + * @author henkej + * + */ +public class NoteGateway extends JooqGateway +{ + private static final Logger LOGGER = LogManager.getLogger(NoteGateway.class); + + public NoteGateway(FacesContext facesContext) + { + super(facesContext); + } + + /** + * insert into t_note + * + * @param noteBean + * @throws DataAccessException + * @returns amount of affected rows in db + */ + public void insert(NoteBean bean) throws DataAccessException + { + InsertValuesStep4 sql = getJooq().insertInto(T_NOTE, T_NOTE.TITLE, T_NOTE.CATEGORY, T_NOTE.NOTETYPE, T_NOTE.CONTENT).values(bean.getTitle(), bean.getCategory(), bean.getType(), + bean.getContent()); + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * update content of bean + * + * @param bean + * @throws DataAccessException + */ + public void update(NoteBean bean) throws DataAccessException + { + UpdateConditionStep sql = getJooq().update(T_NOTE).set(T_NOTE.TITLE, bean.getTitle()).set(T_NOTE.CONTENT, bean.getContent()).where(T_NOTE.PK.eq(bean.getPk())); + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * delete from t_note + * + * @param pk + * @throws DataAccessException + */ + public void delete(Integer pk) throws DataAccessException + { + DeleteConditionStep sql = getJooq().deleteFrom(T_NOTE).where(T_NOTE.PK.eq(pk)); + LOGGER.debug(sql.toString()); + sql.execute(); + } + + /** + * get all from t_note + * + * @return + * @throws DataAccessException + */ + public List getAll() throws DataAccessException + { + SelectJoinStep sql = getJooq().select().from(T_NOTE); + LOGGER.debug(sql.toString()); + List list = new ArrayList<>(); + for (Record r : sql.fetch()) + { + NoteBean bean = new NoteBean(r.get(T_NOTE.PK)); + bean.setTitle(r.get(T_NOTE.TITLE)); + bean.setCategory(r.get(T_NOTE.CATEGORY)); + bean.setContent(r.get(T_NOTE.CONTENT)); + bean.setType(r.get(T_NOTE.NOTETYPE)); + bean.setLastchange(r.get(T_NOTE.LASTCHANGE)); + list.add(bean); + } + return list; + } +} diff --git a/src/main/java/de/jottyfan/timetrack/modules/note/NoteModel.java b/src/main/java/de/jottyfan/timetrack/modules/note/NoteModel.java new file mode 100644 index 0000000..e79c48a --- /dev/null +++ b/src/main/java/de/jottyfan/timetrack/modules/note/NoteModel.java @@ -0,0 +1,106 @@ +package de.jottyfan.timetrack.modules.note; + +import java.io.Serializable; +import java.util.List; + +import javax.faces.application.FacesMessage; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; + +import org.jooq.exception.DataAccessException; + +import de.jottyfan.timetrack.db.note.Tables; +import de.jottyfan.timetrack.modules.Model; + +/** + * + * @author henkej + * + */ +@ManagedBean +@SessionScoped +public class NoteModel implements Model, Serializable +{ + private static final long serialVersionUID = 1L; + + private List beans; + private NoteBean bean; + + public boolean init(FacesContext facesContext) + { + try + { + beans = new NoteGateway(facesContext).getAll(); + return true; + } + catch (DataAccessException e) + { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean add(FacesContext facesContext) + { + try + { + new NoteGateway(facesContext).insert(bean); + return true; + } + catch (DataAccessException e) + { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean update(FacesContext facesContext) + { + try + { + new NoteGateway(facesContext).update(bean); + return true; + } + catch (DataAccessException e) + { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public boolean delete(FacesContext facesContext) + { + try + { + new NoteGateway(facesContext).delete(bean.getPk()); + return true; + } + catch (DataAccessException e) + { + facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "error", e.getMessage())); + return false; + } + } + + public Long getAmount(FacesContext facesContext) + { + return new NoteGateway(facesContext).getAmount(Tables.T_NOTE); + } + + @Override + public NoteBean getBean() + { + return bean; + } + + public void setBean(NoteBean bean) + { + this.bean = bean; + } + + public List getBeans() + { + return beans; + } +} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..18b4a79 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/faces-config.xml b/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..21a1a2a --- /dev/null +++ b/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,14 @@ + + + + + de.jooqFaces.JooqFacesRenderResponsePhaseListener + de.jooqFaces.JooqFacesRestoreViewPhaseListener + + + de.jooqFaces.JooqFacesContextFactory + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..abccaea --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,69 @@ + + + timetrack + + EncodingFilter + de.jottyfan.timetrack.help.EncodingFilter + + encoding + UTF-8 + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + *.jsf + + + 580 + + + pages/start.jsf + + + org.apache.myfaces.RENDER_VIEWSTATE_ID + false + + + javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE + true + + + javax.faces.STATE_SAVING_METHOD + client + + + javax.faces.FACELETS_SKIP_COMMENTS + true + + + javax.faces.PROJECT_STAGE + Production + + + + org.apache.myfaces.LOG_WEB_CONTEXT_PARAMS + false + + + BootsFaces_USETHEME + true + + + BootsFaces_THEME + #{themeBean.currentTheme} + + + jooqFacesProperties + /etc/tomcat8/timetrack.properties + + + de.jooqFaces.PropertiesDeploymentListener + + diff --git a/src/main/webapp/pages/contact/item.xhtml b/src/main/webapp/pages/contact/item.xhtml new file mode 100644 index 0000000..cd24288 --- /dev/null +++ b/src/main/webapp/pages/contact/item.xhtml @@ -0,0 +1,42 @@ + + + + Kontakte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/contact/list.xhtml b/src/main/webapp/pages/contact/list.xhtml new file mode 100644 index 0000000..0b48a00 --- /dev/null +++ b/src/main/webapp/pages/contact/list.xhtml @@ -0,0 +1,41 @@ + + + + Kontakte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/done/add.xhtml b/src/main/webapp/pages/done/add.xhtml new file mode 100644 index 0000000..5cc7ffc --- /dev/null +++ b/src/main/webapp/pages/done/add.xhtml @@ -0,0 +1,79 @@ + + + + Arbeitszeit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/done/delete.xhtml b/src/main/webapp/pages/done/delete.xhtml new file mode 100644 index 0000000..123cfc1 --- /dev/null +++ b/src/main/webapp/pages/done/delete.xhtml @@ -0,0 +1,37 @@ + + + + Arbeitszeit + + + + + Arbeitszeit + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/done/edit.xhtml b/src/main/webapp/pages/done/edit.xhtml new file mode 100644 index 0000000..2fc05df --- /dev/null +++ b/src/main/webapp/pages/done/edit.xhtml @@ -0,0 +1,79 @@ + + + + Arbeitszeit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/done/init.xhtml b/src/main/webapp/pages/done/init.xhtml new file mode 100644 index 0000000..10354de --- /dev/null +++ b/src/main/webapp/pages/done/init.xhtml @@ -0,0 +1,97 @@ + + + + Arbeitszeit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pause +

+ +

+
+
+ + Startzeit +

+ +

+
+
+ + Überstunden +

+ +

+
+
+ + Arbeitszeit +

+ +

+
+
+ + Endzeit +

+ +

+
+
+
+
+
+
+ + + + + + + + +
+
+ diff --git a/src/main/webapp/pages/note/item.xhtml b/src/main/webapp/pages/note/item.xhtml new file mode 100644 index 0000000..fc569fa --- /dev/null +++ b/src/main/webapp/pages/note/item.xhtml @@ -0,0 +1,47 @@ + + + + Aufgaben + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/note/list.xhtml b/src/main/webapp/pages/note/list.xhtml new file mode 100644 index 0000000..3762e77 --- /dev/null +++ b/src/main/webapp/pages/note/list.xhtml @@ -0,0 +1,45 @@ + + + + Aufgaben + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/start.xhtml b/src/main/webapp/pages/start.xhtml new file mode 100644 index 0000000..0f8b655 --- /dev/null +++ b/src/main/webapp/pages/start.xhtml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/template.xhtml b/src/main/webapp/pages/template.xhtml new file mode 100644 index 0000000..e7ae228 --- /dev/null +++ b/src/main/webapp/pages/template.xhtml @@ -0,0 +1,24 @@ + + + + + + + + +
+
+ +
+
+ +
+
+ +
+ +
+
+ diff --git a/src/main/webapp/resources/css/style.css b/src/main/webapp/resources/css/style.css new file mode 100644 index 0000000..23aed88 --- /dev/null +++ b/src/main/webapp/resources/css/style.css @@ -0,0 +1,36 @@ +.emph { + border-radius: 3px !important; + border: 1px solid #3070b0 !important; + color: #ffffff !important; + background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%) + !important; +} + +.doneoverview { + max-width: 850px !important; + width: 850px !important; +} + +.doneoverviewtext { + font-size: 120%; +} + +.doneoverviewtextemph { + font-size: 120%; + font-weight: bolder; +} + +.loginpanel { + margin-top: 100px !important; + margin: 0 auto; + max-width: 400px !important; + width: 400px !important; +} + +.successWell { + background-image: linear-gradient(to bottom, #ceeaca 0%, #f7fff7 100%) !important; +} + +.dangerWell { + background-image: linear-gradient(to bottom, #eacaca 0%, #fff7f7 100%) !important; +} \ No newline at end of file diff --git a/src/main/webapp/resources/my/selectOneMenu.xhtml b/src/main/webapp/resources/my/selectOneMenu.xhtml new file mode 100644 index 0000000..c6036fc --- /dev/null +++ b/src/main/webapp/resources/my/selectOneMenu.xhtml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/de/jottyfan/timetrack/moduls/done/TestDoneBean.java b/src/test/java/de/jottyfan/timetrack/moduls/done/TestDoneBean.java new file mode 100644 index 0000000..2805ef0 --- /dev/null +++ b/src/test/java/de/jottyfan/timetrack/moduls/done/TestDoneBean.java @@ -0,0 +1,36 @@ +package de.jottyfan.timetrack.moduls.done; + +import static org.junit.Assert.assertEquals; + +import java.time.LocalDateTime; + +import org.junit.Test; + +import de.jottyfan.timetrack.modules.done.DoneBean; + +/** + * + * @author henkej + * + */ +public class TestDoneBean { + + @Test + public void testGetLocalDateTimeFromHHmm() { + LocalDateTime ldt = LocalDateTime.now(); + ldt = ldt.withSecond(0).withNano(0); + assertEquals(ldt.withHour(0).withMinute(0), new DoneBean().getLocalDateTimeFromHHmm("0:0")); + assertEquals(ldt.withHour(0).withMinute(5), new DoneBean().getLocalDateTimeFromHHmm("0:5")); + assertEquals(ldt.withHour(3).withMinute(2), new DoneBean().getLocalDateTimeFromHHmm("3:2")); + assertEquals(ldt.withHour(3).withMinute(2), new DoneBean().getLocalDateTimeFromHHmm("03:2")); + assertEquals(ldt.withHour(10).withMinute(2), new DoneBean().getLocalDateTimeFromHHmm("10:2")); + assertEquals(ldt.withHour(12).withMinute(2), new DoneBean().getLocalDateTimeFromHHmm("12:02")); + assertEquals(ldt.withHour(12).withMinute(20), new DoneBean().getLocalDateTimeFromHHmm("12:20")); + assertEquals(null, new DoneBean().getLocalDateTimeFromHHmm(null)); + assertEquals(null, new DoneBean().getLocalDateTimeFromHHmm("")); + assertEquals(null, new DoneBean().getLocalDateTimeFromHHmm(" ")); + assertEquals(ldt.withHour(0).withMinute(0), new DoneBean().getLocalDateTimeFromHHmm("0")); + assertEquals(ldt.withHour(1).withMinute(0), new DoneBean().getLocalDateTimeFromHHmm("1")); + assertEquals(ldt.withHour(5).withMinute(0), new DoneBean().getLocalDateTimeFromHHmm("5")); + } +} diff --git a/src/test/java/de/jottyfan/timetrack/moduls/done/TestWholeDaySummaryBean.java b/src/test/java/de/jottyfan/timetrack/moduls/done/TestWholeDaySummaryBean.java new file mode 100644 index 0000000..1794981 --- /dev/null +++ b/src/test/java/de/jottyfan/timetrack/moduls/done/TestWholeDaySummaryBean.java @@ -0,0 +1,23 @@ +package de.jottyfan.timetrack.moduls.done; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import de.jottyfan.timetrack.modules.done.WholeDaySummaryBean; + +/** + * + * @author henkej + * + */ +public class TestWholeDaySummaryBean { + @Test + public void testGetOvertime() { + assertEquals("00:00", new WholeDaySummaryBean("", "", "07:48", "").getOvertime()); + assertEquals("00:12", new WholeDaySummaryBean("", "", "08:00", "").getOvertime()); + assertEquals("-00:48", new WholeDaySummaryBean("", "", "07:00", "").getOvertime()); + assertEquals("-07:48", new WholeDaySummaryBean("", "", "00:00", "").getOvertime()); + assertEquals("", new WholeDaySummaryBean("", "", "", "").getOvertime()); + } +}