/** * Returns the table name used when calling the * {@code SHOW COLUMNS FROM} statement. * * @param table to use * @return the table name to use */ protected String metaDataTableNameForShowColumns(Table table) { return table.getId(); }
@Override public String getDescription() { return "The referenced element " + col.getId() + ", is not enabled. Disabled elements will " + "not be generated. Thus, referencing a disabled element " + "will result in broken code.\n" + "This might be a result of the element in question not being enabled, " + "or that an ancestor of the element is not enabled. \n" + "To fix this issue, make sure the element " + targetName + " is enabled."; }
/** * Returns the catalog lookup name used when calling * connection.getMetaData().getXxxx(catalogLookupName, ...) methods. * * @param schema to use * @return the catalog lookup name used when calling * connection.getMetaData().getXxxx(catalogLookupName, ...) methods */ protected String jdbcCatalogLookupName(Schema schema) { return schema.getId(); }
/** * Returns the full name used in the database for the specified * {@link Column}. This is typically constructed by combining the table and * the column name with a separator, but that might be different in * different implementations. * * @param column the column to retrieve the name of * @return the full name */ default String fullNameOf(Column column) { final Table table = column.getParentOrThrow(); final Schema schema = table.getParentOrThrow(); return fullNameOf(schema.getName(), table.getName(), column.getName()); }
@Override public Type getJavaType(Column column) { if (column.isNullable()) { return Boolean.class; } else { return boolean.class; } }
public static boolean usesOptional(Column col) { return col.isNullable() && HasNullable.ImplementAs.OPTIONAL == col.getNullableImplementation(); }
/** * Returns the database username to use when connecting to the dbms. If no * username is specified, {@code empty} is returned. * * @return the database username or {@code empty} */ default Optional<String> getUsername() { return getAsString(USERNAME); }
/** * Returns the port number of the database on the database host. If no port * is specified, {@code empty} is returned. * * @return the port of the database or {@code empty} */ default OptionalInt getPort() { return getAsInt(PORT); }
@Override public final void put(String key, Object value) { document.put(key, value); } }
/** * Returns the table name used when calling the * connection.getMetaData().getColumns() method. * * @param table to use * @return the table name used when calling * connection.getMetaData().getColumns() method */ protected String metaDataTableNameForColumns(Table table) { return table.getId(); }
@Override public Type getJavaType(Column column) { if (column.isNullable()) { return Boolean.class; } else { return boolean.class; } }
/** * Returns the address of the database host if it is specified. The address * could be an ip-address or a hostname. If no address is specified, * {@code empty} will be returned. * * @return the address of the host or {@code empty} */ default Optional<String> getIpAddress() { return getAsString(IP_ADDRESS); }
/** * Returns the table name used when calling the * connection.getMetaData().getIndexes() method. * * @param table to use * @return the table name used when calling * connection.getMetaData().getIndexes() method */ protected String metaDataTableNameForIndexes(Table table) { return table.getId(); }
@Override public Type getJavaType(Column column) { if (column.isNullable()) { return Boolean.class; } else { return boolean.class; } }
/** * Returns the local path to the file where the data of this Dbms is stored. * The file name should be parsable using {@link Paths#get}. This property * is optional and not even supported in most database systems. * * @return the local path to the data file */ default Optional<String> getLocalPath() { return getAsString(LOCAL_PATH); }
/** * Returns the table name used when calling the * connection.getMetaData().getImportedKeys() method. * * @param table to use * @return the table name used when calling the * connection.getMetaData().getImportedKeys() method */ protected String metaDataTableNameForForeignKeys(Table table) { return table.getId(); }
@Override public Type getJavaType(Column column) { if (column.isNullable()) { return Boolean.class; } else { return boolean.class; } }
/** * Returns the explicit connection URL to use for this {@code Dbms} if the * user has specified one, or an empty {@code Optional} if one should be * generated automatically by the {@code DbmsType}. * * @return the explicit connection URL to use for this {@code Dbms} */ default Optional<String> getConnectionUrl() { return getAsString(CONNECTION_URL); }
/** * Returns the table name used when calling the * connection.getMetaData().getPrimaryKeys() method. * * @param table to use * @return the table name used when calling the * connection.getMetaData().getPrimaryKeys() method */ protected String metaDataTableNameForPrimaryKeys(Table table) { return table.getId(); }
@Override public Type getJavaType(Column column) { if (column.isNullable()) { return Boolean.class; } else { return boolean.class; } }