feat: template property jooq generate

This commit is contained in:
vran 2022-03-22 15:46:32 +08:00
parent 4deebab2cb
commit 2939359486
7 changed files with 659 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseType;
import com.databasir.dao.tables.DocumentDescription;
import com.databasir.dao.tables.DocumentDiscussion;
import com.databasir.dao.tables.DocumentTemplateProperty;
import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.OauthApp;
@ -78,6 +79,11 @@ public class Databasir extends SchemaImpl {
*/
public final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
/**
* template property
*/
public final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY;
/**
* The table <code>databasir.group</code>.
*/
@ -180,6 +186,7 @@ public class Databasir extends SchemaImpl {
DatabaseType.DATABASE_TYPE,
DocumentDescription.DOCUMENT_DESCRIPTION,
DocumentDiscussion.DOCUMENT_DISCUSSION,
DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY,
Group.GROUP,
Login.LOGIN,
OauthApp.OAUTH_APP,

View File

@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseType;
import com.databasir.dao.tables.DocumentDescription;
import com.databasir.dao.tables.DocumentDiscussion;
import com.databasir.dao.tables.DocumentTemplateProperty;
import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.OauthApp;
@ -32,6 +33,7 @@ import com.databasir.dao.tables.records.DatabaseDocumentRecord;
import com.databasir.dao.tables.records.DatabaseTypeRecord;
import com.databasir.dao.tables.records.DocumentDescriptionRecord;
import com.databasir.dao.tables.records.DocumentDiscussionRecord;
import com.databasir.dao.tables.records.DocumentTemplatePropertyRecord;
import com.databasir.dao.tables.records.GroupRecord;
import com.databasir.dao.tables.records.LoginRecord;
import com.databasir.dao.tables.records.OauthAppRecord;
@ -75,6 +77,8 @@ public class Keys {
public static final UniqueKey<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_PRIMARY = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_PRIMARY"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.ID }, true);
public static final UniqueKey<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_uk_project_id_table_name_column_name"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.PROJECT_ID, DocumentDescription.DOCUMENT_DESCRIPTION.TABLE_NAME, DocumentDescription.DOCUMENT_DESCRIPTION.COLUMN_NAME }, true);
public static final UniqueKey<DocumentDiscussionRecord> KEY_DOCUMENT_DISCUSSION_PRIMARY = Internal.createUniqueKey(DocumentDiscussion.DOCUMENT_DISCUSSION, DSL.name("KEY_document_discussion_PRIMARY"), new TableField[] { DocumentDiscussion.DOCUMENT_DISCUSSION.ID }, true);
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_PRIMARY"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.ID }, true);
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_uk_type_key"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.TYPE, DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.KEY }, true);
public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true);
public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true);
public static final UniqueKey<LoginRecord> KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { Login.LOGIN.USER_ID }, true);

View File

