tbrugz.sqldiff.model.GrantDiffAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqldump Show documentation
Show all versions of sqldump Show documentation
Utility to dump schema and data from a RDBMS
package tbrugz.sqldiff.model;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import tbrugz.sqldiff.model.adapted.GrntDiff;
public class GrantDiffAdapter extends XmlAdapter {
@Override
public GrantDiff unmarshal(GrntDiff v) throws Exception {
return new GrantDiff(v.schemaName, v.tableName, v.privilege, v.grantee, v.withGrantOption, v.changeType.equals(ChangeType.DROP));
}
@Override
public GrntDiff marshal(GrantDiff v) throws Exception {
GrntDiff adapted = new GrntDiff();
adapted.changeType = v.getChangeType();
adapted.schemaName = v.schemaName;
adapted.tableName = v.tableName;
adapted.privilege = v.privilege;
adapted.grantee = v.grantee;
adapted.withGrantOption = v.withGrantOption;
return adapted;
}
}