The method prepares the statement for insert the object in the database.
It must be overwritten, because this type has at least two columns.
{@inheritDoc}
776437
@Override
    public void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate,
                        final Attribute _attribute,
                        final Object... _values)
        throws SQLException
    {
        if (_attribute.getSqlColNames().size() == 3)  {
            checkSQLColumnSize(_attribute, 3);
        } else  {
            checkSQLColumnSize(_attribute, 2);
        }

        final IntegerWithUoM value = eval(_values);
        _insertUpdate.column(_attribute.getSqlColNames().get(0), value.getValue());
        _insertUpdate.column(_attribute.getSqlColNames().get(1), value.getUoM().getId());
        if (_attribute.getSqlColNames().size() == 3) {
            _insertUpdate.column(_attribute.getSqlColNames().get(2), value.getBaseDouble());
        }
    }
1263986
public function prepare($statement, $driver_options = [])
    {
        try {
            $this->_last_statement = $statement;

            return parent::prepare($statement, $driver_options);
        } catch (\PDOException $e) {
            throw new Exception($e->getMessage(), 500, Exception::DBSTATEMENT);
        }
    }
1149531
@Override
    public PoolablePreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
        return prepareStatement(sql, autoGeneratedKeys, -1, -1, -1);
    }
531723
@Override
	public <T extends DAO> T insert(DAO dao, boolean excludePrimaryKeys)  throws DatabaseException{
		ModelDef model = db.getModelMetaDataDefinition().getDefinition(dao.getModelName());
		if(excludePrimaryKeys){
			dao.add_IgnoreColumn( model.getPrimaryAttributes());
		}
		return insertRecord(dao, model, true);
	}
869991
public function prepare($statement)
    {
        try {
            $stmt = new Statement($statement, $this);
        } catch (Throwable $ex) {
            throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $statement);
        }

        $stmt->setFetchMode($this->defaultFetchMode);

        return $stmt;
    }
1174814
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_DATETIMES));
    }
1336744
public function prepareRawStatement(string $statement, array $bindings): void
    {
        $this->statement = $statement;
        if (empty($bindings)) {
            return;
        }

        foreach ($bindings as $key => $value) {
            $this->addBindingValue($key, $value);
        }
    }
326747
protected function addDoInsert()
    {
        $table = $this->getTable();
        $script = "
    /**
     * Insert the row in the database.
     *
     * @param      ConnectionInterface \$con
     *
     * @throws PropelException
     * @see doSave()
     */
    protected function doInsert(ConnectionInterface \$con)
    {";
        if ($this->getPlatform() instanceof MssqlPlatform) {
            if ($table->hasAutoIncrementPrimaryKey() ) {
                $script .= "
        \$this->modifiedColumns[" . $this->getColumnConstant($table->getAutoIncrementPrimaryKey()).'] = true;';
            }
            $script .= "
        \$criteria = \$this->buildCriteria();";
            if ($this->getTable()->getIdMethod() != IdMethod::NO_ID_METHOD) {
                $script .= $this->addDoInsertBodyWithIdMethod();
            } else {
                $script .= $this->addDoInsertBodyStandard();
            }
        } else {
            $script .= $this->addDoInsertBodyRaw();
        }
        $script .= "
        \$this->setNew(false);
    }
";

        return $script;
    }
1044427
public function prepare($statement, array $driver_options = array()) {
		$stmt = @oci_parse($this->_dbh, $statement);
		$this->checkError($stmt);

		$ociPdoStatement = new OciPdoStatementAdapter($this, $stmt, $driver_options + $this->getAttributes());
		$ociPdoStatement->queryString = $statement;

		return $ociPdoStatement;
	}
493367
protected function prepareStatements()
    {
        if (!empty($this->statements)) {
            return;
        }
        $this->statements['load'] = $this->db->prepare(
            'SELECT * FROM `' . $this->options['table'] . '` WHERE `userId` = :userId '
            . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'
        );

        $this->statements['save'] = $this->db->prepare(
            'INSERT INTO `' .
            $this->options['table'] .
            '` (`userId`, `scope`, `name`, `args`, `cachedUntil`, `xml`) VALUES ' .
            '(:userId, :scope, :name, :args, :cachedUntil, :xml)'
        );

        $this->statements['delete'] = $this->db->prepare(
            'DELETE FROM`' . $this->options['table'] . '` WHERE `userId` = :userId '
            . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'
        );
    }
1057667
private static PreparedStatement createStatementForInsert(final Connection connection,
                                                             final Introspected introspected,
                                                             final FieldColumnInfo[] fcInfos) throws SQLException
   {
      final String sql = createStatementCache.computeIfAbsent(introspected, key -> {
         final String tableName = introspected.getTableName();
         final StringBuilder sqlSB = new StringBuilder("INSERT INTO ").append(tableName).append('(');
         final StringBuilder sqlValues = new StringBuilder(") VALUES (");

         for (final FieldColumnInfo fcInfo : fcInfos) {
            sqlSB.append(fcInfo.getDelimitedColumnName()).append(',');
            sqlValues.append("?,");
         }

         sqlValues.deleteCharAt(sqlValues.length() - 1);
         sqlSB.deleteCharAt(sqlSB.length() - 1).append(sqlValues).append(')');

         return sqlSB.toString();
      });

      if (introspected.hasGeneratedId()) {
         return connection.prepareStatement(sql, introspected.getIdColumnNames());
      }
      else {
         return connection.prepareStatement(sql);
      }
   }
1289173
protected function insert()
    {
        if ($this->isDirty()) {
            $sql = 'INSERT INTO '.$this->getTableName().'  SET ';
            $data = [];
            $params = [];

            $pk_name = $this->getPkName();

            foreach ((new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
                if ($this->{$property->getName()}) {
                    if ($this->{$property->getName()} instanceof Expression) {
                        $data[] = "`{$property->getName()}` = ".$this->{$property->getName()}->toSql();
                    } else {
                        $data[] = "`{$property->getName()}` = :{$property->getName()}";
                        $params[":{$property->getName()}"] = $this->{$property->getName()};
                    }
                }
            }

            $sql .= implode(',', $data);

            $stmt = $this->getDB()->prepare($sql);
            $stmt->execute($params);
            $last_insert_id = $this->getDB()->lastInsertId();

            if (is_array($pk_name)) {
                /*
                 * @TODO: Composite PK
                 */
            } else {
                $this->{$pk_name} = $last_insert_id;
            }

            $this->setDirty(false);
            $stmt->closeCursor();
            $this->_is_new = false;
        }

        return true;
    }
1079019
protected function setupObject()
    {
        $schemaType = strtoupper($this->getAttribute("type"));
        $this->copy($this->getDatabase()->getPlatform()->getDomainForType($schemaType));

        //Name
        $this->name = $this->getAttribute("name");

        // Default value
        $defval = $this->getAttribute("defaultValue", $this->getAttribute("default"));
        if ($defval !== null) {
            $this->setDefaultValue(new ColumnDefaultValue($defval, ColumnDefaultValue::TYPE_VALUE));
        } elseif ($this->getAttribute("defaultExpr") !== null) {
            $this->setDefaultValue(new ColumnDefaultValue($this->getAttribute("defaultExpr"), ColumnDefaultValue::TYPE_EXPR));
        }

        $this->size = $this->getAttribute("size");
        $this->scale = $this->getAttribute("scale");
        $this->description = $this->getAttribute("description");
    }
995308
public function init()
    {

        // initialize the prepared statements
        $this->customerVarcharsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHARS));
        $this->customerVarcharByAttributeCodeAndEntityTypeIdAndAndValueStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_VALUE));
    }
