diff --git a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java index ed046a8..dba1d94 100644 --- a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java +++ b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java @@ -16,26 +16,33 @@ public class TRId implements Serializable { /** * Tabular resource id */ - String id; + private String id; /** - * Tabular resource type + * Tabular resource type */ - String tabularResourceType; - - - /** - * Last view or table id of tabular resource - */ - String tableId; + private String tabularResourceType; + + /** + * Last view id or table id of tabular resource + */ + private String tableId; - /** * Type of last table or view */ - String tableType; - + private String tableType; + + /** + * If tableId identifies a View then referenceTargertTableId is the + * reference to associated table + */ + private String referenceTargetTableId; + /** + * True if tableId identifies a View + */ + private boolean viewTable; public TRId() { @@ -43,26 +50,43 @@ public class TRId implements Serializable { public TRId(String id) { this.id = id; - this.tabularResourceType=null; - this.tableId = null; - this.tableType = null; + tabularResourceType = null; + tableId = null; + tableType = null; + referenceTargetTableId = null; + viewTable = false; + } public TRId(String id, String tableId) { this.id = id; - this.tabularResourceType=null; + tabularResourceType = null; this.tableId = tableId; - this.tableType = null; + tableType = null; + referenceTargetTableId = null; + viewTable = false; + } - - public TRId(String id, String tabularResourceType, String tableId, String tableType) { + public TRId(String id, String tabularResourceType, String tableId, + String tableType) { this.id = id; - this.tabularResourceType=tabularResourceType; + this.tabularResourceType = tabularResourceType; this.tableId = tableId; this.tableType = tableType; + referenceTargetTableId = null; + viewTable = false; } + public TRId(String id, String tabularResourceType, String tableId, + String tableType, String referenceTargetTableId, boolean viewTable) { + this.id = id; + this.tabularResourceType = tabularResourceType; + this.tableId = tableId; + this.tableType = tableType; + this.referenceTargetTableId = referenceTargetTableId; + this.viewTable = viewTable; + } public String getId() { return id; @@ -96,6 +120,22 @@ public class TRId implements Serializable { this.tableType = tableType; } + public String getReferenceTargetTableId() { + return referenceTargetTableId; + } + + public void setReferenceTargetTableId(String referenceTargetTableId) { + this.referenceTargetTableId = referenceTargetTableId; + } + + public boolean isViewTable() { + return viewTable; + } + + public void setViewTable(boolean viewTable) { + this.viewTable = viewTable; + } + public boolean equals(TRId equals) { boolean eq = false; if (id != null && tableId != null && equals != null @@ -112,10 +152,8 @@ public class TRId implements Serializable { public String toString() { return "TRId [id=" + id + ", tabularResourceType=" + tabularResourceType + ", tableId=" + tableId + ", tableType=" - + tableType + "]"; + + tableType + ", referenceTargetTableId=" + + referenceTargetTableId + ", viewTable=" + viewTable + "]"; } - - - }