Loading TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/EntityWrapper.java +9 −11 Original line number Diff line number Diff line package it.inaf.oats.ia2.tapschemamanager.businesslayer; import it.inaf.oats.ia2.tapschemamanager.datalayer.TapSchemaEntity; import java.io.Serializable; import java.util.Arrays; import java.util.HashMap; import java.util.List; Loading @@ -11,22 +12,19 @@ import java.util.Map; * @author Sonia Zorba <zorba at oats.inaf.it> * @param <T> */ public abstract class EntityWrapper<T extends TapSchemaEntity> { public abstract class EntityWrapper<T extends TapSchemaEntity> implements Serializable { private T entity; private static final long serialVersionUID = -8399058826120891216L; private final T entity; private final Map<String, String> originalValues; private final Map<String, String> editedValues; private List<String> supportedKeys; private final List<String> supportedKeys; private Status status; // Only for deserialization protected EntityWrapper() { public EntityWrapper(T entity, String... supportedKeys) { originalValues = new HashMap<String, String>(); editedValues = new HashMap<String, String>(); } public EntityWrapper(T entity, String... supportedKeys) { this(); this.entity = entity; this.supportedKeys = Arrays.asList(supportedKeys); } Loading TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/Schema.java +0 −5 Original line number Diff line number Diff line Loading @@ -27,11 +27,6 @@ public class Schema extends EntityWrapper<SchemaEntity> implements EntityWrapper private String selectedTable; private Map<String, Table> tables; // Only for deserialization protected Schema() { super(); } public Schema(TapSchemaHandler tapSchemaHandler, SchemaEntity schemaEntity) throws SQLException { super(schemaEntity, UTYPE, DESCRIPTION); Loading TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/Table.java +3 −9 Original line number Diff line number Diff line Loading @@ -26,15 +26,9 @@ public class Table extends EntityWrapper<TableEntity> implements EntityWrapperCo private String selectedColumn; private final Map<String, Column> columns; private TapSchemaHandler tapSchemaHandler; private String schemaName; private String tableName; // Only for deserialization protected Table() { super(); columns = new TreeMap<String, Column>(String.CASE_INSENSITIVE_ORDER); } private final TapSchemaHandler tapSchemaHandler; private final String schemaName; private final String tableName; public Table(TapSchemaHandler tapSchemaHandler, String schemaName, String tableName, TableEntity tableEntity) throws SQLException { super(tableEntity, UTYPE, DESCRIPTION); Loading TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/TapSchema.java +4 −0 Original line number Diff line number Diff line Loading @@ -164,4 +164,8 @@ public class TapSchema implements EntityWrapperContainer<Schema>, Serializable { public Schema getSelectedEntity() { return selectedSchema == null ? null : schemas.get(selectedSchema); } public TapSchemaHandler getTapSchemaHandler() { return tapSchemaHandler; } } TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/webapp/CredentialsBean.java +2 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class CredentialsBean implements Serializable { try { Connection connection = credentials.getConnection(); connection.close(); conversation.setTimeout(30 * 60000L); // 30 minutes conversation.begin(); schemaSelectionBean.setCredentials(credentials); return "schemaSelection.xhtml?faces-redirect=true"; Loading Loading
TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/EntityWrapper.java +9 −11 Original line number Diff line number Diff line package it.inaf.oats.ia2.tapschemamanager.businesslayer; import it.inaf.oats.ia2.tapschemamanager.datalayer.TapSchemaEntity; import java.io.Serializable; import java.util.Arrays; import java.util.HashMap; import java.util.List; Loading @@ -11,22 +12,19 @@ import java.util.Map; * @author Sonia Zorba <zorba at oats.inaf.it> * @param <T> */ public abstract class EntityWrapper<T extends TapSchemaEntity> { public abstract class EntityWrapper<T extends TapSchemaEntity> implements Serializable { private T entity; private static final long serialVersionUID = -8399058826120891216L; private final T entity; private final Map<String, String> originalValues; private final Map<String, String> editedValues; private List<String> supportedKeys; private final List<String> supportedKeys; private Status status; // Only for deserialization protected EntityWrapper() { public EntityWrapper(T entity, String... supportedKeys) { originalValues = new HashMap<String, String>(); editedValues = new HashMap<String, String>(); } public EntityWrapper(T entity, String... supportedKeys) { this(); this.entity = entity; this.supportedKeys = Arrays.asList(supportedKeys); } Loading
TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/Schema.java +0 −5 Original line number Diff line number Diff line Loading @@ -27,11 +27,6 @@ public class Schema extends EntityWrapper<SchemaEntity> implements EntityWrapper private String selectedTable; private Map<String, Table> tables; // Only for deserialization protected Schema() { super(); } public Schema(TapSchemaHandler tapSchemaHandler, SchemaEntity schemaEntity) throws SQLException { super(schemaEntity, UTYPE, DESCRIPTION); Loading
TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/Table.java +3 −9 Original line number Diff line number Diff line Loading @@ -26,15 +26,9 @@ public class Table extends EntityWrapper<TableEntity> implements EntityWrapperCo private String selectedColumn; private final Map<String, Column> columns; private TapSchemaHandler tapSchemaHandler; private String schemaName; private String tableName; // Only for deserialization protected Table() { super(); columns = new TreeMap<String, Column>(String.CASE_INSENSITIVE_ORDER); } private final TapSchemaHandler tapSchemaHandler; private final String schemaName; private final String tableName; public Table(TapSchemaHandler tapSchemaHandler, String schemaName, String tableName, TableEntity tableEntity) throws SQLException { super(tableEntity, UTYPE, DESCRIPTION); Loading
TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/businesslayer/TapSchema.java +4 −0 Original line number Diff line number Diff line Loading @@ -164,4 +164,8 @@ public class TapSchema implements EntityWrapperContainer<Schema>, Serializable { public Schema getSelectedEntity() { return selectedSchema == null ? null : schemas.get(selectedSchema); } public TapSchemaHandler getTapSchemaHandler() { return tapSchemaHandler; } }
TapSchemaManager/src/main/java/it/inaf/oats/ia2/tapschemamanager/webapp/CredentialsBean.java +2 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class CredentialsBean implements Serializable { try { Connection connection = credentials.getConnection(); connection.close(); conversation.setTimeout(30 * 60000L); // 30 minutes conversation.begin(); schemaSelectionBean.setCredentials(credentials); return "schemaSelection.xhtml?faces-redirect=true"; Loading