/** INTERNAL: Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { if (getObject() != null) { // Prepare can be called without the object set yet. checkDescriptor(getObject(), getSession()); setObject(getDescriptor().getObjectBuilder().unwrapObject(getObject(), getSession())); } super.prepare(); // It will only get to prepare if check database if required. getQueryMechanism().prepareDoesExist(getDoesExistField()); }