1 56 package org.objectstyle.cayenne.query; 57 58 import java.util.Map ; 59 60 import org.objectstyle.cayenne.ObjectId; 61 import org.objectstyle.cayenne.map.ObjEntity; 62 63 71 public class InsertQuery extends AbstractQuery { 72 73 protected ObjectId objectId; 74 protected Map objectSnapshot; 75 76 77 public InsertQuery() { 78 } 79 80 81 public InsertQuery(ObjEntity rootEntity) { 82 this.setRoot(rootEntity); 83 } 84 85 86 public InsertQuery(Class rootClass) { 87 this.setRoot(rootClass); 88 } 89 90 91 public InsertQuery(Class rootClass, Map dataRow) { 92 this.setRoot(rootClass); 93 this.setObjectSnapshot(dataRow); 94 } 95 96 97 public InsertQuery(String objEntityName) { 98 this.setRoot(objEntityName); 99 } 100 101 106 public SQLAction createSQLAction(SQLActionVisitor visitor) { 107 return visitor.updateAction(this); 108 } 109 110 public Map getObjectSnapshot() { 111 return objectSnapshot; 112 } 113 114 public void setObjectSnapshot(Map objectSnapshot) { 115 this.objectSnapshot = objectSnapshot; 116 } 117 118 public ObjectId getObjectId() { 119 return objectId; 120 } 121 122 public void setObjectId(ObjectId objectId) { 123 this.objectId = objectId; 124 } 125 } | Popular Tags |