1 56 package org.objectstyle.cayenne.query; 57 58 import java.util.HashMap ; 59 import java.util.Map ; 60 61 import org.objectstyle.cayenne.exp.Expression; 62 import org.objectstyle.cayenne.map.ObjEntity; 63 64 68 public class UpdateQuery extends QualifiedQuery { 69 70 protected Map updAttributes = new HashMap (); 71 72 73 public UpdateQuery() { 74 } 75 76 private void init(Object root, Expression qualifier) { 77 setRoot(root); 78 setQualifier(qualifier); 79 } 80 81 86 public UpdateQuery(ObjEntity root) { 87 this(root, null); 88 } 89 90 96 public UpdateQuery(ObjEntity root, Expression qualifier) { 97 init(root, qualifier); 98 } 99 100 106 public UpdateQuery(Class rootClass) { 107 this(rootClass, null); 108 } 109 110 117 public UpdateQuery(Class rootClass, Expression qualifier) { 118 init(rootClass, qualifier); 119 } 120 121 122 public UpdateQuery(String objEntityName) { 123 this(objEntityName, null); 124 } 125 126 130 public UpdateQuery(String objEntityName, Expression qualifier) { 131 init(objEntityName, qualifier); 132 } 133 134 139 public SQLAction createSQLAction(SQLActionVisitor visitor) { 140 return visitor.updateAction(this); 141 } 142 143 public void addUpdAttribute(String attrName, Object updatedValue) { 144 updAttributes.put(attrName, updatedValue); 145 } 146 147 148 public Map getUpdAttributes() { 149 return updAttributes; 150 } 151 } 152 | Popular Tags |