Skip to content
Snippets Groups Projects
Commit 060a2d48 authored by npedot's avatar npedot
Browse files

adds changeset is empty method

parent e94bc69d
No related branches found
No related tags found
No related merge requests found
...@@ -48,33 +48,45 @@ class ChangeSet() { ...@@ -48,33 +48,45 @@ class ChangeSet() {
infix fun plus(createView: CreateView)= apply{ infix fun plus(createView: CreateView)= apply{
this.createView.add(createView) this.createView.add(createView)
} }
infix fun plus(createTable: CreateTable)= apply{ infix fun plus(createTable: CreateTable)= apply{
this.createTable.add(createTable) this.createTable.add(createTable)
} }
infix fun plus(createConstraint: CreateConstraint)= apply{ infix fun plus(createConstraint: CreateConstraint)= apply{
this.createConstraint.add(createConstraint) this.createConstraint.add(createConstraint)
} }
infix fun plus(createMapping: CreateMapping)= apply{ infix fun plus(createMapping: CreateMapping)= apply{
this.createMapping.add(createMapping) this.createMapping.add(createMapping)
} }
infix fun minus(view: DropView)= apply{ infix fun minus(view: DropView)= apply{
this.dropView.add(view) this.dropView.add(view)
} }
infix fun minus(droptable:DropTable) = apply { infix fun minus(droptable:DropTable) = apply {
this.dropTable.add(droptable) this.dropTable.add(droptable)
} }
infix fun minus(dropconstraint:DropConstraint) = apply { infix fun minus(dropconstraint:DropConstraint) = apply {
this.dropConstraint.add(dropconstraint) this.dropConstraint.add(dropconstraint)
} }
infix fun minus(dropMapping: DropMapping) = apply { infix fun minus(dropMapping: DropMapping) = apply {
this.dropMapping.add(dropMapping) this.dropMapping.add(dropMapping)
} }
fun size(): Int { fun size(): Int {
return createView.size +createTable.size + createConstraint.size return createView.size +createTable.size + createConstraint.size
+ dropView.size + dropTable.size + dropConstraint.size + dropView.size + dropTable.size + dropConstraint.size
+ dropMapping.size + dropMapping.size
} }
fun isEmpty() : Boolean {
return this.size()==0
}
companion object { companion object {
fun fromDatabase(db:Database):ChangeSet { fun fromDatabase(db:Database):ChangeSet {
var cs = ChangeSet() var cs = ChangeSet()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment