1 21 package oracle.toplink.essentials.queryframework; 23 24 import oracle.toplink.essentials.exceptions.*; 25 26 37 public class InsertObjectQuery extends WriteObjectQuery { 38 39 43 public InsertObjectQuery() { 44 super(); 45 } 46 47 51 public InsertObjectQuery(Object objectToInsert) { 52 this(); 53 setObject(objectToInsert); 54 } 55 56 60 public InsertObjectQuery(Call call) { 61 this(); 62 setCall(call); 63 } 64 65 69 public void executeCommit() throws DatabaseException { 70 if (getObject() != null) { 72 getQueryMechanism().insertObjectForWrite(); 75 } else { 76 getQueryMechanism().insertObjectForWriteWithChangeSet(); 78 } 79 } 80 81 85 protected void prepare() { 86 super.prepare(); 87 88 getQueryMechanism().prepareInsertObject(); 89 } 90 91 95 public boolean isInsertObjectQuery() { 96 return true; 97 } 98 } 99 | Popular Tags |