Skip to content

Commit

Permalink
BZ-996942 & BZ-996932: Fixing audit log for GDT widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
romartin committed Dec 13, 2013
1 parent ef88f7e commit 7c62843
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,16 @@ public void setInsertedLogically( boolean isInsertedLogically ) {
this.isInsertedLogically = isInsertedLogically;
}

@Override
public ActionInsertFactFieldsPattern clonePattern() {
ActionInsertFactFieldsPattern cloned = (ActionInsertFactFieldsPattern) super.clonePattern();
cloned.setInsertedLogically(isInsertedLogically);
return cloned;
}

@Override
public void update(Pattern52 other) {
super.update(other);
setInsertedLogically(((ActionInsertFactFieldsPattern)other).isInsertedLogically);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ public List<BaseColumnFieldDiff> diff(BaseColumn otherColumn) {
}

// Field: default value.
if ( !isEqualOrNull( this.getDefaultValue(),
other.getDefaultValue() ) ) {
// NOTE: Compare using getDefaultValueAsString because then if data types differs it will appear as changed field.
// And data type can be changed due to legacy implementations (see ConditionPopup#makeDefaultValueWidget)
if ( !isEqualOrNull( this.getDefaultValueAsString(),
other.getDefaultValueAsString() ) ) {
result.add(new BaseColumnFieldDiffImpl(FIELD_DEFAULT_VALUE, this.getDefaultValueAsString(), other.getDefaultValueAsString()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,36 @@ public List<BaseColumnFieldDiff> diff(BaseColumn otherColumn) {
return result;
}

/**
* Clones this pattern instance.
*
* @return The cloned instance.
*/
public Pattern52 clonePattern() {
Pattern52 cloned = new Pattern52();
cloned.setBoundName(getBoundName());
cloned.setChildColumns(new ArrayList<ConditionCol52>(getChildColumns()));
cloned.setEntryPointName(getEntryPointName());
cloned.setFactType(getFactType());
cloned.setNegated(isNegated());
cloned.setWindow(getWindow());
return cloned;
}

/**
* Update this pattern instance properties with the given ones from other pattern instance.
*
* @param other The pattern to obtain the properties to set.
*/
public void update(Pattern52 other) {
setBoundName(other.getBoundName());
setChildColumns(other.getChildColumns());
setEntryPointName(other.getEntryPointName());
setFactType(other.getFactType());
setNegated(other.isNegated());
setWindow(other.getWindow());
}

public String getFactType() {
return factType;
}
Expand Down

0 comments on commit 7c62843

Please sign in to comment.