Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 24 package org.riotfamily.revolt; 25 26 import java.util.Iterator ; 27 import java.util.List ; 28 29 import org.riotfamily.revolt.definition.Database; 30 import org.riotfamily.revolt.refactor.UpdateData; 31 32 36 public class ChangeSet implements Refactoring { 37 38 private EvolutionHistory history; 39 40 private String id; 41 42 private int sequenceNumber; 43 44 private List refactorings; 45 46 47 public ChangeSet(String id, List refactorings) { 48 this.id = id; 49 this.refactorings = refactorings; 50 } 51 52 public String getId() { 53 return this.id; 54 } 55 56 public int getSequenceNumber() { 57 return this.sequenceNumber; 58 } 59 60 public void setHistory(EvolutionHistory history) { 61 this.history = history; 62 } 63 64 public String getModuleName() { 65 return history.getModuleName(); 66 } 67 68 public void setSequenceNumber(int sequenceNumber) { 69 this.sequenceNumber = sequenceNumber; 70 } 71 72 public Script getScript(Dialect dialect) { 73 Script script = new Script(); 74 Iterator it = refactorings.iterator(); 75 while (it.hasNext()) { 76 Refactoring refactoring = (Refactoring) it.next(); 77 if (!(history.isNewModule() && refactoring instanceof UpdateData)) { 80 Script s = refactoring.getScript(dialect); 81 if (s != null) { 82 script.append(s); 83 } 84 } 85 } 86 return script; 87 } 88 89 public void alterModel(Database model) { 90 Iterator it = refactorings.iterator(); 91 while (it.hasNext()) { 92 Refactoring refactoring = (Refactoring) it.next(); 93 refactoring.alterModel(model); 94 } 95 } 96 97 } 98
| Popular Tags
|