1 package org.apache.ojb.broker.util; 2 3 17 18 19 26 public class ObjectModificationDefaultImpl implements ObjectModification 27 { 28 private boolean needsInsert = false; 29 private boolean needsUpdate = false; 30 31 34 public ObjectModificationDefaultImpl() 35 { 36 super(); 37 } 38 39 42 public ObjectModificationDefaultImpl(boolean pNeedsInsert, boolean pNeedsUpdate) 43 { 44 needsInsert = pNeedsInsert; 45 needsUpdate = pNeedsUpdate; 46 } 47 48 49 public static final ObjectModificationDefaultImpl INSERT = new ObjectModificationDefaultImpl(true, false); 50 public static final ObjectModificationDefaultImpl UPDATE = new ObjectModificationDefaultImpl(false, true); 51 52 53 56 public boolean needsInsert() 57 { 58 return needsInsert; 59 } 60 61 66 public boolean needsUpdate() 67 { 68 return needsUpdate; 69 } 70 71 76 public void setNeedsInsert(boolean newValue) 77 { 78 needsInsert = newValue; 79 } 80 81 86 public void setNeedsUpdate(boolean newValue) 87 { 88 needsUpdate = newValue; 89 } 90 91 94 public void markModified() 95 { 96 needsUpdate = true; 97 } 98 } 99 | Popular Tags |