Browse Source

feat:add url_pattern to database type

master
vran 3 years ago
parent
commit
7a2ebcd663
  1. 13
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/DatabaseType.java
  2. 19
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DatabaseTypePojo.java
  3. 106
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DatabaseTypeRecord.java
  4. 7
      dao/src/main/resources/db/migration/V1.1__database_type.sql

13
dao/generated-src/jooq/main/java/com/databasir/dao/tables/DatabaseType.java

@ -17,7 +17,7 @@ import org.jooq.ForeignKey;
import org.jooq.Identity; import org.jooq.Identity;
import org.jooq.Name; import org.jooq.Name;
import org.jooq.Record; import org.jooq.Record;
import org.jooq.Row11; import org.jooq.Row12;
import org.jooq.Schema; import org.jooq.Schema;
import org.jooq.Table; import org.jooq.Table;
import org.jooq.TableField; import org.jooq.TableField;
@ -85,6 +85,11 @@ public class DatabaseType extends TableImpl<DatabaseTypeRecord> {
*/ */
public final TableField<DatabaseTypeRecord, String> JDBC_PROTOCOL = createField(DSL.name("jdbc_protocol"), SQLDataType.VARCHAR(128).nullable(false), this, ""); public final TableField<DatabaseTypeRecord, String> JDBC_PROTOCOL = createField(DSL.name("jdbc_protocol"), SQLDataType.VARCHAR(128).nullable(false), this, "");
/**
* The column <code>databasir.database_type.url_pattern</code>.
*/
public final TableField<DatabaseTypeRecord, String> URL_PATTERN = createField(DSL.name("url_pattern"), SQLDataType.VARCHAR(255).nullable(false), this, "");
/** /**
* The column <code>databasir.database_type.deleted</code>. * The column <code>databasir.database_type.deleted</code>.
*/ */
@ -185,11 +190,11 @@ public class DatabaseType extends TableImpl<DatabaseTypeRecord> {
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Row11 type methods // Row12 type methods
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@Override @Override
public Row11<Integer, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() { public Row12<Integer, String, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row11) super.fieldsRow(); return (Row12) super.fieldsRow();
} }
} }

19
dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DatabaseTypePojo.java

