├── jooq-demo-db.png ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── src ├── main │ ├── java │ │ └── com │ │ │ └── sivalabs │ │ │ └── bookmarks │ │ │ ├── models │ │ │ ├── Tag.java │ │ │ ├── UserPreferences.java │ │ │ ├── Bookmark.java │ │ │ └── User.java │ │ │ ├── Application.java │ │ │ └── repositories │ │ │ └── UserRepository.java │ ├── resources │ │ ├── application.properties │ │ └── db │ │ │ └── migration │ │ │ └── V1__create_tables.sql │ └── jooq │ │ └── com │ │ └── sivalabs │ │ └── bookmarks │ │ └── jooq │ │ ├── Tables.java │ │ ├── DefaultCatalog.java │ │ ├── Public.java │ │ ├── tables │ │ ├── records │ │ │ ├── BookmarkTagRecord.java │ │ │ ├── TagsRecord.java │ │ │ ├── UserPreferencesRecord.java │ │ │ ├── BookmarksRecord.java │ │ │ └── UsersRecord.java │ │ ├── Tags.java │ │ ├── BookmarkTag.java │ │ ├── UserPreferences.java │ │ ├── Bookmarks.java │ │ └── Users.java │ │ └── Keys.java └── test │ ├── java │ └── com │ │ └── sivalabs │ │ └── bookmarks │ │ ├── ApplicationTests.java │ │ ├── TestApplication.java │ │ ├── ContainersConfig.java │ │ ├── common │ │ └── AbstractIntegrationTest.java │ │ └── repositories │ │ └── UserRepositoryTest.java │ └── resources │ ├── logback-test.xml │ └── test-data.sql ├── README.md ├── .gitignore ├── .github └── workflows │ └── maven-build.yml ├── mvnw.cmd ├── pom.xml └── mvnw /jooq-demo-db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sivaprasadreddy/spring-boot-jooq-demo/HEAD/jooq-demo-db.png -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sivaprasadreddy/spring-boot-jooq-demo/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/models/Tag.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.models; 2 | 3 | public record Tag( 4 | Long id, 5 | String name){ 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/models/UserPreferences.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.models; 2 | 3 | public record UserPreferences(Long id, String theme, String language) { 4 | } 5 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/models/Bookmark.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.models; 2 | 3 | import java.util.List; 4 | 5 | public record Bookmark ( 6 | Long id, 7 | String url, 8 | String title, 9 | User createdBy, 10 | List tags 11 | ){ 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.jooq.tools.LoggerListener=DEBUG 2 | spring.jooq.sql-dialect=postgres 3 | 4 | ## DON'T USE THESE PROPERTIES UNLESS YOU KNOW WHAT YOU ARE DOING 5 | #spring.flyway.clean-disabled=false 6 | #spring.flyway.clean-on-validation-error=true 7 | -------------------------------------------------------------------------------- /src/test/java/com/sivalabs/bookmarks/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks; 2 | 3 | import com.sivalabs.bookmarks.common.AbstractIntegrationTest; 4 | import org.junit.jupiter.api.Test; 5 | 6 | class ApplicationTests extends AbstractIntegrationTest { 7 | 8 | @Test 9 | void contextLoads() { 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SpringBoot JOOQ Demo 2 | This is a sample project for [Spring Boot + jOOQ Tutorial Series](https://sivalabs.in/spring-boot-jooq-tutorial-getting-started) 3 | 4 | ```shell 5 | # Run tests 6 | $ ./mvnw verify 7 | 8 | # Run application locally 9 | $ ./mvnw spring-boot:test-run 10 | ``` 11 | 12 | ## Sample Database 13 | 14 | ![Sample Database](jooq-demo-db.png) 15 | -------------------------------------------------------------------------------- /src/test/java/com/sivalabs/bookmarks/TestApplication.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | 5 | public class TestApplication { 6 | 7 | public static void main(String[] args) { 8 | SpringApplication.from(Application::main) 9 | .with(ContainersConfig.class) 10 | .run(args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/models/User.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.models; 2 | 3 | public record User ( 4 | Long id, 5 | String name, 6 | String email, 7 | String password, 8 | UserPreferences preferences 9 | ) { 10 | public User(Long id, String name, String password, String email) { 11 | this(id, name, email, password, null); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/Application.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /src/test/java/com/sivalabs/bookmarks/ContainersConfig.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks; 2 | 3 | import org.springframework.boot.test.context.TestConfiguration; 4 | import org.springframework.boot.testcontainers.service.connection.ServiceConnection; 5 | import org.springframework.context.annotation.Bean; 6 | import org.testcontainers.containers.PostgreSQLContainer; 7 | 8 | @TestConfiguration(proxyBeanMethods = false) 9 | public class ContainersConfig { 10 | 11 | @Bean 12 | @ServiceConnection 13 | PostgreSQLContainer postgreSQLContainer() { 14 | return new PostgreSQLContainer<>("postgres:16-alpine") 15 | .withReuse(true); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/maven-build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '**' 7 | 8 | jobs: 9 | build: 10 | name: Build 11 | runs-on: ubuntu-latest 12 | strategy: 13 | matrix: 14 | distribution: [ 'temurin' ] 15 | java: [ '17' ] 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | 20 | - name: Setup Java ${{ matrix.java }} (${{ matrix.distribution }}) 21 | uses: actions/setup-java@v3 22 | with: 23 | java-version: ${{ matrix.java }} 24 | distribution: ${{ matrix.distribution }} 25 | cache: 'maven' 26 | 27 | - name: Build with Maven 28 | run: ./mvnw verify 29 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookmarks/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.repositories; 2 | 3 | import com.sivalabs.bookmarks.jooq.tables.records.UsersRecord; 4 | import org.jooq.DSLContext; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import static com.sivalabs.bookmarks.jooq.tables.Users.USERS; 8 | 9 | @Repository 10 | class UserRepository { 11 | private final DSLContext dsl; 12 | 13 | UserRepository(DSLContext dsl) { 14 | this.dsl = dsl; 15 | } 16 | 17 | public String findUserNameById(Long id) { 18 | UsersRecord usersRecord = dsl.selectFrom(USERS) 19 | .where(USERS.ID.eq(id)) 20 | .fetchOptional().orElseThrow(); 21 | return usersRecord.getName(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/com/sivalabs/bookmarks/common/AbstractIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.common; 2 | 3 | import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; 4 | 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import com.sivalabs.bookmarks.ContainersConfig; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.context.annotation.Import; 11 | import org.springframework.test.web.servlet.MockMvc; 12 | 13 | @SpringBootTest(webEnvironment = RANDOM_PORT) 14 | @AutoConfigureMockMvc 15 | @Import(ContainersConfig.class) 16 | public abstract class AbstractIntegrationTest { 17 | 18 | @Autowired protected MockMvc mockMvc; 19 | 20 | @Autowired protected ObjectMapper objectMapper; 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/test-data.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM bookmark_tag; 2 | DELETE FROM bookmarks; 3 | DELETE FROM tags; 4 | DELETE FROM users; 5 | DELETE FROM user_preferences; 6 | 7 | INSERT INTO user_preferences (id, theme, language) 8 | VALUES (1, 'Dark', 'EN'), 9 | (2, 'Light', 'EN') 10 | ; 11 | 12 | INSERT INTO users (id, email, password, name, preferences_id) 13 | VALUES (1, 'admin@gmail.com', 'admin', 'Admin', 1), 14 | (2, 'siva@gmail.com', 'siva', 'Siva', 2) 15 | ; 16 | 17 | INSERT INTO tags(id, name) 18 | VALUES (1, 'java'), 19 | (2, 'spring-boot'), 20 | (3, 'spring-cloud'), 21 | (4, 'devops'), 22 | (5, 'security') 23 | ; 24 | 25 | INSERT INTO bookmarks(id, title, url, created_by, created_at) 26 | VALUES (1, 'SivaLabs', 'https://sivalabs.in', 1, CURRENT_TIMESTAMP), 27 | (2, 'Spring Initializr', 'https://start.spring.io', 2, CURRENT_TIMESTAMP) 28 | ; 29 | 30 | insert into bookmark_tag(bookmark_id, tag_id) 31 | VALUES (1, 1), 32 | (1, 2), 33 | (1, 3), 34 | (2, 2) 35 | ; -------------------------------------------------------------------------------- /src/test/java/com/sivalabs/bookmarks/repositories/UserRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarks.repositories; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.boot.test.autoconfigure.jooq.JooqTest; 6 | import org.springframework.boot.testcontainers.service.connection.ServiceConnection; 7 | import org.springframework.context.annotation.Import; 8 | import org.springframework.test.context.jdbc.Sql; 9 | import org.testcontainers.containers.PostgreSQLContainer; 10 | import org.testcontainers.junit.jupiter.Container; 11 | import org.testcontainers.junit.jupiter.Testcontainers; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | 15 | @JooqTest 16 | @Import({UserRepository.class}) 17 | @Testcontainers 18 | @Sql("classpath:/test-data.sql") 19 | class UserRepositoryTest { 20 | 21 | @Autowired 22 | UserRepository userRepository; 23 | 24 | @Container 25 | @ServiceConnection 26 | static final PostgreSQLContainer postgres = 27 | new PostgreSQLContainer<>("postgres:16-alpine"); 28 | 29 | @Test 30 | void findUserNameById() { 31 | String username = userRepository.findUserNameById(1L); 32 | assertThat(username).isEqualTo("Admin"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/Tables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.BookmarkTag; 8 | import com.sivalabs.bookmarks.jooq.tables.Bookmarks; 9 | import com.sivalabs.bookmarks.jooq.tables.Tags; 10 | import com.sivalabs.bookmarks.jooq.tables.UserPreferences; 11 | import com.sivalabs.bookmarks.jooq.tables.Users; 12 | 13 | 14 | /** 15 | * Convenience access to all tables in public. 16 | */ 17 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 18 | public class Tables { 19 | 20 | /** 21 | * The table public.bookmark_tag. 22 | */ 23 | public static final BookmarkTag BOOKMARK_TAG = BookmarkTag.BOOKMARK_TAG; 24 | 25 | /** 26 | * The table public.bookmarks. 27 | */ 28 | public static final Bookmarks BOOKMARKS = Bookmarks.BOOKMARKS; 29 | 30 | /** 31 | * The table public.tags. 32 | */ 33 | public static final Tags TAGS = Tags.TAGS; 34 | 35 | /** 36 | * The table public.user_preferences. 37 | */ 38 | public static final UserPreferences USER_PREFERENCES = UserPreferences.USER_PREFERENCES; 39 | 40 | /** 41 | * The table public.users. 42 | */ 43 | public static final Users USERS = Users.USERS; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/DefaultCatalog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq; 5 | 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | import org.jooq.Constants; 11 | import org.jooq.Schema; 12 | import org.jooq.impl.CatalogImpl; 13 | 14 | 15 | /** 16 | * This class is generated by jOOQ. 17 | */ 18 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 19 | public class DefaultCatalog extends CatalogImpl { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * The reference instance of DEFAULT_CATALOG 25 | */ 26 | public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); 27 | 28 | /** 29 | * The schema public. 30 | */ 31 | public final Public PUBLIC = Public.PUBLIC; 32 | 33 | /** 34 | * No further instances allowed 35 | */ 36 | private DefaultCatalog() { 37 | super(""); 38 | } 39 | 40 | @Override 41 | public final List getSchemas() { 42 | return Arrays.asList( 43 | Public.PUBLIC 44 | ); 45 | } 46 | 47 | /** 48 | * A reference to the 3.18 minor release of the code generator. If this 49 | * doesn't compile, it's because the runtime library uses an older minor 50 | * release, namely: 3.18. You can turn off the generation of this reference 51 | * by specifying /configuration/generator/generate/jooqVersionReference 52 | */ 53 | private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; 54 | } 55 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V1__create_tables.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE user_preferences 2 | ( 3 | id bigserial primary key, 4 | theme varchar(255), 5 | language varchar(255), 6 | created_at timestamp with time zone default CURRENT_TIMESTAMP, 7 | updated_at timestamp with time zone 8 | ); 9 | 10 | CREATE TABLE users 11 | ( 12 | id bigserial primary key, 13 | name varchar(255) not null, 14 | email varchar(255) not null, 15 | password varchar(255) not null, 16 | preferences_id bigint REFERENCES user_preferences (id), 17 | created_at timestamp with time zone default CURRENT_TIMESTAMP, 18 | updated_at timestamp with time zone, 19 | CONSTRAINT user_email_unique UNIQUE (email) 20 | ); 21 | 22 | CREATE TABLE bookmarks 23 | ( 24 | id bigserial primary key, 25 | url varchar(1024) not null, 26 | title varchar(1024), 27 | created_by bigint not null REFERENCES users (id), 28 | created_at timestamp with time zone default CURRENT_TIMESTAMP, 29 | updated_at timestamp with time zone 30 | ); 31 | 32 | CREATE TABLE tags 33 | ( 34 | id bigserial primary key, 35 | name varchar(100) not null, 36 | created_at timestamp with time zone default CURRENT_TIMESTAMP, 37 | updated_at timestamp with time zone, 38 | CONSTRAINT tag_name_unique UNIQUE (name) 39 | ); 40 | 41 | CREATE TABLE bookmark_tag 42 | ( 43 | bookmark_id bigint not null REFERENCES bookmarks (id), 44 | tag_id bigint not null REFERENCES tags (id) 45 | ); 46 | 47 | ALTER SEQUENCE user_preferences_id_seq RESTART WITH 101; 48 | ALTER SEQUENCE users_id_seq RESTART WITH 101; 49 | ALTER SEQUENCE bookmarks_id_seq RESTART WITH 101; 50 | ALTER SEQUENCE tags_id_seq RESTART WITH 101; -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/Public.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.BookmarkTag; 8 | import com.sivalabs.bookmarks.jooq.tables.Bookmarks; 9 | import com.sivalabs.bookmarks.jooq.tables.Tags; 10 | import com.sivalabs.bookmarks.jooq.tables.UserPreferences; 11 | import com.sivalabs.bookmarks.jooq.tables.Users; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | import org.jooq.Catalog; 17 | import org.jooq.Table; 18 | import org.jooq.impl.SchemaImpl; 19 | 20 | 21 | /** 22 | * This class is generated by jOOQ. 23 | */ 24 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 25 | public class Public extends SchemaImpl { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | /** 30 | * The reference instance of public 31 | */ 32 | public static final Public PUBLIC = new Public(); 33 | 34 | /** 35 | * The table public.bookmark_tag. 36 | */ 37 | public final BookmarkTag BOOKMARK_TAG = BookmarkTag.BOOKMARK_TAG; 38 | 39 | /** 40 | * The table public.bookmarks. 41 | */ 42 | public final Bookmarks BOOKMARKS = Bookmarks.BOOKMARKS; 43 | 44 | /** 45 | * The table public.tags. 46 | */ 47 | public final Tags TAGS = Tags.TAGS; 48 | 49 | /** 50 | * The table public.user_preferences. 51 | */ 52 | public final UserPreferences USER_PREFERENCES = UserPreferences.USER_PREFERENCES; 53 | 54 | /** 55 | * The table public.users. 56 | */ 57 | public final Users USERS = Users.USERS; 58 | 59 | /** 60 | * No further instances allowed 61 | */ 62 | private Public() { 63 | super("public", null); 64 | } 65 | 66 | 67 | @Override 68 | public Catalog getCatalog() { 69 | return DefaultCatalog.DEFAULT_CATALOG; 70 | } 71 | 72 | @Override 73 | public final List> getTables() { 74 | return Arrays.asList( 75 | BookmarkTag.BOOKMARK_TAG, 76 | Bookmarks.BOOKMARKS, 77 | Tags.TAGS, 78 | UserPreferences.USER_PREFERENCES, 79 | Users.USERS 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/records/BookmarkTagRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables.records; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.BookmarkTag; 8 | 9 | import org.jooq.Field; 10 | import org.jooq.Record2; 11 | import org.jooq.Row2; 12 | import org.jooq.impl.TableRecordImpl; 13 | 14 | 15 | /** 16 | * This class is generated by jOOQ. 17 | */ 18 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 19 | public class BookmarkTagRecord extends TableRecordImpl implements Record2 { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * Setter for public.bookmark_tag.bookmark_id. 25 | */ 26 | public void setBookmarkId(Long value) { 27 | set(0, value); 28 | } 29 | 30 | /** 31 | * Getter for public.bookmark_tag.bookmark_id. 32 | */ 33 | public Long getBookmarkId() { 34 | return (Long) get(0); 35 | } 36 | 37 | /** 38 | * Setter for public.bookmark_tag.tag_id. 39 | */ 40 | public void setTagId(Long value) { 41 | set(1, value); 42 | } 43 | 44 | /** 45 | * Getter for public.bookmark_tag.tag_id. 46 | */ 47 | public Long getTagId() { 48 | return (Long) get(1); 49 | } 50 | 51 | // ------------------------------------------------------------------------- 52 | // Record2 type implementation 53 | // ------------------------------------------------------------------------- 54 | 55 | @Override 56 | public Row2 fieldsRow() { 57 | return (Row2) super.fieldsRow(); 58 | } 59 | 60 | @Override 61 | public Row2 valuesRow() { 62 | return (Row2) super.valuesRow(); 63 | } 64 | 65 | @Override 66 | public Field field1() { 67 | return BookmarkTag.BOOKMARK_TAG.BOOKMARK_ID; 68 | } 69 | 70 | @Override 71 | public Field field2() { 72 | return BookmarkTag.BOOKMARK_TAG.TAG_ID; 73 | } 74 | 75 | @Override 76 | public Long component1() { 77 | return getBookmarkId(); 78 | } 79 | 80 | @Override 81 | public Long component2() { 82 | return getTagId(); 83 | } 84 | 85 | @Override 86 | public Long value1() { 87 | return getBookmarkId(); 88 | } 89 | 90 | @Override 91 | public Long value2() { 92 | return getTagId(); 93 | } 94 | 95 | @Override 96 | public BookmarkTagRecord value1(Long value) { 97 | setBookmarkId(value); 98 | return this; 99 | } 100 | 101 | @Override 102 | public BookmarkTagRecord value2(Long value) { 103 | setTagId(value); 104 | return this; 105 | } 106 | 107 | @Override 108 | public BookmarkTagRecord values(Long value1, Long value2) { 109 | value1(value1); 110 | value2(value2); 111 | return this; 112 | } 113 | 114 | // ------------------------------------------------------------------------- 115 | // Constructors 116 | // ------------------------------------------------------------------------- 117 | 118 | /** 119 | * Create a detached BookmarkTagRecord 120 | */ 121 | public BookmarkTagRecord() { 122 | super(BookmarkTag.BOOKMARK_TAG); 123 | } 124 | 125 | /** 126 | * Create a detached, initialised BookmarkTagRecord 127 | */ 128 | public BookmarkTagRecord(Long bookmarkId, Long tagId) { 129 | super(BookmarkTag.BOOKMARK_TAG); 130 | 131 | setBookmarkId(bookmarkId); 132 | setTagId(tagId); 133 | resetChangedOnNotNull(); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/Keys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.BookmarkTag; 8 | import com.sivalabs.bookmarks.jooq.tables.Bookmarks; 9 | import com.sivalabs.bookmarks.jooq.tables.Tags; 10 | import com.sivalabs.bookmarks.jooq.tables.UserPreferences; 11 | import com.sivalabs.bookmarks.jooq.tables.Users; 12 | import com.sivalabs.bookmarks.jooq.tables.records.BookmarkTagRecord; 13 | import com.sivalabs.bookmarks.jooq.tables.records.BookmarksRecord; 14 | import com.sivalabs.bookmarks.jooq.tables.records.TagsRecord; 15 | import com.sivalabs.bookmarks.jooq.tables.records.UserPreferencesRecord; 16 | import com.sivalabs.bookmarks.jooq.tables.records.UsersRecord; 17 | 18 | import org.jooq.ForeignKey; 19 | import org.jooq.TableField; 20 | import org.jooq.UniqueKey; 21 | import org.jooq.impl.DSL; 22 | import org.jooq.impl.Internal; 23 | 24 | 25 | /** 26 | * A class modelling foreign key relationships and constraints of tables in 27 | * public. 28 | */ 29 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 30 | public class Keys { 31 | 32 | // ------------------------------------------------------------------------- 33 | // UNIQUE and PRIMARY KEY definitions 34 | // ------------------------------------------------------------------------- 35 | 36 | public static final UniqueKey BOOKMARKS_PKEY = Internal.createUniqueKey(Bookmarks.BOOKMARKS, DSL.name("bookmarks_pkey"), new TableField[] { Bookmarks.BOOKMARKS.ID }, true); 37 | public static final UniqueKey TAG_NAME_UNIQUE = Internal.createUniqueKey(Tags.TAGS, DSL.name("tag_name_unique"), new TableField[] { Tags.TAGS.NAME }, true); 38 | public static final UniqueKey TAGS_PKEY = Internal.createUniqueKey(Tags.TAGS, DSL.name("tags_pkey"), new TableField[] { Tags.TAGS.ID }, true); 39 | public static final UniqueKey USER_PREFERENCES_PKEY = Internal.createUniqueKey(UserPreferences.USER_PREFERENCES, DSL.name("user_preferences_pkey"), new TableField[] { UserPreferences.USER_PREFERENCES.ID }, true); 40 | public static final UniqueKey USER_EMAIL_UNIQUE = Internal.createUniqueKey(Users.USERS, DSL.name("user_email_unique"), new TableField[] { Users.USERS.EMAIL }, true); 41 | public static final UniqueKey USERS_PKEY = Internal.createUniqueKey(Users.USERS, DSL.name("users_pkey"), new TableField[] { Users.USERS.ID }, true); 42 | 43 | // ------------------------------------------------------------------------- 44 | // FOREIGN KEY definitions 45 | // ------------------------------------------------------------------------- 46 | 47 | public static final ForeignKey BOOKMARK_TAG__BOOKMARK_TAG_BOOKMARK_ID_FKEY = Internal.createForeignKey(BookmarkTag.BOOKMARK_TAG, DSL.name("bookmark_tag_bookmark_id_fkey"), new TableField[] { BookmarkTag.BOOKMARK_TAG.BOOKMARK_ID }, Keys.BOOKMARKS_PKEY, new TableField[] { Bookmarks.BOOKMARKS.ID }, true); 48 | public static final ForeignKey BOOKMARK_TAG__BOOKMARK_TAG_TAG_ID_FKEY = Internal.createForeignKey(BookmarkTag.BOOKMARK_TAG, DSL.name("bookmark_tag_tag_id_fkey"), new TableField[] { BookmarkTag.BOOKMARK_TAG.TAG_ID }, Keys.TAGS_PKEY, new TableField[] { Tags.TAGS.ID }, true); 49 | public static final ForeignKey BOOKMARKS__BOOKMARKS_CREATED_BY_FKEY = Internal.createForeignKey(Bookmarks.BOOKMARKS, DSL.name("bookmarks_created_by_fkey"), new TableField[] { Bookmarks.BOOKMARKS.CREATED_BY }, Keys.USERS_PKEY, new TableField[] { Users.USERS.ID }, true); 50 | public static final ForeignKey USERS__USERS_PREFERENCES_ID_FKEY = Internal.createForeignKey(Users.USERS, DSL.name("users_preferences_id_fkey"), new TableField[] { Users.USERS.PREFERENCES_ID }, Keys.USER_PREFERENCES_PKEY, new TableField[] { UserPreferences.USER_PREFERENCES.ID }, true); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/records/TagsRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables.records; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.Tags; 8 | 9 | import java.time.OffsetDateTime; 10 | 11 | import org.jooq.Field; 12 | import org.jooq.Record1; 13 | import org.jooq.Record4; 14 | import org.jooq.Row4; 15 | import org.jooq.impl.UpdatableRecordImpl; 16 | 17 | 18 | /** 19 | * This class is generated by jOOQ. 20 | */ 21 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 22 | public class TagsRecord extends UpdatableRecordImpl implements Record4 { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Setter for public.tags.id. 28 | */ 29 | public void setId(Long value) { 30 | set(0, value); 31 | } 32 | 33 | /** 34 | * Getter for public.tags.id. 35 | */ 36 | public Long getId() { 37 | return (Long) get(0); 38 | } 39 | 40 | /** 41 | * Setter for public.tags.name. 42 | */ 43 | public void setName(String value) { 44 | set(1, value); 45 | } 46 | 47 | /** 48 | * Getter for public.tags.name. 49 | */ 50 | public String getName() { 51 | return (String) get(1); 52 | } 53 | 54 | /** 55 | * Setter for public.tags.created_at. 56 | */ 57 | public void setCreatedAt(OffsetDateTime value) { 58 | set(2, value); 59 | } 60 | 61 | /** 62 | * Getter for public.tags.created_at. 63 | */ 64 | public OffsetDateTime getCreatedAt() { 65 | return (OffsetDateTime) get(2); 66 | } 67 | 68 | /** 69 | * Setter for public.tags.updated_at. 70 | */ 71 | public void setUpdatedAt(OffsetDateTime value) { 72 | set(3, value); 73 | } 74 | 75 | /** 76 | * Getter for public.tags.updated_at. 77 | */ 78 | public OffsetDateTime getUpdatedAt() { 79 | return (OffsetDateTime) get(3); 80 | } 81 | 82 | // ------------------------------------------------------------------------- 83 | // Primary key information 84 | // ------------------------------------------------------------------------- 85 | 86 | @Override 87 | public Record1 key() { 88 | return (Record1) super.key(); 89 | } 90 | 91 | // ------------------------------------------------------------------------- 92 | // Record4 type implementation 93 | // ------------------------------------------------------------------------- 94 | 95 | @Override 96 | public Row4 fieldsRow() { 97 | return (Row4) super.fieldsRow(); 98 | } 99 | 100 | @Override 101 | public Row4 valuesRow() { 102 | return (Row4) super.valuesRow(); 103 | } 104 | 105 | @Override 106 | public Field field1() { 107 | return Tags.TAGS.ID; 108 | } 109 | 110 | @Override 111 | public Field field2() { 112 | return Tags.TAGS.NAME; 113 | } 114 | 115 | @Override 116 | public Field field3() { 117 | return Tags.TAGS.CREATED_AT; 118 | } 119 | 120 | @Override 121 | public Field field4() { 122 | return Tags.TAGS.UPDATED_AT; 123 | } 124 | 125 | @Override 126 | public Long component1() { 127 | return getId(); 128 | } 129 | 130 | @Override 131 | public String component2() { 132 | return getName(); 133 | } 134 | 135 | @Override 136 | public OffsetDateTime component3() { 137 | return getCreatedAt(); 138 | } 139 | 140 | @Override 141 | public OffsetDateTime component4() { 142 | return getUpdatedAt(); 143 | } 144 | 145 | @Override 146 | public Long value1() { 147 | return getId(); 148 | } 149 | 150 | @Override 151 | public String value2() { 152 | return getName(); 153 | } 154 | 155 | @Override 156 | public OffsetDateTime value3() { 157 | return getCreatedAt(); 158 | } 159 | 160 | @Override 161 | public OffsetDateTime value4() { 162 | return getUpdatedAt(); 163 | } 164 | 165 | @Override 166 | public TagsRecord value1(Long value) { 167 | setId(value); 168 | return this; 169 | } 170 | 171 | @Override 172 | public TagsRecord value2(String value) { 173 | setName(value); 174 | return this; 175 | } 176 | 177 | @Override 178 | public TagsRecord value3(OffsetDateTime value) { 179 | setCreatedAt(value); 180 | return this; 181 | } 182 | 183 | @Override 184 | public TagsRecord value4(OffsetDateTime value) { 185 | setUpdatedAt(value); 186 | return this; 187 | } 188 | 189 | @Override 190 | public TagsRecord values(Long value1, String value2, OffsetDateTime value3, OffsetDateTime value4) { 191 | value1(value1); 192 | value2(value2); 193 | value3(value3); 194 | value4(value4); 195 | return this; 196 | } 197 | 198 | // ------------------------------------------------------------------------- 199 | // Constructors 200 | // ------------------------------------------------------------------------- 201 | 202 | /** 203 | * Create a detached TagsRecord 204 | */ 205 | public TagsRecord() { 206 | super(Tags.TAGS); 207 | } 208 | 209 | /** 210 | * Create a detached, initialised TagsRecord 211 | */ 212 | public TagsRecord(Long id, String name, OffsetDateTime createdAt, OffsetDateTime updatedAt) { 213 | super(Tags.TAGS); 214 | 215 | setId(id); 216 | setName(name); 217 | setCreatedAt(createdAt); 218 | setUpdatedAt(updatedAt); 219 | resetChangedOnNotNull(); 220 | } 221 | } 222 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/Tags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.Keys; 8 | import com.sivalabs.bookmarks.jooq.Public; 9 | import com.sivalabs.bookmarks.jooq.tables.records.TagsRecord; 10 | 11 | import java.time.OffsetDateTime; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.function.Function; 15 | 16 | import org.jooq.Field; 17 | import org.jooq.ForeignKey; 18 | import org.jooq.Function4; 19 | import org.jooq.Identity; 20 | import org.jooq.Name; 21 | import org.jooq.Record; 22 | import org.jooq.Records; 23 | import org.jooq.Row4; 24 | import org.jooq.Schema; 25 | import org.jooq.SelectField; 26 | import org.jooq.Table; 27 | import org.jooq.TableField; 28 | import org.jooq.TableOptions; 29 | import org.jooq.UniqueKey; 30 | import org.jooq.impl.DSL; 31 | import org.jooq.impl.SQLDataType; 32 | import org.jooq.impl.TableImpl; 33 | 34 | 35 | /** 36 | * This class is generated by jOOQ. 37 | */ 38 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 39 | public class Tags extends TableImpl { 40 | 41 | private static final long serialVersionUID = 1L; 42 | 43 | /** 44 | * The reference instance of public.tags 45 | */ 46 | public static final Tags TAGS = new Tags(); 47 | 48 | /** 49 | * The class holding records for this type 50 | */ 51 | @Override 52 | public Class getRecordType() { 53 | return TagsRecord.class; 54 | } 55 | 56 | /** 57 | * The column public.tags.id. 58 | */ 59 | public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); 60 | 61 | /** 62 | * The column public.tags.name. 63 | */ 64 | public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(100).nullable(false), this, ""); 65 | 66 | /** 67 | * The column public.tags.created_at. 68 | */ 69 | public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); 70 | 71 | /** 72 | * The column public.tags.updated_at. 73 | */ 74 | public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); 75 | 76 | private Tags(Name alias, Table aliased) { 77 | this(alias, aliased, null); 78 | } 79 | 80 | private Tags(Name alias, Table aliased, Field[] parameters) { 81 | super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); 82 | } 83 | 84 | /** 85 | * Create an aliased public.tags table reference 86 | */ 87 | public Tags(String alias) { 88 | this(DSL.name(alias), TAGS); 89 | } 90 | 91 | /** 92 | * Create an aliased public.tags table reference 93 | */ 94 | public Tags(Name alias) { 95 | this(alias, TAGS); 96 | } 97 | 98 | /** 99 | * Create a public.tags table reference 100 | */ 101 | public Tags() { 102 | this(DSL.name("tags"), null); 103 | } 104 | 105 | public Tags(Table child, ForeignKey key) { 106 | super(child, key, TAGS); 107 | } 108 | 109 | @Override 110 | public Schema getSchema() { 111 | return aliased() ? null : Public.PUBLIC; 112 | } 113 | 114 | @Override 115 | public Identity getIdentity() { 116 | return (Identity) super.getIdentity(); 117 | } 118 | 119 | @Override 120 | public UniqueKey getPrimaryKey() { 121 | return Keys.TAGS_PKEY; 122 | } 123 | 124 | @Override 125 | public List> getUniqueKeys() { 126 | return Arrays.asList(Keys.TAG_NAME_UNIQUE); 127 | } 128 | 129 | @Override 130 | public Tags as(String alias) { 131 | return new Tags(DSL.name(alias), this); 132 | } 133 | 134 | @Override 135 | public Tags as(Name alias) { 136 | return new Tags(alias, this); 137 | } 138 | 139 | @Override 140 | public Tags as(Table alias) { 141 | return new Tags(alias.getQualifiedName(), this); 142 | } 143 | 144 | /** 145 | * Rename this table 146 | */ 147 | @Override 148 | public Tags rename(String name) { 149 | return new Tags(DSL.name(name), null); 150 | } 151 | 152 | /** 153 | * Rename this table 154 | */ 155 | @Override 156 | public Tags rename(Name name) { 157 | return new Tags(name, null); 158 | } 159 | 160 | /** 161 | * Rename this table 162 | */ 163 | @Override 164 | public Tags rename(Table name) { 165 | return new Tags(name.getQualifiedName(), null); 166 | } 167 | 168 | // ------------------------------------------------------------------------- 169 | // Row4 type methods 170 | // ------------------------------------------------------------------------- 171 | 172 | @Override 173 | public Row4 fieldsRow() { 174 | return (Row4) super.fieldsRow(); 175 | } 176 | 177 | /** 178 | * Convenience mapping calling {@link SelectField#convertFrom(Function)}. 179 | */ 180 | public SelectField mapping(Function4 from) { 181 | return convertFrom(Records.mapping(from)); 182 | } 183 | 184 | /** 185 | * Convenience mapping calling {@link SelectField#convertFrom(Class, 186 | * Function)}. 187 | */ 188 | public SelectField mapping(Class toType, Function4 from) { 189 | return convertFrom(toType, Records.mapping(from)); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/BookmarkTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.Keys; 8 | import com.sivalabs.bookmarks.jooq.Public; 9 | import com.sivalabs.bookmarks.jooq.tables.records.BookmarkTagRecord; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | import java.util.function.Function; 14 | 15 | import org.jooq.Field; 16 | import org.jooq.ForeignKey; 17 | import org.jooq.Function2; 18 | import org.jooq.Name; 19 | import org.jooq.Record; 20 | import org.jooq.Records; 21 | import org.jooq.Row2; 22 | import org.jooq.Schema; 23 | import org.jooq.SelectField; 24 | import org.jooq.Table; 25 | import org.jooq.TableField; 26 | import org.jooq.TableOptions; 27 | import org.jooq.impl.DSL; 28 | import org.jooq.impl.SQLDataType; 29 | import org.jooq.impl.TableImpl; 30 | 31 | 32 | /** 33 | * This class is generated by jOOQ. 34 | */ 35 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 36 | public class BookmarkTag extends TableImpl { 37 | 38 | private static final long serialVersionUID = 1L; 39 | 40 | /** 41 | * The reference instance of public.bookmark_tag 42 | */ 43 | public static final BookmarkTag BOOKMARK_TAG = new BookmarkTag(); 44 | 45 | /** 46 | * The class holding records for this type 47 | */ 48 | @Override 49 | public Class getRecordType() { 50 | return BookmarkTagRecord.class; 51 | } 52 | 53 | /** 54 | * The column public.bookmark_tag.bookmark_id. 55 | */ 56 | public final TableField BOOKMARK_ID = createField(DSL.name("bookmark_id"), SQLDataType.BIGINT.nullable(false), this, ""); 57 | 58 | /** 59 | * The column public.bookmark_tag.tag_id. 60 | */ 61 | public final TableField TAG_ID = createField(DSL.name("tag_id"), SQLDataType.BIGINT.nullable(false), this, ""); 62 | 63 | private BookmarkTag(Name alias, Table aliased) { 64 | this(alias, aliased, null); 65 | } 66 | 67 | private BookmarkTag(Name alias, Table aliased, Field[] parameters) { 68 | super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); 69 | } 70 | 71 | /** 72 | * Create an aliased public.bookmark_tag table reference 73 | */ 74 | public BookmarkTag(String alias) { 75 | this(DSL.name(alias), BOOKMARK_TAG); 76 | } 77 | 78 | /** 79 | * Create an aliased public.bookmark_tag table reference 80 | */ 81 | public BookmarkTag(Name alias) { 82 | this(alias, BOOKMARK_TAG); 83 | } 84 | 85 | /** 86 | * Create a public.bookmark_tag table reference 87 | */ 88 | public BookmarkTag() { 89 | this(DSL.name("bookmark_tag"), null); 90 | } 91 | 92 | public BookmarkTag(Table child, ForeignKey key) { 93 | super(child, key, BOOKMARK_TAG); 94 | } 95 | 96 | @Override 97 | public Schema getSchema() { 98 | return aliased() ? null : Public.PUBLIC; 99 | } 100 | 101 | @Override 102 | public List> getReferences() { 103 | return Arrays.asList(Keys.BOOKMARK_TAG__BOOKMARK_TAG_BOOKMARK_ID_FKEY, Keys.BOOKMARK_TAG__BOOKMARK_TAG_TAG_ID_FKEY); 104 | } 105 | 106 | private transient Bookmarks _bookmarks; 107 | private transient Tags _tags; 108 | 109 | /** 110 | * Get the implicit join path to the public.bookmarks table. 111 | */ 112 | public Bookmarks bookmarks() { 113 | if (_bookmarks == null) 114 | _bookmarks = new Bookmarks(this, Keys.BOOKMARK_TAG__BOOKMARK_TAG_BOOKMARK_ID_FKEY); 115 | 116 | return _bookmarks; 117 | } 118 | 119 | /** 120 | * Get the implicit join path to the public.tags table. 121 | */ 122 | public Tags tags() { 123 | if (_tags == null) 124 | _tags = new Tags(this, Keys.BOOKMARK_TAG__BOOKMARK_TAG_TAG_ID_FKEY); 125 | 126 | return _tags; 127 | } 128 | 129 | @Override 130 | public BookmarkTag as(String alias) { 131 | return new BookmarkTag(DSL.name(alias), this); 132 | } 133 | 134 | @Override 135 | public BookmarkTag as(Name alias) { 136 | return new BookmarkTag(alias, this); 137 | } 138 | 139 | @Override 140 | public BookmarkTag as(Table alias) { 141 | return new BookmarkTag(alias.getQualifiedName(), this); 142 | } 143 | 144 | /** 145 | * Rename this table 146 | */ 147 | @Override 148 | public BookmarkTag rename(String name) { 149 | return new BookmarkTag(DSL.name(name), null); 150 | } 151 | 152 | /** 153 | * Rename this table 154 | */ 155 | @Override 156 | public BookmarkTag rename(Name name) { 157 | return new BookmarkTag(name, null); 158 | } 159 | 160 | /** 161 | * Rename this table 162 | */ 163 | @Override 164 | public BookmarkTag rename(Table name) { 165 | return new BookmarkTag(name.getQualifiedName(), null); 166 | } 167 | 168 | // ------------------------------------------------------------------------- 169 | // Row2 type methods 170 | // ------------------------------------------------------------------------- 171 | 172 | @Override 173 | public Row2 fieldsRow() { 174 | return (Row2) super.fieldsRow(); 175 | } 176 | 177 | /** 178 | * Convenience mapping calling {@link SelectField#convertFrom(Function)}. 179 | */ 180 | public SelectField mapping(Function2 from) { 181 | return convertFrom(Records.mapping(from)); 182 | } 183 | 184 | /** 185 | * Convenience mapping calling {@link SelectField#convertFrom(Class, 186 | * Function)}. 187 | */ 188 | public SelectField mapping(Class toType, Function2 from) { 189 | return convertFrom(toType, Records.mapping(from)); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/UserPreferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.Keys; 8 | import com.sivalabs.bookmarks.jooq.Public; 9 | import com.sivalabs.bookmarks.jooq.tables.records.UserPreferencesRecord; 10 | 11 | import java.time.OffsetDateTime; 12 | import java.util.function.Function; 13 | 14 | import org.jooq.Field; 15 | import org.jooq.ForeignKey; 16 | import org.jooq.Function5; 17 | import org.jooq.Identity; 18 | import org.jooq.Name; 19 | import org.jooq.Record; 20 | import org.jooq.Records; 21 | import org.jooq.Row5; 22 | import org.jooq.Schema; 23 | import org.jooq.SelectField; 24 | import org.jooq.Table; 25 | import org.jooq.TableField; 26 | import org.jooq.TableOptions; 27 | import org.jooq.UniqueKey; 28 | import org.jooq.impl.DSL; 29 | import org.jooq.impl.SQLDataType; 30 | import org.jooq.impl.TableImpl; 31 | 32 | 33 | /** 34 | * This class is generated by jOOQ. 35 | */ 36 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 37 | public class UserPreferences extends TableImpl { 38 | 39 | private static final long serialVersionUID = 1L; 40 | 41 | /** 42 | * The reference instance of public.user_preferences 43 | */ 44 | public static final UserPreferences USER_PREFERENCES = new UserPreferences(); 45 | 46 | /** 47 | * The class holding records for this type 48 | */ 49 | @Override 50 | public Class getRecordType() { 51 | return UserPreferencesRecord.class; 52 | } 53 | 54 | /** 55 | * The column public.user_preferences.id. 56 | */ 57 | public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); 58 | 59 | /** 60 | * The column public.user_preferences.theme. 61 | */ 62 | public final TableField THEME = createField(DSL.name("theme"), SQLDataType.VARCHAR(255), this, ""); 63 | 64 | /** 65 | * The column public.user_preferences.language. 66 | */ 67 | public final TableField LANGUAGE = createField(DSL.name("language"), SQLDataType.VARCHAR(255), this, ""); 68 | 69 | /** 70 | * The column public.user_preferences.created_at. 71 | */ 72 | public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); 73 | 74 | /** 75 | * The column public.user_preferences.updated_at. 76 | */ 77 | public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); 78 | 79 | private UserPreferences(Name alias, Table aliased) { 80 | this(alias, aliased, null); 81 | } 82 | 83 | private UserPreferences(Name alias, Table aliased, Field[] parameters) { 84 | super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); 85 | } 86 | 87 | /** 88 | * Create an aliased public.user_preferences table reference 89 | */ 90 | public UserPreferences(String alias) { 91 | this(DSL.name(alias), USER_PREFERENCES); 92 | } 93 | 94 | /** 95 | * Create an aliased public.user_preferences table reference 96 | */ 97 | public UserPreferences(Name alias) { 98 | this(alias, USER_PREFERENCES); 99 | } 100 | 101 | /** 102 | * Create a public.user_preferences table reference 103 | */ 104 | public UserPreferences() { 105 | this(DSL.name("user_preferences"), null); 106 | } 107 | 108 | public UserPreferences(Table child, ForeignKey key) { 109 | super(child, key, USER_PREFERENCES); 110 | } 111 | 112 | @Override 113 | public Schema getSchema() { 114 | return aliased() ? null : Public.PUBLIC; 115 | } 116 | 117 | @Override 118 | public Identity getIdentity() { 119 | return (Identity) super.getIdentity(); 120 | } 121 | 122 | @Override 123 | public UniqueKey getPrimaryKey() { 124 | return Keys.USER_PREFERENCES_PKEY; 125 | } 126 | 127 | @Override 128 | public UserPreferences as(String alias) { 129 | return new UserPreferences(DSL.name(alias), this); 130 | } 131 | 132 | @Override 133 | public UserPreferences as(Name alias) { 134 | return new UserPreferences(alias, this); 135 | } 136 | 137 | @Override 138 | public UserPreferences as(Table alias) { 139 | return new UserPreferences(alias.getQualifiedName(), this); 140 | } 141 | 142 | /** 143 | * Rename this table 144 | */ 145 | @Override 146 | public UserPreferences rename(String name) { 147 | return new UserPreferences(DSL.name(name), null); 148 | } 149 | 150 | /** 151 | * Rename this table 152 | */ 153 | @Override 154 | public UserPreferences rename(Name name) { 155 | return new UserPreferences(name, null); 156 | } 157 | 158 | /** 159 | * Rename this table 160 | */ 161 | @Override 162 | public UserPreferences rename(Table name) { 163 | return new UserPreferences(name.getQualifiedName(), null); 164 | } 165 | 166 | // ------------------------------------------------------------------------- 167 | // Row5 type methods 168 | // ------------------------------------------------------------------------- 169 | 170 | @Override 171 | public Row5 fieldsRow() { 172 | return (Row5) super.fieldsRow(); 173 | } 174 | 175 | /** 176 | * Convenience mapping calling {@link SelectField#convertFrom(Function)}. 177 | */ 178 | public SelectField mapping(Function5 from) { 179 | return convertFrom(Records.mapping(from)); 180 | } 181 | 182 | /** 183 | * Convenience mapping calling {@link SelectField#convertFrom(Class, 184 | * Function)}. 185 | */ 186 | public SelectField mapping(Class toType, Function5 from) { 187 | return convertFrom(toType, Records.mapping(from)); 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/Bookmarks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.Keys; 8 | import com.sivalabs.bookmarks.jooq.Public; 9 | import com.sivalabs.bookmarks.jooq.tables.records.BookmarksRecord; 10 | 11 | import java.time.OffsetDateTime; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.function.Function; 15 | 16 | import org.jooq.Field; 17 | import org.jooq.ForeignKey; 18 | import org.jooq.Function6; 19 | import org.jooq.Identity; 20 | import org.jooq.Name; 21 | import org.jooq.Record; 22 | import org.jooq.Records; 23 | import org.jooq.Row6; 24 | import org.jooq.Schema; 25 | import org.jooq.SelectField; 26 | import org.jooq.Table; 27 | import org.jooq.TableField; 28 | import org.jooq.TableOptions; 29 | import org.jooq.UniqueKey; 30 | import org.jooq.impl.DSL; 31 | import org.jooq.impl.SQLDataType; 32 | import org.jooq.impl.TableImpl; 33 | 34 | 35 | /** 36 | * This class is generated by jOOQ. 37 | */ 38 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 39 | public class Bookmarks extends TableImpl { 40 | 41 | private static final long serialVersionUID = 1L; 42 | 43 | /** 44 | * The reference instance of public.bookmarks 45 | */ 46 | public static final Bookmarks BOOKMARKS = new Bookmarks(); 47 | 48 | /** 49 | * The class holding records for this type 50 | */ 51 | @Override 52 | public Class getRecordType() { 53 | return BookmarksRecord.class; 54 | } 55 | 56 | /** 57 | * The column public.bookmarks.id. 58 | */ 59 | public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); 60 | 61 | /** 62 | * The column public.bookmarks.url. 63 | */ 64 | public final TableField URL = createField(DSL.name("url"), SQLDataType.VARCHAR(1024).nullable(false), this, ""); 65 | 66 | /** 67 | * The column public.bookmarks.title. 68 | */ 69 | public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(1024), this, ""); 70 | 71 | /** 72 | * The column public.bookmarks.created_by. 73 | */ 74 | public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.BIGINT.nullable(false), this, ""); 75 | 76 | /** 77 | * The column public.bookmarks.created_at. 78 | */ 79 | public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); 80 | 81 | /** 82 | * The column public.bookmarks.updated_at. 83 | */ 84 | public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); 85 | 86 | private Bookmarks(Name alias, Table aliased) { 87 | this(alias, aliased, null); 88 | } 89 | 90 | private Bookmarks(Name alias, Table aliased, Field[] parameters) { 91 | super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); 92 | } 93 | 94 | /** 95 | * Create an aliased public.bookmarks table reference 96 | */ 97 | public Bookmarks(String alias) { 98 | this(DSL.name(alias), BOOKMARKS); 99 | } 100 | 101 | /** 102 | * Create an aliased public.bookmarks table reference 103 | */ 104 | public Bookmarks(Name alias) { 105 | this(alias, BOOKMARKS); 106 | } 107 | 108 | /** 109 | * Create a public.bookmarks table reference 110 | */ 111 | public Bookmarks() { 112 | this(DSL.name("bookmarks"), null); 113 | } 114 | 115 | public Bookmarks(Table child, ForeignKey key) { 116 | super(child, key, BOOKMARKS); 117 | } 118 | 119 | @Override 120 | public Schema getSchema() { 121 | return aliased() ? null : Public.PUBLIC; 122 | } 123 | 124 | @Override 125 | public Identity getIdentity() { 126 | return (Identity) super.getIdentity(); 127 | } 128 | 129 | @Override 130 | public UniqueKey getPrimaryKey() { 131 | return Keys.BOOKMARKS_PKEY; 132 | } 133 | 134 | @Override 135 | public List> getReferences() { 136 | return Arrays.asList(Keys.BOOKMARKS__BOOKMARKS_CREATED_BY_FKEY); 137 | } 138 | 139 | private transient Users _users; 140 | 141 | /** 142 | * Get the implicit join path to the public.users table. 143 | */ 144 | public Users users() { 145 | if (_users == null) 146 | _users = new Users(this, Keys.BOOKMARKS__BOOKMARKS_CREATED_BY_FKEY); 147 | 148 | return _users; 149 | } 150 | 151 | @Override 152 | public Bookmarks as(String alias) { 153 | return new Bookmarks(DSL.name(alias), this); 154 | } 155 | 156 | @Override 157 | public Bookmarks as(Name alias) { 158 | return new Bookmarks(alias, this); 159 | } 160 | 161 | @Override 162 | public Bookmarks as(Table alias) { 163 | return new Bookmarks(alias.getQualifiedName(), this); 164 | } 165 | 166 | /** 167 | * Rename this table 168 | */ 169 | @Override 170 | public Bookmarks rename(String name) { 171 | return new Bookmarks(DSL.name(name), null); 172 | } 173 | 174 | /** 175 | * Rename this table 176 | */ 177 | @Override 178 | public Bookmarks rename(Name name) { 179 | return new Bookmarks(name, null); 180 | } 181 | 182 | /** 183 | * Rename this table 184 | */ 185 | @Override 186 | public Bookmarks rename(Table name) { 187 | return new Bookmarks(name.getQualifiedName(), null); 188 | } 189 | 190 | // ------------------------------------------------------------------------- 191 | // Row6 type methods 192 | // ------------------------------------------------------------------------- 193 | 194 | @Override 195 | public Row6 fieldsRow() { 196 | return (Row6) super.fieldsRow(); 197 | } 198 | 199 | /** 200 | * Convenience mapping calling {@link SelectField#convertFrom(Function)}. 201 | */ 202 | public SelectField mapping(Function6 from) { 203 | return convertFrom(Records.mapping(from)); 204 | } 205 | 206 | /** 207 | * Convenience mapping calling {@link SelectField#convertFrom(Class, 208 | * Function)}. 209 | */ 210 | public SelectField mapping(Class toType, Function6 from) { 211 | return convertFrom(toType, Records.mapping(from)); 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/records/UserPreferencesRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables.records; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.UserPreferences; 8 | 9 | import java.time.OffsetDateTime; 10 | 11 | import org.jooq.Field; 12 | import org.jooq.Record1; 13 | import org.jooq.Record5; 14 | import org.jooq.Row5; 15 | import org.jooq.impl.UpdatableRecordImpl; 16 | 17 | 18 | /** 19 | * This class is generated by jOOQ. 20 | */ 21 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 22 | public class UserPreferencesRecord extends UpdatableRecordImpl implements Record5 { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Setter for public.user_preferences.id. 28 | */ 29 | public void setId(Long value) { 30 | set(0, value); 31 | } 32 | 33 | /** 34 | * Getter for public.user_preferences.id. 35 | */ 36 | public Long getId() { 37 | return (Long) get(0); 38 | } 39 | 40 | /** 41 | * Setter for public.user_preferences.theme. 42 | */ 43 | public void setTheme(String value) { 44 | set(1, value); 45 | } 46 | 47 | /** 48 | * Getter for public.user_preferences.theme. 49 | */ 50 | public String getTheme() { 51 | return (String) get(1); 52 | } 53 | 54 | /** 55 | * Setter for public.user_preferences.language. 56 | */ 57 | public void setLanguage(String value) { 58 | set(2, value); 59 | } 60 | 61 | /** 62 | * Getter for public.user_preferences.language. 63 | */ 64 | public String getLanguage() { 65 | return (String) get(2); 66 | } 67 | 68 | /** 69 | * Setter for public.user_preferences.created_at. 70 | */ 71 | public void setCreatedAt(OffsetDateTime value) { 72 | set(3, value); 73 | } 74 | 75 | /** 76 | * Getter for public.user_preferences.created_at. 77 | */ 78 | public OffsetDateTime getCreatedAt() { 79 | return (OffsetDateTime) get(3); 80 | } 81 | 82 | /** 83 | * Setter for public.user_preferences.updated_at. 84 | */ 85 | public void setUpdatedAt(OffsetDateTime value) { 86 | set(4, value); 87 | } 88 | 89 | /** 90 | * Getter for public.user_preferences.updated_at. 91 | */ 92 | public OffsetDateTime getUpdatedAt() { 93 | return (OffsetDateTime) get(4); 94 | } 95 | 96 | // ------------------------------------------------------------------------- 97 | // Primary key information 98 | // ------------------------------------------------------------------------- 99 | 100 | @Override 101 | public Record1 key() { 102 | return (Record1) super.key(); 103 | } 104 | 105 | // ------------------------------------------------------------------------- 106 | // Record5 type implementation 107 | // ------------------------------------------------------------------------- 108 | 109 | @Override 110 | public Row5 fieldsRow() { 111 | return (Row5) super.fieldsRow(); 112 | } 113 | 114 | @Override 115 | public Row5 valuesRow() { 116 | return (Row5) super.valuesRow(); 117 | } 118 | 119 | @Override 120 | public Field field1() { 121 | return UserPreferences.USER_PREFERENCES.ID; 122 | } 123 | 124 | @Override 125 | public Field field2() { 126 | return UserPreferences.USER_PREFERENCES.THEME; 127 | } 128 | 129 | @Override 130 | public Field field3() { 131 | return UserPreferences.USER_PREFERENCES.LANGUAGE; 132 | } 133 | 134 | @Override 135 | public Field field4() { 136 | return UserPreferences.USER_PREFERENCES.CREATED_AT; 137 | } 138 | 139 | @Override 140 | public Field field5() { 141 | return UserPreferences.USER_PREFERENCES.UPDATED_AT; 142 | } 143 | 144 | @Override 145 | public Long component1() { 146 | return getId(); 147 | } 148 | 149 | @Override 150 | public String component2() { 151 | return getTheme(); 152 | } 153 | 154 | @Override 155 | public String component3() { 156 | return getLanguage(); 157 | } 158 | 159 | @Override 160 | public OffsetDateTime component4() { 161 | return getCreatedAt(); 162 | } 163 | 164 | @Override 165 | public OffsetDateTime component5() { 166 | return getUpdatedAt(); 167 | } 168 | 169 | @Override 170 | public Long value1() { 171 | return getId(); 172 | } 173 | 174 | @Override 175 | public String value2() { 176 | return getTheme(); 177 | } 178 | 179 | @Override 180 | public String value3() { 181 | return getLanguage(); 182 | } 183 | 184 | @Override 185 | public OffsetDateTime value4() { 186 | return getCreatedAt(); 187 | } 188 | 189 | @Override 190 | public OffsetDateTime value5() { 191 | return getUpdatedAt(); 192 | } 193 | 194 | @Override 195 | public UserPreferencesRecord value1(Long value) { 196 | setId(value); 197 | return this; 198 | } 199 | 200 | @Override 201 | public UserPreferencesRecord value2(String value) { 202 | setTheme(value); 203 | return this; 204 | } 205 | 206 | @Override 207 | public UserPreferencesRecord value3(String value) { 208 | setLanguage(value); 209 | return this; 210 | } 211 | 212 | @Override 213 | public UserPreferencesRecord value4(OffsetDateTime value) { 214 | setCreatedAt(value); 215 | return this; 216 | } 217 | 218 | @Override 219 | public UserPreferencesRecord value5(OffsetDateTime value) { 220 | setUpdatedAt(value); 221 | return this; 222 | } 223 | 224 | @Override 225 | public UserPreferencesRecord values(Long value1, String value2, String value3, OffsetDateTime value4, OffsetDateTime value5) { 226 | value1(value1); 227 | value2(value2); 228 | value3(value3); 229 | value4(value4); 230 | value5(value5); 231 | return this; 232 | } 233 | 234 | // ------------------------------------------------------------------------- 235 | // Constructors 236 | // ------------------------------------------------------------------------- 237 | 238 | /** 239 | * Create a detached UserPreferencesRecord 240 | */ 241 | public UserPreferencesRecord() { 242 | super(UserPreferences.USER_PREFERENCES); 243 | } 244 | 245 | /** 246 | * Create a detached, initialised UserPreferencesRecord 247 | */ 248 | public UserPreferencesRecord(Long id, String theme, String language, OffsetDateTime createdAt, OffsetDateTime updatedAt) { 249 | super(UserPreferences.USER_PREFERENCES); 250 | 251 | setId(id); 252 | setTheme(theme); 253 | setLanguage(language); 254 | setCreatedAt(createdAt); 255 | setUpdatedAt(updatedAt); 256 | resetChangedOnNotNull(); 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/Users.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.Keys; 8 | import com.sivalabs.bookmarks.jooq.Public; 9 | import com.sivalabs.bookmarks.jooq.tables.records.UsersRecord; 10 | 11 | import java.time.OffsetDateTime; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.function.Function; 15 | 16 | import org.jooq.Field; 17 | import org.jooq.ForeignKey; 18 | import org.jooq.Function7; 19 | import org.jooq.Identity; 20 | import org.jooq.Name; 21 | import org.jooq.Record; 22 | import org.jooq.Records; 23 | import org.jooq.Row7; 24 | import org.jooq.Schema; 25 | import org.jooq.SelectField; 26 | import org.jooq.Table; 27 | import org.jooq.TableField; 28 | import org.jooq.TableOptions; 29 | import org.jooq.UniqueKey; 30 | import org.jooq.impl.DSL; 31 | import org.jooq.impl.SQLDataType; 32 | import org.jooq.impl.TableImpl; 33 | 34 | 35 | /** 36 | * This class is generated by jOOQ. 37 | */ 38 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 39 | public class Users extends TableImpl { 40 | 41 | private static final long serialVersionUID = 1L; 42 | 43 | /** 44 | * The reference instance of public.users 45 | */ 46 | public static final Users USERS = new Users(); 47 | 48 | /** 49 | * The class holding records for this type 50 | */ 51 | @Override 52 | public Class getRecordType() { 53 | return UsersRecord.class; 54 | } 55 | 56 | /** 57 | * The column public.users.id. 58 | */ 59 | public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); 60 | 61 | /** 62 | * The column public.users.name. 63 | */ 64 | public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); 65 | 66 | /** 67 | * The column public.users.email. 68 | */ 69 | public final TableField EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255).nullable(false), this, ""); 70 | 71 | /** 72 | * The column public.users.password. 73 | */ 74 | public final TableField PASSWORD = createField(DSL.name("password"), SQLDataType.VARCHAR(255).nullable(false), this, ""); 75 | 76 | /** 77 | * The column public.users.preferences_id. 78 | */ 79 | public final TableField PREFERENCES_ID = createField(DSL.name("preferences_id"), SQLDataType.BIGINT, this, ""); 80 | 81 | /** 82 | * The column public.users.created_at. 83 | */ 84 | public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); 85 | 86 | /** 87 | * The column public.users.updated_at. 88 | */ 89 | public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); 90 | 91 | private Users(Name alias, Table aliased) { 92 | this(alias, aliased, null); 93 | } 94 | 95 | private Users(Name alias, Table aliased, Field[] parameters) { 96 | super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); 97 | } 98 | 99 | /** 100 | * Create an aliased public.users table reference 101 | */ 102 | public Users(String alias) { 103 | this(DSL.name(alias), USERS); 104 | } 105 | 106 | /** 107 | * Create an aliased public.users table reference 108 | */ 109 | public Users(Name alias) { 110 | this(alias, USERS); 111 | } 112 | 113 | /** 114 | * Create a public.users table reference 115 | */ 116 | public Users() { 117 | this(DSL.name("users"), null); 118 | } 119 | 120 | public Users(Table child, ForeignKey key) { 121 | super(child, key, USERS); 122 | } 123 | 124 | @Override 125 | public Schema getSchema() { 126 | return aliased() ? null : Public.PUBLIC; 127 | } 128 | 129 | @Override 130 | public Identity getIdentity() { 131 | return (Identity) super.getIdentity(); 132 | } 133 | 134 | @Override 135 | public UniqueKey getPrimaryKey() { 136 | return Keys.USERS_PKEY; 137 | } 138 | 139 | @Override 140 | public List> getUniqueKeys() { 141 | return Arrays.asList(Keys.USER_EMAIL_UNIQUE); 142 | } 143 | 144 | @Override 145 | public List> getReferences() { 146 | return Arrays.asList(Keys.USERS__USERS_PREFERENCES_ID_FKEY); 147 | } 148 | 149 | private transient UserPreferences _userPreferences; 150 | 151 | /** 152 | * Get the implicit join path to the public.user_preferences 153 | * table. 154 | */ 155 | public UserPreferences userPreferences() { 156 | if (_userPreferences == null) 157 | _userPreferences = new UserPreferences(this, Keys.USERS__USERS_PREFERENCES_ID_FKEY); 158 | 159 | return _userPreferences; 160 | } 161 | 162 | @Override 163 | public Users as(String alias) { 164 | return new Users(DSL.name(alias), this); 165 | } 166 | 167 | @Override 168 | public Users as(Name alias) { 169 | return new Users(alias, this); 170 | } 171 | 172 | @Override 173 | public Users as(Table alias) { 174 | return new Users(alias.getQualifiedName(), this); 175 | } 176 | 177 | /** 178 | * Rename this table 179 | */ 180 | @Override 181 | public Users rename(String name) { 182 | return new Users(DSL.name(name), null); 183 | } 184 | 185 | /** 186 | * Rename this table 187 | */ 188 | @Override 189 | public Users rename(Name name) { 190 | return new Users(name, null); 191 | } 192 | 193 | /** 194 | * Rename this table 195 | */ 196 | @Override 197 | public Users rename(Table name) { 198 | return new Users(name.getQualifiedName(), null); 199 | } 200 | 201 | // ------------------------------------------------------------------------- 202 | // Row7 type methods 203 | // ------------------------------------------------------------------------- 204 | 205 | @Override 206 | public Row7 fieldsRow() { 207 | return (Row7) super.fieldsRow(); 208 | } 209 | 210 | /** 211 | * Convenience mapping calling {@link SelectField#convertFrom(Function)}. 212 | */ 213 | public SelectField mapping(Function7 from) { 214 | return convertFrom(Records.mapping(from)); 215 | } 216 | 217 | /** 218 | * Convenience mapping calling {@link SelectField#convertFrom(Class, 219 | * Function)}. 220 | */ 221 | public SelectField mapping(Class toType, Function7 from) { 222 | return convertFrom(toType, Records.mapping(from)); 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | org.springframework.boot 9 | spring-boot-starter-parent 10 | 3.1.4 11 | 12 | 13 | com.sivalabs 14 | spring-boot-jooq-demo 15 | 0.0.1-SNAPSHOT 16 | spring-boot-jooq-demo 17 | spring-boot-jooq-demo 18 | 19 | 17 20 | 1.19.1 21 | 0.0.3 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-jooq 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-thymeleaf 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-validation 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-web 39 | 40 | 41 | org.flywaydb 42 | flyway-core 43 | 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-devtools 48 | runtime 49 | true 50 | 51 | 52 | org.postgresql 53 | postgresql 54 | runtime 55 | 56 | 57 | org.springframework.boot 58 | spring-boot-configuration-processor 59 | true 60 | 61 | 62 | org.projectlombok 63 | lombok 64 | true 65 | 66 | 67 | org.springframework.boot 68 | spring-boot-starter-test 69 | test 70 | 71 | 72 | org.springframework.boot 73 | spring-boot-testcontainers 74 | test 75 | 76 | 77 | org.testcontainers 78 | junit-jupiter 79 | test 80 | 81 | 82 | org.testcontainers 83 | postgresql 84 | 85 | 86 | 87 | 88 | 89 | 90 | org.springframework.boot 91 | spring-boot-maven-plugin 92 | 93 | 94 | 95 | org.projectlombok 96 | lombok 97 | 98 | 99 | 100 | 101 | 102 | 103 | org.testcontainers 104 | testcontainers-jooq-codegen-maven-plugin 105 | ${tc-jooq-codegen-plugin.version} 106 | 107 | 108 | org.testcontainers 109 | postgresql 110 | ${testcontainers.version} 111 | 112 | 113 | org.postgresql 114 | postgresql 115 | ${postgresql.version} 116 | 117 | 118 | 119 | 120 | generate-jooq-sources 121 | 122 | generate 123 | 124 | generate-sources 125 | 126 | 127 | POSTGRES 128 | postgres:16-alpine 129 | 130 | 131 | 132 | filesystem:${project.basedir}/src/main/resources/db/migration 133 | 134 | 135 | 136 | 137 | 138 | true 139 | 140 | 141 | public 142 | .* 143 | 144 | flyway_schema_history 145 | 146 | 147 | 148 | true 149 | com.sivalabs.bookmarks.jooq 150 | src/main/jooq 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | org.codehaus.mojo 160 | build-helper-maven-plugin 161 | 162 | 163 | generate-sources 164 | 165 | add-source 166 | 167 | 168 | 169 | src/main/jooq 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/records/BookmarksRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables.records; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.Bookmarks; 8 | 9 | import java.time.OffsetDateTime; 10 | 11 | import org.jooq.Field; 12 | import org.jooq.Record1; 13 | import org.jooq.Record6; 14 | import org.jooq.Row6; 15 | import org.jooq.impl.UpdatableRecordImpl; 16 | 17 | 18 | /** 19 | * This class is generated by jOOQ. 20 | */ 21 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 22 | public class BookmarksRecord extends UpdatableRecordImpl implements Record6 { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Setter for public.bookmarks.id. 28 | */ 29 | public void setId(Long value) { 30 | set(0, value); 31 | } 32 | 33 | /** 34 | * Getter for public.bookmarks.id. 35 | */ 36 | public Long getId() { 37 | return (Long) get(0); 38 | } 39 | 40 | /** 41 | * Setter for public.bookmarks.url. 42 | */ 43 | public void setUrl(String value) { 44 | set(1, value); 45 | } 46 | 47 | /** 48 | * Getter for public.bookmarks.url. 49 | */ 50 | public String getUrl() { 51 | return (String) get(1); 52 | } 53 | 54 | /** 55 | * Setter for public.bookmarks.title. 56 | */ 57 | public void setTitle(String value) { 58 | set(2, value); 59 | } 60 | 61 | /** 62 | * Getter for public.bookmarks.title. 63 | */ 64 | public String getTitle() { 65 | return (String) get(2); 66 | } 67 | 68 | /** 69 | * Setter for public.bookmarks.created_by. 70 | */ 71 | public void setCreatedBy(Long value) { 72 | set(3, value); 73 | } 74 | 75 | /** 76 | * Getter for public.bookmarks.created_by. 77 | */ 78 | public Long getCreatedBy() { 79 | return (Long) get(3); 80 | } 81 | 82 | /** 83 | * Setter for public.bookmarks.created_at. 84 | */ 85 | public void setCreatedAt(OffsetDateTime value) { 86 | set(4, value); 87 | } 88 | 89 | /** 90 | * Getter for public.bookmarks.created_at. 91 | */ 92 | public OffsetDateTime getCreatedAt() { 93 | return (OffsetDateTime) get(4); 94 | } 95 | 96 | /** 97 | * Setter for public.bookmarks.updated_at. 98 | */ 99 | public void setUpdatedAt(OffsetDateTime value) { 100 | set(5, value); 101 | } 102 | 103 | /** 104 | * Getter for public.bookmarks.updated_at. 105 | */ 106 | public OffsetDateTime getUpdatedAt() { 107 | return (OffsetDateTime) get(5); 108 | } 109 | 110 | // ------------------------------------------------------------------------- 111 | // Primary key information 112 | // ------------------------------------------------------------------------- 113 | 114 | @Override 115 | public Record1 key() { 116 | return (Record1) super.key(); 117 | } 118 | 119 | // ------------------------------------------------------------------------- 120 | // Record6 type implementation 121 | // ------------------------------------------------------------------------- 122 | 123 | @Override 124 | public Row6 fieldsRow() { 125 | return (Row6) super.fieldsRow(); 126 | } 127 | 128 | @Override 129 | public Row6 valuesRow() { 130 | return (Row6) super.valuesRow(); 131 | } 132 | 133 | @Override 134 | public Field field1() { 135 | return Bookmarks.BOOKMARKS.ID; 136 | } 137 | 138 | @Override 139 | public Field field2() { 140 | return Bookmarks.BOOKMARKS.URL; 141 | } 142 | 143 | @Override 144 | public Field field3() { 145 | return Bookmarks.BOOKMARKS.TITLE; 146 | } 147 | 148 | @Override 149 | public Field field4() { 150 | return Bookmarks.BOOKMARKS.CREATED_BY; 151 | } 152 | 153 | @Override 154 | public Field field5() { 155 | return Bookmarks.BOOKMARKS.CREATED_AT; 156 | } 157 | 158 | @Override 159 | public Field field6() { 160 | return Bookmarks.BOOKMARKS.UPDATED_AT; 161 | } 162 | 163 | @Override 164 | public Long component1() { 165 | return getId(); 166 | } 167 | 168 | @Override 169 | public String component2() { 170 | return getUrl(); 171 | } 172 | 173 | @Override 174 | public String component3() { 175 | return getTitle(); 176 | } 177 | 178 | @Override 179 | public Long component4() { 180 | return getCreatedBy(); 181 | } 182 | 183 | @Override 184 | public OffsetDateTime component5() { 185 | return getCreatedAt(); 186 | } 187 | 188 | @Override 189 | public OffsetDateTime component6() { 190 | return getUpdatedAt(); 191 | } 192 | 193 | @Override 194 | public Long value1() { 195 | return getId(); 196 | } 197 | 198 | @Override 199 | public String value2() { 200 | return getUrl(); 201 | } 202 | 203 | @Override 204 | public String value3() { 205 | return getTitle(); 206 | } 207 | 208 | @Override 209 | public Long value4() { 210 | return getCreatedBy(); 211 | } 212 | 213 | @Override 214 | public OffsetDateTime value5() { 215 | return getCreatedAt(); 216 | } 217 | 218 | @Override 219 | public OffsetDateTime value6() { 220 | return getUpdatedAt(); 221 | } 222 | 223 | @Override 224 | public BookmarksRecord value1(Long value) { 225 | setId(value); 226 | return this; 227 | } 228 | 229 | @Override 230 | public BookmarksRecord value2(String value) { 231 | setUrl(value); 232 | return this; 233 | } 234 | 235 | @Override 236 | public BookmarksRecord value3(String value) { 237 | setTitle(value); 238 | return this; 239 | } 240 | 241 | @Override 242 | public BookmarksRecord value4(Long value) { 243 | setCreatedBy(value); 244 | return this; 245 | } 246 | 247 | @Override 248 | public BookmarksRecord value5(OffsetDateTime value) { 249 | setCreatedAt(value); 250 | return this; 251 | } 252 | 253 | @Override 254 | public BookmarksRecord value6(OffsetDateTime value) { 255 | setUpdatedAt(value); 256 | return this; 257 | } 258 | 259 | @Override 260 | public BookmarksRecord values(Long value1, String value2, String value3, Long value4, OffsetDateTime value5, OffsetDateTime value6) { 261 | value1(value1); 262 | value2(value2); 263 | value3(value3); 264 | value4(value4); 265 | value5(value5); 266 | value6(value6); 267 | return this; 268 | } 269 | 270 | // ------------------------------------------------------------------------- 271 | // Constructors 272 | // ------------------------------------------------------------------------- 273 | 274 | /** 275 | * Create a detached BookmarksRecord 276 | */ 277 | public BookmarksRecord() { 278 | super(Bookmarks.BOOKMARKS); 279 | } 280 | 281 | /** 282 | * Create a detached, initialised BookmarksRecord 283 | */ 284 | public BookmarksRecord(Long id, String url, String title, Long createdBy, OffsetDateTime createdAt, OffsetDateTime updatedAt) { 285 | super(Bookmarks.BOOKMARKS); 286 | 287 | setId(id); 288 | setUrl(url); 289 | setTitle(title); 290 | setCreatedBy(createdBy); 291 | setCreatedAt(createdAt); 292 | setUpdatedAt(updatedAt); 293 | resetChangedOnNotNull(); 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /src/main/jooq/com/sivalabs/bookmarks/jooq/tables/records/UsersRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is generated by jOOQ. 3 | */ 4 | package com.sivalabs.bookmarks.jooq.tables.records; 5 | 6 | 7 | import com.sivalabs.bookmarks.jooq.tables.Users; 8 | 9 | import java.time.OffsetDateTime; 10 | 11 | import org.jooq.Field; 12 | import org.jooq.Record1; 13 | import org.jooq.Record7; 14 | import org.jooq.Row7; 15 | import org.jooq.impl.UpdatableRecordImpl; 16 | 17 | 18 | /** 19 | * This class is generated by jOOQ. 20 | */ 21 | @SuppressWarnings({ "all", "unchecked", "rawtypes" }) 22 | public class UsersRecord extends UpdatableRecordImpl implements Record7 { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Setter for public.users.id. 28 | */ 29 | public void setId(Long value) { 30 | set(0, value); 31 | } 32 | 33 | /** 34 | * Getter for public.users.id. 35 | */ 36 | public Long getId() { 37 | return (Long) get(0); 38 | } 39 | 40 | /** 41 | * Setter for public.users.name. 42 | */ 43 | public void setName(String value) { 44 | set(1, value); 45 | } 46 | 47 | /** 48 | * Getter for public.users.name. 49 | */ 50 | public String getName() { 51 | return (String) get(1); 52 | } 53 | 54 | /** 55 | * Setter for public.users.email. 56 | */ 57 | public void setEmail(String value) { 58 | set(2, value); 59 | } 60 | 61 | /** 62 | * Getter for public.users.email. 63 | */ 64 | public String getEmail() { 65 | return (String) get(2); 66 | } 67 | 68 | /** 69 | * Setter for public.users.password. 70 | */ 71 | public void setPassword(String value) { 72 | set(3, value); 73 | } 74 | 75 | /** 76 | * Getter for public.users.password. 77 | */ 78 | public String getPassword() { 79 | return (String) get(3); 80 | } 81 | 82 | /** 83 | * Setter for public.users.preferences_id. 84 | */ 85 | public void setPreferencesId(Long value) { 86 | set(4, value); 87 | } 88 | 89 | /** 90 | * Getter for public.users.preferences_id. 91 | */ 92 | public Long getPreferencesId() { 93 | return (Long) get(4); 94 | } 95 | 96 | /** 97 | * Setter for public.users.created_at. 98 | */ 99 | public void setCreatedAt(OffsetDateTime value) { 100 | set(5, value); 101 | } 102 | 103 | /** 104 | * Getter for public.users.created_at. 105 | */ 106 | public OffsetDateTime getCreatedAt() { 107 | return (OffsetDateTime) get(5); 108 | } 109 | 110 | /** 111 | * Setter for public.users.updated_at. 112 | */ 113 | public void setUpdatedAt(OffsetDateTime value) { 114 | set(6, value); 115 | } 116 | 117 | /** 118 | * Getter for public.users.updated_at. 119 | */ 120 | public OffsetDateTime getUpdatedAt() { 121 | return (OffsetDateTime) get(6); 122 | } 123 | 124 | // ------------------------------------------------------------------------- 125 | // Primary key information 126 | // ------------------------------------------------------------------------- 127 | 128 | @Override 129 | public Record1 key() { 130 | return (Record1) super.key(); 131 | } 132 | 133 | // ------------------------------------------------------------------------- 134 | // Record7 type implementation 135 | // ------------------------------------------------------------------------- 136 | 137 | @Override 138 | public Row7 fieldsRow() { 139 | return (Row7) super.fieldsRow(); 140 | } 141 | 142 | @Override 143 | public Row7 valuesRow() { 144 | return (Row7) super.valuesRow(); 145 | } 146 | 147 | @Override 148 | public Field field1() { 149 | return Users.USERS.ID; 150 | } 151 | 152 | @Override 153 | public Field field2() { 154 | return Users.USERS.NAME; 155 | } 156 | 157 | @Override 158 | public Field field3() { 159 | return Users.USERS.EMAIL; 160 | } 161 | 162 | @Override 163 | public Field field4() { 164 | return Users.USERS.PASSWORD; 165 | } 166 | 167 | @Override 168 | public Field field5() { 169 | return Users.USERS.PREFERENCES_ID; 170 | } 171 | 172 | @Override 173 | public Field field6() { 174 | return Users.USERS.CREATED_AT; 175 | } 176 | 177 | @Override 178 | public Field field7() { 179 | return Users.USERS.UPDATED_AT; 180 | } 181 | 182 | @Override 183 | public Long component1() { 184 | return getId(); 185 | } 186 | 187 | @Override 188 | public String component2() { 189 | return getName(); 190 | } 191 | 192 | @Override 193 | public String component3() { 194 | return getEmail(); 195 | } 196 | 197 | @Override 198 | public String component4() { 199 | return getPassword(); 200 | } 201 | 202 | @Override 203 | public Long component5() { 204 | return getPreferencesId(); 205 | } 206 | 207 | @Override 208 | public OffsetDateTime component6() { 209 | return getCreatedAt(); 210 | } 211 | 212 | @Override 213 | public OffsetDateTime component7() { 214 | return getUpdatedAt(); 215 | } 216 | 217 | @Override 218 | public Long value1() { 219 | return getId(); 220 | } 221 | 222 | @Override 223 | public String value2() { 224 | return getName(); 225 | } 226 | 227 | @Override 228 | public String value3() { 229 | return getEmail(); 230 | } 231 | 232 | @Override 233 | public String value4() { 234 | return getPassword(); 235 | } 236 | 237 | @Override 238 | public Long value5() { 239 | return getPreferencesId(); 240 | } 241 | 242 | @Override 243 | public OffsetDateTime value6() { 244 | return getCreatedAt(); 245 | } 246 | 247 | @Override 248 | public OffsetDateTime value7() { 249 | return getUpdatedAt(); 250 | } 251 | 252 | @Override 253 | public UsersRecord value1(Long value) { 254 | setId(value); 255 | return this; 256 | } 257 | 258 | @Override 259 | public UsersRecord value2(String value) { 260 | setName(value); 261 | return this; 262 | } 263 | 264 | @Override 265 | public UsersRecord value3(String value) { 266 | setEmail(value); 267 | return this; 268 | } 269 | 270 | @Override 271 | public UsersRecord value4(String value) { 272 | setPassword(value); 273 | return this; 274 | } 275 | 276 | @Override 277 | public UsersRecord value5(Long value) { 278 | setPreferencesId(value); 279 | return this; 280 | } 281 | 282 | @Override 283 | public UsersRecord value6(OffsetDateTime value) { 284 | setCreatedAt(value); 285 | return this; 286 | } 287 | 288 | @Override 289 | public UsersRecord value7(OffsetDateTime value) { 290 | setUpdatedAt(value); 291 | return this; 292 | } 293 | 294 | @Override 295 | public UsersRecord values(Long value1, String value2, String value3, String value4, Long value5, OffsetDateTime value6, OffsetDateTime value7) { 296 | value1(value1); 297 | value2(value2); 298 | value3(value3); 299 | value4(value4); 300 | value5(value5); 301 | value6(value6); 302 | value7(value7); 303 | return this; 304 | } 305 | 306 | // ------------------------------------------------------------------------- 307 | // Constructors 308 | // ------------------------------------------------------------------------- 309 | 310 | /** 311 | * Create a detached UsersRecord 312 | */ 313 | public UsersRecord() { 314 | super(Users.USERS); 315 | } 316 | 317 | /** 318 | * Create a detached, initialised UsersRecord 319 | */ 320 | public UsersRecord(Long id, String name, String email, String password, Long preferencesId, OffsetDateTime createdAt, OffsetDateTime updatedAt) { 321 | super(Users.USERS); 322 | 323 | setId(id); 324 | setName(name); 325 | setEmail(email); 326 | setPassword(password); 327 | setPreferencesId(preferencesId); 328 | setCreatedAt(createdAt); 329 | setUpdatedAt(updatedAt); 330 | resetChangedOnNotNull(); 331 | } 332 | } 333 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | --------------------------------------------------------------------------------