@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument;
import com.databasir.dao.tables.DatabaseType;
import com.databasir.dao.tables.DocumentDescription;
import com.databasir.dao.tables.DocumentDiscussion;
import com.databasir.dao.tables.DocumentTemplateProperty;
import com.databasir.dao.tables.Group;
import com.databasir.dao.tables.Login;
import com.databasir.dao.tables.OauthApp;
@ -64,6 +65,11 @@ public class Tables {
*/
public static final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
/**
* template property
*/
public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY;
/**
* The table <code>databasir.group</code>.
*/

View File

@ -0,0 +1,163 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables;
import com.databasir.dao.Databasir;
import com.databasir.dao.Keys;
import com.databasir.dao.tables.records.DocumentTemplatePropertyRecord;
import org.jooq.*;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
/**
* template property
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentTemplateProperty extends TableImpl<DocumentTemplatePropertyRecord> {
private static final long serialVersionUID = 1L;
/**
* The reference instance of
* <code>databasir.document_template_property</code>
*/
public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = new DocumentTemplateProperty();
/**
* The class holding records for this type
*/
@Override
public Class<DocumentTemplatePropertyRecord> getRecordType() {
return DocumentTemplatePropertyRecord.class;
}
/**
* The column <code>databasir.document_template_property.id</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");
/**
* The column <code>databasir.document_template_property.key</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, String> KEY = createField(DSL.name("key"), SQLDataType.VARCHAR(255).nullable(false), this, "");
/**
* The column <code>databasir.document_template_property.value</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, String> VALUE = createField(DSL.name("value"), SQLDataType.VARCHAR(255), this, "");
/**
* The column
* <code>databasir.document_template_property.default_value</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, String> DEFAULT_VALUE = createField(DSL.name("default_value"), SQLDataType.VARCHAR(255).nullable(false), this, "");
/**
* The column <code>databasir.document_template_property.type</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, String> TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR(64).nullable(false), this, "");
/**
* The column <code>databasir.document_template_property.create_at</code>.
*/
public final TableField<DocumentTemplatePropertyRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
private DocumentTemplateProperty(Name alias, Table<DocumentTemplatePropertyRecord> aliased) {
this(alias, aliased, null);
}
private DocumentTemplateProperty(Name alias, Table<DocumentTemplatePropertyRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment("template property"), TableOptions.table());
}
/**
* Create an aliased <code>databasir.document_template_property</code> table
* reference
*/
public DocumentTemplateProperty(String alias) {
this(DSL.name(alias), DOCUMENT_TEMPLATE_PROPERTY);
}
/**
* Create an aliased <code>databasir.document_template_property</code> table
* reference
*/
public DocumentTemplateProperty(Name alias) {
this(alias, DOCUMENT_TEMPLATE_PROPERTY);
}
/**
* Create a <code>databasir.document_template_property</code> table
* reference
*/
public DocumentTemplateProperty() {
this(DSL.name("document_template_property"), null);
}
public <O extends Record> DocumentTemplateProperty(Table<O> child, ForeignKey<O, DocumentTemplatePropertyRecord> key) {
super(child, key, DOCUMENT_TEMPLATE_PROPERTY);
}
@Override
public Schema getSchema() {
return aliased() ? null : Databasir.DATABASIR;
}
@Override
public Identity<DocumentTemplatePropertyRecord, Integer> getIdentity() {
return (Identity<DocumentTemplatePropertyRecord, Integer>) super.getIdentity();
}
@Override
public UniqueKey<DocumentTemplatePropertyRecord> getPrimaryKey() {
return Keys.KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY;
}
@Override
public List<UniqueKey<DocumentTemplatePropertyRecord>> getUniqueKeys() {
return Arrays.asList(Keys.KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY);
}
@Override
public DocumentTemplateProperty as(String alias) {
return new DocumentTemplateProperty(DSL.name(alias), this);
}
@Override
public DocumentTemplateProperty as(Name alias) {
return new DocumentTemplateProperty(alias, this);
}
/**
* Rename this table
*/
@Override
public DocumentTemplateProperty rename(String name) {
return new DocumentTemplateProperty(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public DocumentTemplateProperty rename(Name name) {
return new DocumentTemplateProperty(name, null);
}
// -------------------------------------------------------------------------
// Row6 type methods
// -------------------------------------------------------------------------
@Override
public Row6<Integer, String, String, String, String, LocalDateTime> fieldsRow() {
return (Row6) super.fieldsRow();
}
}

View File

@ -0,0 +1,153 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables.pojos;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* template property
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentTemplatePropertyPojo implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String key;
private String value;
private String defaultValue;
private String type;
private LocalDateTime createAt;
public DocumentTemplatePropertyPojo() {}
public DocumentTemplatePropertyPojo(DocumentTemplatePropertyPojo value) {
this.id = value.id;
this.key = value.key;
this.value = value.value;
this.defaultValue = value.defaultValue;
this.type = value.type;
this.createAt = value.createAt;
}
public DocumentTemplatePropertyPojo(
Integer id,
String key,
String value,
String defaultValue,
String type,
LocalDateTime createAt
) {
this.id = id;
this.key = key;
this.value = value;
this.defaultValue = defaultValue;
this.type = type;
this.createAt = createAt;
}
/**
* Getter for <code>databasir.document_template_property.id</code>.
*/
public Integer getId() {
return this.id;
}
/**
* Setter for <code>databasir.document_template_property.id</code>.
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Getter for <code>databasir.document_template_property.key</code>.
*/
public String getKey() {
return this.key;
}
/**
* Setter for <code>databasir.document_template_property.key</code>.
*/
public void setKey(String key) {
this.key = key;
}
/**
* Getter for <code>databasir.document_template_property.value</code>.
*/
public String getValue() {
return this.value;
}
/**
* Setter for <code>databasir.document_template_property.value</code>.
*/
public void setValue(String value) {
this.value = value;
}
/**
* Getter for
* <code>databasir.document_template_property.default_value</code>.
*/
public String getDefaultValue() {
return this.defaultValue;
}
/**
* Setter for
* <code>databasir.document_template_property.default_value</code>.
*/
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
/**
* Getter for <code>databasir.document_template_property.type</code>.
*/
public String getType() {
return this.type;
}
/**
* Setter for <code>databasir.document_template_property.type</code>.
*/
public void setType(String type) {
this.type = type;
}
/**
* Getter for <code>databasir.document_template_property.create_at</code>.
*/
public LocalDateTime getCreateAt() {
return this.createAt;
}
/**
* Setter for <code>databasir.document_template_property.create_at</code>.
*/
public void setCreateAt(LocalDateTime createAt) {
this.createAt = createAt;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("DocumentTemplatePropertyPojo (");
sb.append(id);
sb.append(", ").append(key);
sb.append(", ").append(value);
sb.append(", ").append(defaultValue);
sb.append(", ").append(type);
sb.append(", ").append(createAt);
sb.append(")");
return sb.toString();
}
}