@ -23,6 +23,7 @@ public class DatabaseTypePojo implements Serializable {
private String jdbcDriverFileUrl; private String jdbcDriverFileUrl;
private String jdbcDriverClassName; private String jdbcDriverClassName;
private String jdbcProtocol; private String jdbcProtocol;
private String urlPattern;
private Boolean deleted; private Boolean deleted;
private Integer deletedToken; private Integer deletedToken;
private LocalDateTime updateAt; private LocalDateTime updateAt;
@ -38,6 +39,7 @@ public class DatabaseTypePojo implements Serializable {
this.jdbcDriverFileUrl = value.jdbcDriverFileUrl; this.jdbcDriverFileUrl = value.jdbcDriverFileUrl;
this.jdbcDriverClassName = value.jdbcDriverClassName; this.jdbcDriverClassName = value.jdbcDriverClassName;
this.jdbcProtocol = value.jdbcProtocol; this.jdbcProtocol = value.jdbcProtocol;
this.urlPattern = value.urlPattern;
this.deleted = value.deleted; this.deleted = value.deleted;
this.deletedToken = value.deletedToken; this.deletedToken = value.deletedToken;
this.updateAt = value.updateAt; this.updateAt = value.updateAt;
@ -52,6 +54,7 @@ public class DatabaseTypePojo implements Serializable {
String jdbcDriverFileUrl, String jdbcDriverFileUrl,
String jdbcDriverClassName, String jdbcDriverClassName,
String jdbcProtocol, String jdbcProtocol,
String urlPattern,
Boolean deleted, Boolean deleted,
Integer deletedToken, Integer deletedToken,
LocalDateTime updateAt, LocalDateTime updateAt,
@ -64,6 +67,7 @@ public class DatabaseTypePojo implements Serializable {
this.jdbcDriverFileUrl = jdbcDriverFileUrl; this.jdbcDriverFileUrl = jdbcDriverFileUrl;
this.jdbcDriverClassName = jdbcDriverClassName; this.jdbcDriverClassName = jdbcDriverClassName;
this.jdbcProtocol = jdbcProtocol; this.jdbcProtocol = jdbcProtocol;
this.urlPattern = urlPattern;
this.deleted = deleted; this.deleted = deleted;
this.deletedToken = deletedToken; this.deletedToken = deletedToken;
this.updateAt = updateAt; this.updateAt = updateAt;
@ -170,6 +174,20 @@ public class DatabaseTypePojo implements Serializable {
this.jdbcProtocol = jdbcProtocol; this.jdbcProtocol = jdbcProtocol;
} }
/**
* Getter for <code>databasir.database_type.url_pattern</code>.
*/
public String getUrlPattern() {
return this.urlPattern;
}
/**
* Setter for <code>databasir.database_type.url_pattern</code>.
*/
public void setUrlPattern(String urlPattern) {
this.urlPattern = urlPattern;
}
/** /**
* Getter for <code>databasir.database_type.deleted</code>. * Getter for <code>databasir.database_type.deleted</code>.
*/ */
@ -237,6 +255,7 @@ public class DatabaseTypePojo implements Serializable {
sb.append(", ").append(jdbcDriverFileUrl); sb.append(", ").append(jdbcDriverFileUrl);
sb.append(", ").append(jdbcDriverClassName); sb.append(", ").append(jdbcDriverClassName);
sb.append(", ").append(jdbcProtocol); sb.append(", ").append(jdbcProtocol);
sb.append(", ").append(urlPattern);
sb.append(", ").append(deleted); sb.append(", ").append(deleted);
sb.append(", ").append(deletedToken); sb.append(", ").append(deletedToken);
sb.append(", ").append(updateAt); sb.append(", ").append(updateAt);

106
dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DatabaseTypeRecord.java

@ -11,8 +11,8 @@ import java.time.LocalDateTime;
import org.jooq.Field; import org.jooq.Field;
import org.jooq.Record1; import org.jooq.Record1;
import org.jooq.Record11; import org.jooq.Record12;
import org.jooq.Row11; import org.jooq.Row12;
import org.jooq.impl.UpdatableRecordImpl; import org.jooq.impl.UpdatableRecordImpl;
@ -20,7 +20,7 @@ import org.jooq.impl.UpdatableRecordImpl;
* customer database types * customer database types
*/ */
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) @SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord> implements Record11<Integer, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> { public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord> implements Record12<Integer, String, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -124,60 +124,74 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
return (String) get(6); return (String) get(6);
} }
/**
* Setter for <code>databasir.database_type.url_pattern</code>.
*/
public void setUrlPattern(String value) {
set(7, value);
}
/**
* Getter for <code>databasir.database_type.url_pattern</code>.
*/
public String getUrlPattern() {
return (String) get(7);
}
/** /**
* Setter for <code>databasir.database_type.deleted</code>. * Setter for <code>databasir.database_type.deleted</code>.
*/ */
public void setDeleted(Boolean value) { public void setDeleted(Boolean value) {
set(7, value); set(8, value);
} }
/** /**
* Getter for <code>databasir.database_type.deleted</code>. * Getter for <code>databasir.database_type.deleted</code>.
*/ */
public Boolean getDeleted() { public Boolean getDeleted() {
return (Boolean) get(7); return (Boolean) get(8);
} }
/** /**
* Setter for <code>databasir.database_type.deleted_token</code>. * Setter for <code>databasir.database_type.deleted_token</code>.
*/ */
public void setDeletedToken(Integer value) { public void setDeletedToken(Integer value) {
set(8, value); set(9, value);
} }
/** /**
* Getter for <code>databasir.database_type.deleted_token</code>. * Getter for <code>databasir.database_type.deleted_token</code>.
*/ */
public Integer getDeletedToken() { public Integer getDeletedToken() {
return (Integer) get(8); return (Integer) get(9);
} }
/** /**
* Setter for <code>databasir.database_type.update_at</code>. * Setter for <code>databasir.database_type.update_at</code>.
*/ */
public void setUpdateAt(LocalDateTime value) { public void setUpdateAt(LocalDateTime value) {
set(9, value); set(10, value);
} }
/** /**
* Getter for <code>databasir.database_type.update_at</code>. * Getter for <code>databasir.database_type.update_at</code>.
*/ */
public LocalDateTime getUpdateAt() { public LocalDateTime getUpdateAt() {
return (LocalDateTime) get(9); return (LocalDateTime) get(10);
} }
/** /**
* Setter for <code>databasir.database_type.create_at</code>. * Setter for <code>databasir.database_type.create_at</code>.
*/ */
public void setCreateAt(LocalDateTime value) { public void setCreateAt(LocalDateTime value) {
set(10, value); set(11, value);
} }
/** /**
* Getter for <code>databasir.database_type.create_at</code>. * Getter for <code>databasir.database_type.create_at</code>.
*/ */
public LocalDateTime getCreateAt() { public LocalDateTime getCreateAt() {
return (LocalDateTime) get(10); return (LocalDateTime) get(11);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -190,17 +204,17 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Record11 type implementation // Record12 type implementation
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@Override @Override
public Row11<Integer, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() { public Row12<Integer, String, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row11) super.fieldsRow(); return (Row12) super.fieldsRow();
} }
@Override @Override
public Row11<Integer, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> valuesRow() { public Row12<Integer, String, String, String, String, String, String, String, Boolean, Integer, LocalDateTime, LocalDateTime> valuesRow() {
return (Row11) super.valuesRow(); return (Row12) super.valuesRow();
} }
@Override @Override
@ -239,22 +253,27 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
} }
@Override @Override
public Field<Boolean> field8() { public Field<String> field8() {
return DatabaseType.DATABASE_TYPE.URL_PATTERN;
}
@Override
public Field<Boolean> field9() {
return DatabaseType.DATABASE_TYPE.DELETED; return DatabaseType.DATABASE_TYPE.DELETED;
} }
@Override @Override
public Field<Integer> field9() { public Field<Integer> field10() {
return DatabaseType.DATABASE_TYPE.DELETED_TOKEN; return DatabaseType.DATABASE_TYPE.DELETED_TOKEN;
} }
@Override @Override
public Field<LocalDateTime> field10() { public Field<LocalDateTime> field11() {
return DatabaseType.DATABASE_TYPE.UPDATE_AT; return DatabaseType.DATABASE_TYPE.UPDATE_AT;
} }
@Override @Override
public Field<LocalDateTime> field11() { public Field<LocalDateTime> field12() {
return DatabaseType.DATABASE_TYPE.CREATE_AT; return DatabaseType.DATABASE_TYPE.CREATE_AT;
} }
@ -294,22 +313,27 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
} }
@Override @Override
public Boolean component8() { public String component8() {
return getUrlPattern();
}
@Override
public Boolean component9() {
return getDeleted(); return getDeleted();
} }
@Override @Override
public Integer component9() { public Integer component10() {
return getDeletedToken(); return getDeletedToken();
} }
@Override @Override
public LocalDateTime component10() { public LocalDateTime component11() {
return getUpdateAt(); return getUpdateAt();
} }
@Override @Override
public LocalDateTime component11() { public LocalDateTime component12() {
return getCreateAt(); return getCreateAt();
} }
@ -349,22 +373,27 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
} }
@Override @Override
public Boolean value8() { public String value8() {
return getUrlPattern();
}
@Override
public Boolean value9() {
return getDeleted(); return getDeleted();
} }
@Override @Override
public Integer value9() { public Integer value10() {
return getDeletedToken(); return getDeletedToken();
} }
@Override @Override
public LocalDateTime value10() { public LocalDateTime value11() {
return getUpdateAt(); return getUpdateAt();
} }
@Override @Override
public LocalDateTime value11() { public LocalDateTime value12() {
return getCreateAt(); return getCreateAt();
} }
@ -411,31 +440,37 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
} }
@Override @Override
public DatabaseTypeRecord value8(Boolean value) { public DatabaseTypeRecord value8(String value) {
setUrlPattern(value);
return this;
}
@Override
public DatabaseTypeRecord value9(Boolean value) {
setDeleted(value); setDeleted(value);
return this; return this;
} }
@Override @Override
public DatabaseTypeRecord value9(Integer value) { public DatabaseTypeRecord value10(Integer value) {
setDeletedToken(value); setDeletedToken(value);
return this; return this;
} }
@Override @Override
public DatabaseTypeRecord value10(LocalDateTime value) { public DatabaseTypeRecord value11(LocalDateTime value) {
setUpdateAt(value); setUpdateAt(value);
return this; return this;
} }
@Override @Override
public DatabaseTypeRecord value11(LocalDateTime value) { public DatabaseTypeRecord value12(LocalDateTime value) {
setCreateAt(value); setCreateAt(value);
return this; return this;
} }
@Override @Override
public DatabaseTypeRecord values(Integer value1, String value2, String value3, String value4, String value5, String value6, String value7, Boolean value8, Integer value9, LocalDateTime value10, LocalDateTime value11) { public DatabaseTypeRecord values(Integer value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, Boolean value9, Integer value10, LocalDateTime value11, LocalDateTime value12) {
value1(value1); value1(value1);
value2(value2); value2(value2);
value3(value3); value3(value3);
@ -447,6 +482,7 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
value9(value9); value9(value9);
value10(value10); value10(value10);
value11(value11); value11(value11);
value12(value12);
return this; return this;
} }
@ -464,7 +500,7 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
/** /**
* Create a detached, initialised DatabaseTypeRecord * Create a detached, initialised DatabaseTypeRecord
*/ */
public DatabaseTypeRecord(Integer id, String databaseType, String icon, String description, String jdbcDriverFileUrl, String jdbcDriverClassName, String jdbcProtocol, Boolean deleted, Integer deletedToken, LocalDateTime updateAt, LocalDateTime createAt) { public DatabaseTypeRecord(Integer id, String databaseType, String icon, String description, String jdbcDriverFileUrl, String jdbcDriverClassName, String jdbcProtocol, String urlPattern, Boolean deleted, Integer deletedToken, LocalDateTime updateAt, LocalDateTime createAt) {
super(DatabaseType.DATABASE_TYPE); super(DatabaseType.DATABASE_TYPE);
setId(id); setId(id);
@ -474,6 +510,7 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
setJdbcDriverFileUrl(jdbcDriverFileUrl); setJdbcDriverFileUrl(jdbcDriverFileUrl);
setJdbcDriverClassName(jdbcDriverClassName); setJdbcDriverClassName(jdbcDriverClassName);
setJdbcProtocol(jdbcProtocol); setJdbcProtocol(jdbcProtocol);
setUrlPattern(urlPattern);
setDeleted(deleted); setDeleted(deleted);
setDeletedToken(deletedToken); setDeletedToken(deletedToken);
setUpdateAt(updateAt); setUpdateAt(updateAt);
@ -494,6 +531,7 @@ public class DatabaseTypeRecord extends UpdatableRecordImpl<DatabaseTypeRecord>
setJdbcDriverFileUrl(value.getJdbcDriverFileUrl()); setJdbcDriverFileUrl(value.getJdbcDriverFileUrl());
setJdbcDriverClassName(value.getJdbcDriverClassName()); setJdbcDriverClassName(value.getJdbcDriverClassName());
setJdbcProtocol(value.getJdbcProtocol()); setJdbcProtocol(value.getJdbcProtocol());
setUrlPattern(value.getUrlPattern());
setDeleted(value.getDeleted()); setDeleted(value.getDeleted());
setDeletedToken(value.getDeletedToken()); setDeletedToken(value.getDeletedToken());
setUpdateAt(value.getUpdateAt()); setUpdateAt(value.getUpdateAt());

7
dao/src/main/resources/db/migration/V1.1__database_type.sql

@ -7,6 +7,7 @@ CREATE TABLE IF NOT EXISTS database_type
jdbc_driver_file_url VARCHAR(1024) NOT NULL, jdbc_driver_file_url VARCHAR(1024) NOT NULL,
jdbc_driver_class_name VARCHAR(255) NOT NULL, jdbc_driver_class_name VARCHAR(255) NOT NULL,
jdbc_protocol VARCHAR(128) NOT NULL, jdbc_protocol VARCHAR(128) NOT NULL,
url_pattern VARCHAR(255) NOT NULL,
deleted BOOLEAN NOT NULL DEFAULT FALSE, deleted BOOLEAN NOT NULL DEFAULT FALSE,
deleted_token INT NOT NULL DEFAULT 0, deleted_token INT NOT NULL DEFAULT 0,
update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
@ -17,6 +18,6 @@ CREATE TABLE IF NOT EXISTS database_type
REPLACE INTO databasir.database_type (id, database_type, icon, DESCRIPTION, jdbc_driver_file_url, REPLACE INTO databasir.database_type (id, database_type, icon, DESCRIPTION, jdbc_driver_file_url,
jdbc_driver_class_name, jdbc_driver_class_name,
jdbc_protocol) jdbc_protocol, url_pattern)
VALUES (1, 'mysql', '', 'system default mysql', 'N/A', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql'), VALUES (1, 'mysql', '', 'system default mysql', 'N/A', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql', '{{jdbc.protocol}}://{{db.url}}/{{db.name}}'),
(2, 'postgresql', '', 'system default postgresql', 'N/A', 'org.postgresql.Driver', 'jdbc:postgresql'); (2, 'postgresql', '', 'system default postgresql', 'N/A', 'org.postgresql.Driver', 'jdbc:postgresql', '{{jdbc.protocol}}://{{db.url}}/{{db.name}}');

Loading…
Cancel
Save