Skip to content

Commit

Permalink
0003595: DBFill improvements for JSONB in Postgres and not filling sym
Browse files Browse the repository at this point in the history
tables
  • Loading branch information
jumpmind-josh committed Jun 7, 2018
1 parent a894239 commit ddf2be6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
Expand Up @@ -232,10 +232,23 @@ public void fillTables(String[] tableNames, Map<String,int[]> tableProperties) {
}
log.info("ORDER (" + tables.size() + " tables): " + tableOrder.toString());
buildForeignKeyReferences(tables);
buildDependentColumnValues(tables);
buildDependentColumnValues(tables);

tables = removeSymTables(tables);

fillTables(tables, tableProperties);
}

protected List<Table> removeSymTables(List<Table> tables) {
List<Table> filteredTables = new ArrayList<Table>();
for (Table table : tables) {
if (!table.getNameLowerCase().startsWith("sym_")) {
filteredTables.add(table);
}
}
return filteredTables;
}

protected void buildForeignTables(List<Table> tables) {
for (Table table : tables) {
ArrayList<Table> tableList = new ArrayList<Table>();
Expand Down Expand Up @@ -784,7 +797,7 @@ private Object generateRandomValueForColumn(Column column) {
} else if (type == Types.ARRAY) {
objectValue = null;
} else if (type == Types.VARCHAR || type == Types.LONGVARCHAR || type == Types.CHAR || type == Types.CLOB) {
if (column.getJdbcTypeName() != null && column.getJdbcTypeName().equals("JSON")) {
if (column.getJdbcTypeName() != null && (column.getJdbcTypeName().equals("JSON") || column.getJdbcTypeName().equals("jsonb"))) {
objectValue = "{\"jumpmind\":\"symmetricds\"}";
}
else {
Expand Down
Expand Up @@ -33,25 +33,26 @@
import org.jumpmind.vaadin.ui.common.CommonUiUtils;
import org.jumpmind.vaadin.ui.common.UiConstants;

import com.vaadin.server.FontAwesome;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;
import com.vaadin.v7.data.Item;
import com.vaadin.v7.data.Property;
import com.vaadin.v7.data.Property.ValueChangeEvent;
import com.vaadin.v7.event.FieldEvents.TextChangeEvent;
import com.vaadin.v7.event.FieldEvents.TextChangeListener;
import com.vaadin.v7.event.ItemClickEvent;
import com.vaadin.v7.event.ItemClickEvent.ItemClickListener;
import com.vaadin.server.FontAwesome;
import com.vaadin.v7.ui.AbstractSelect;
import com.vaadin.v7.ui.AbstractTextField.TextChangeEventMode;
import com.vaadin.ui.Alignment;
import com.vaadin.v7.ui.CheckBox;
import com.vaadin.v7.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.v7.ui.Table;
import com.vaadin.v7.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;

public class TableSelectionLayout extends VerticalLayout {

Expand Down Expand Up @@ -185,6 +186,25 @@ public void valueChange(ValueChangeEvent event) {
}
});

Button selectAllLink = new Button("Select All");
selectAllLink.addStyleName(ValoTheme.BUTTON_LINK);
selectAllLink.addClickListener((event) -> selectAll());

Button selectNoneLink = new Button("Select None");
selectNoneLink.addStyleName(ValoTheme.BUTTON_LINK);
selectNoneLink.addClickListener((event) -> selectNone());

HorizontalLayout selectAllFooter = new HorizontalLayout();

selectAllFooter.setWidth("100%");
selectAllFooter.setSpacing(true);
selectAllFooter.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);

selectAllFooter.addComponent(selectAllLink);
selectAllFooter.addComponent(selectNoneLink);

this.addComponent(selectAllFooter);

refreshTableOfTables();

}
Expand Down

0 comments on commit ddf2be6

Please sign in to comment.