View File

@ -0,0 +1,313 @@
/*
* This file is generated by jOOQ.
*/
package com.databasir.dao.tables.records;
import com.databasir.dao.tables.DocumentTemplateProperty;
import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo;
import java.time.LocalDateTime;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record6;
import org.jooq.Row6;
import org.jooq.impl.UpdatableRecordImpl;
/**
* template property
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DocumentTemplatePropertyRecord extends UpdatableRecordImpl<DocumentTemplatePropertyRecord> implements Record6<Integer, String, String, String, String, LocalDateTime> {
private static final long serialVersionUID = 1L;
/**
* Setter for <code>databasir.document_template_property.id</code>.
*/
public void setId(Integer value) {
set(0, value);
}
/**
* Getter for <code>databasir.document_template_property.id</code>.
*/
public Integer getId() {
return (Integer) get(0);
}
/**
* Setter for <code>databasir.document_template_property.key</code>.
*/
public void setKey(String value) {
set(1, value);
}
/**
* Getter for <code>databasir.document_template_property.key</code>.
*/
public String getKey() {
return (String) get(1);
}
/**
* Setter for <code>databasir.document_template_property.value</code>.
*/
public void setValue(String value) {
set(2, value);
}
/**
* Getter for <code>databasir.document_template_property.value</code>.
*/
public String getValue() {
return (String) get(2);
}
/**
* Setter for
* <code>databasir.document_template_property.default_value</code>.
*/
public void setDefaultValue(String value) {
set(3, value);
}
/**
* Getter for
* <code>databasir.document_template_property.default_value</code>.
*/
public String getDefaultValue() {
return (String) get(3);
}
/**
* Setter for <code>databasir.document_template_property.type</code>.
*/
public void setType(String value) {
set(4, value);
}
/**
* Getter for <code>databasir.document_template_property.type</code>.
*/
public String getType() {
return (String) get(4);
}
/**
* Setter for <code>databasir.document_template_property.create_at</code>.
*/
public void setCreateAt(LocalDateTime value) {
set(5, value);
}
/**
* Getter for <code>databasir.document_template_property.create_at</code>.
*/
public LocalDateTime getCreateAt() {
return (LocalDateTime) get(5);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@Override
public Record1<Integer> key() {
return (Record1) super.key();
}
// -------------------------------------------------------------------------
// Record6 type implementation
// -------------------------------------------------------------------------
@Override
public Row6<Integer, String, String, String, String, LocalDateTime> fieldsRow() {
return (Row6) super.fieldsRow();
}
@Override
public Row6<Integer, String, String, String, String, LocalDateTime> valuesRow() {
return (Row6) super.valuesRow();
}
@Override
public Field<Integer> field1() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.ID;
}
@Override
public Field<String> field2() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.KEY;
}
@Override
public Field<String> field3() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.VALUE;
}
@Override
public Field<String> field4() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.DEFAULT_VALUE;
}
@Override
public Field<String> field5() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.TYPE;
}
@Override
public Field<LocalDateTime> field6() {
return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.CREATE_AT;
}
@Override
public Integer component1() {
return getId();
}
@Override
public String component2() {
return getKey();
}
@Override
public String component3() {
return getValue();
}
@Override
public String component4() {
return getDefaultValue();
}
@Override
public String component5() {
return getType();
}
@Override
public LocalDateTime component6() {
return getCreateAt();
}
@Override
public Integer value1() {
return getId();
}
@Override
public String value2() {
return getKey();
}
@Override
public String value3() {
return getValue();
}
@Override
public String value4() {
return getDefaultValue();
}
@Override
public String value5() {
return getType();
}
@Override
public LocalDateTime value6() {
return getCreateAt();
}
@Override
public DocumentTemplatePropertyRecord value1(Integer value) {
setId(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord value2(String value) {
setKey(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord value3(String value) {
setValue(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord value4(String value) {
setDefaultValue(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord value5(String value) {
setType(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord value6(LocalDateTime value) {
setCreateAt(value);
return this;
}
@Override
public DocumentTemplatePropertyRecord values(Integer value1, String value2, String value3, String value4, String value5, LocalDateTime value6) {
value1(value1);
value2(value2);
value3(value3);
value4(value4);
value5(value5);
value6(value6);
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached DocumentTemplatePropertyRecord
*/
public DocumentTemplatePropertyRecord() {
super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY);
}
/**
* Create a detached, initialised DocumentTemplatePropertyRecord
*/
public DocumentTemplatePropertyRecord(Integer id, String key, String value, String defaultValue, String type, LocalDateTime createAt) {
super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY);
setId(id);
setKey(key);
setValue(value);
setDefaultValue(defaultValue);
setType(type);
setCreateAt(createAt);
}
/**
* Create a detached, initialised DocumentTemplatePropertyRecord
*/
public DocumentTemplatePropertyRecord(DocumentTemplatePropertyPojo value) {
super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY);
if (value != null) {
setId(value.getId());
setKey(value.getKey());
setValue(value.getValue());
setDefaultValue(value.getDefaultValue());
setType(value.getType());
setCreateAt(value.getCreateAt());
}
}
}

View File

@ -330,4 +330,16 @@ CREATE TABLE IF NOT EXISTS document_description
create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT UNIQUE uk_project_id_table_name_column_name (project_id, table_name, column_name)
) CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci COMMENT 'custom document description';
COLLATE utf8mb4_unicode_ci COMMENT 'custom document description';
CREATE TABLE IF NOT EXISTS document_template_property
(
`id` INT PRIMARY KEY AUTO_INCREMENT,
`key` VARCHAR(255) NOT NULL,
`value` VARCHAR(255) DEFAULT NULL,
`default_value` VARCHAR(255) NOT NULL,
`type` VARCHAR(64) NOT NULL,
`create_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT UNIQUE uk_type_key (`type`, `key`)
) CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci COMMENT 'template property';