-
Notifications
You must be signed in to change notification settings - Fork 2
/
DropPropertyChange.java
59 lines (42 loc) · 1.53 KB
/
DropPropertyChange.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package liquibase.change.ext;
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import org.unbrokendome.liquibase.orientdb.statement.DropPropertyStatement;
import org.unbrokendome.liquibase.serialization.Serializable;
import org.unbrokendome.liquibase.serialization.SerializedField;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@Serializable(name = "dropProperty", description = "Drops an existing property",
namespace = OrientSerializationConstants.ORIENT_CHANGELOG_NAMESPACE)
public class DropPropertyChange extends AbstractSingleStatementOrientChange {
private String className;
private String propertyName;
@SerializedField(description = "The name of the class that contains the property")
@NotNull
@Size(min = 1)
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
@SerializedField(description = "The name of the property")
@NotNull
@Size(min = 1)
public String getPropertyName() {
return propertyName;
}
public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}
@Override
public String getConfirmationMessage() {
return "Property " + className + "." + propertyName + " dropped";
}
@Override
protected SqlStatement doGenerateStatement(Database database) {
return new DropPropertyStatement()
.setClassName(className)
.setPropertyName(propertyName);
}
}