1041207
public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache)
			throws SQLException {
		KeyHolder keyHolder = null;
		if (idField != null) {
			boolean assignId;
			if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFieldValueDefault(data)) {
				assignId = false;
			} else {
				assignId = true;
			}
			if (idField.isSelfGeneratedId() && idField.isGeneratedId()) {
				if (assignId) {
					idField.assignField(connectionSource, data, idField.generateId(), false, objectCache);
				}
			} else if (idField.isGeneratedIdSequence() && databaseType.isSelectSequenceBeforeInsert()) {
				if (assignId) {
					assignSequenceId(databaseConnection, data, objectCache);
				}
			} else if (idField.isGeneratedId()) {
				if (assignId) {
					// get the id back from the database
					keyHolder = new KeyHolder(idField.getColumnName());
				}
			} else {
				// the id should have been set by the caller already
			}
		}

		try {
			// implement {@link DatabaseField#foreignAutoCreate()}, need to do this _before_ getFieldObjects() below
			if (tableInfo.isForeignAutoCreate()) {
				for (FieldType fieldType : tableInfo.getFieldTypes()) {
					if (!fieldType.isForeignAutoCreate()) {
						continue;
					}
					// get the field value
					Object foreignObj = fieldType.extractRawJavaFieldValue(data);
					if (foreignObj != null && fieldType.getForeignIdField().isObjectsFieldValueDefault(foreignObj)) {
						fieldType.createWithForeignDao(foreignObj);
					}
				}
			}

			Object[] args = getFieldObjects(data);
			Object versionDefaultValue = null;
			// implement {@link DatabaseField#version()}
			if (versionFieldTypeIndex >= 0 && args[versionFieldTypeIndex] == null) {
				// if the version is null then we need to initialize it before create
				FieldType versionFieldType = argFieldTypes[versionFieldTypeIndex];
				versionDefaultValue = versionFieldType.moveToNextValue(null);
				args[versionFieldTypeIndex] = versionFieldType.convertJavaFieldToSqlArgValue(versionDefaultValue);
			}

			int rowC;
			try {
				rowC = databaseConnection.insert(statement, args, argFieldTypes, keyHolder);
			} catch (SQLException e) {
				// NOTE: don't log full exception here
				logger.debug("insert data with statement '{}' and {} args, threw exception: {}", statement, args.length,
						e);
				if (args.length > 0) {
					// need to do the (Object) cast to force args to be a single object
					logger.trace("insert arguments: {}", (Object) args);
				}
				throw e;
			}
			logger.debug("insert data with statement '{}' and {} args, changed {} rows", statement, args.length, rowC);
			if (args.length > 0) {
				// need to do the (Object) cast to force args to be a single object
				logger.trace("insert arguments: {}", (Object) args);
			}
			if (rowC > 0) {
				if (versionDefaultValue != null) {
					argFieldTypes[versionFieldTypeIndex].assignField(connectionSource, data, versionDefaultValue, false,
							null);
				}
				if (keyHolder != null) {
					// assign the key returned by the database to the object's id field after it was inserted
					Number key = keyHolder.getKey();
					if (key == null) {
						// may never happen but let's be careful out there
						throw new SQLException(
								"generated-id key was not set by the update call, maybe a schema mismatch between entity and database table?");
					}
					if (key.longValue() == 0L) {
						// sanity check because the generated-key returned is 0 by default, may never happen
						throw new SQLException(
								"generated-id key must not be 0 value, maybe a schema mismatch between entity and database table?");
					}
					assignIdValue(data, key, "keyholder", objectCache);
				}
				/*
				 * If we have a cache and if all of the foreign-collection fields have been assigned then add to cache.
				 * However, if one of the foreign collections has not be assigned then don't add it to the cache.
				 */
				if (objectCache != null && foreignCollectionsAreAssigned(tableInfo.getForeignCollections(), data)) {
					Object id = idField.extractJavaFieldValue(data);
					objectCache.put(clazz, id, data);
				}
			}

			return rowC;
		} catch (SQLException e) {
			throw SqlExceptionUtil.create("Unable to run insert stmt on object " + data + ": " + statement, e);
		}
	}
603208
protected function insert()
    {
        foreach ($this->scheduledForInsertion as $objectHashId => $entity) {
            // If this entity was a child of aggregate roots, then call its methods to set the aggregate root Id
            $this->entityRegistry->runAggregateRootCallbacks($entity);
            $className  = $this->entityRegistry->getClassName($entity);
            $dataMapper = $this->getDataMapper($className);

            $dataMapper->insert($entity);

            $this->entityRegistry->registerEntity($entity);
        }
    }
994062
public function _prepare($sql)
    {
        $connection = $this->_adapter->getConnection();

        // db2_prepare on i5 emits errors, these need to be
        // suppressed so that proper exceptions can be thrown
        $this->_stmt = @db2_prepare($connection, $sql);

        if (!$this->_stmt) {
            /**
             * @see Zend_Db_Statement_Db2_Exception
             */
            // require_once 'Zend/Db/Statement/Db2/Exception.php';
            throw new Zend_Db_Statement_Db2_Exception(
                db2_stmt_errormsg(),
                db2_stmt_error()
            );
        }
    }