Determine the insert strategy for the given
entity using static configuration and runtime option

@param property entity property
@return overriden InsertStrategy
438516
public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) {

        final InsertStrategy insertStrategy = OverridingOptional
                .from(this.insertStrategy)
                .defaultValue(property.insertStrategy())
                .get();

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(format("Get runtime insert strategy for entity %s : %s",
                    property.entityClass.getCanonicalName(), insertStrategy.name()));
        }

        return insertStrategy;
    }
872296
@Override
	public InsertsType getDefaultInsertsType() {
		return InsertsType.valueOf(getDefaultProps().getOrDefault(PROPS_KEY_DEFAULT_INSERTS_TYPE,
				InsertsType.BULK.toString()));
	}
953664
@SuppressWarnings("unchecked")
    public ModelNode fromEntity(T entity)
    {

        ModelNode operation = new ModelNode();
        List<PropertyBinding> properties = metaData.getBeanMetaData(getType()).getProperties();
        Mutator mutator = metaData.getMutator(getType());

        for(PropertyBinding property : properties)
        {
            String[] splitDetypedName = property.getDetypedName().split("/");

            /**
             * KEYS
             */
            //      if(property.isKey()) continue;

            Object propertyValue = mutator.getValue(entity, property.getJavaName());

            /**
             * EXPRESSIONS
             */
            if(property.doesSupportExpression())
            {
                String exprValue = ExpressionAdapter.getExpressionValue(
                        entity, property.getJavaName()
                );

                if(exprValue!=null)
                {
                    operation.get(splitDetypedName).setExpression(exprValue);
                    continue; // expression have precedence over real values
                }
            }

            /**
             * VALUES
             */
            if(propertyValue!=null)
            {
                try {
                    ModelType modelType = resolveModelType(property.getJavaTypeName());
                    if ((modelType == ModelType.LIST) && (property.getListType() == PropertyBinding.class)) {
                        operation.get(splitDetypedName).set(modelType, property.getEntityAdapterForList().fromEntityPropertyList((List) propertyValue));
                    } else if (modelType == ModelType.LIST) {
                        operation.get(splitDetypedName).set(modelType,
                                property.getEntityAdapterForList().fromEntityList((List) propertyValue));
                    } else if (modelType == ModelType.OBJECT) {
                        // Only Map<String, String> is supported!
                        Map<String, String> map = (Map<String, String>) propertyValue;
                        for (Map.Entry<String, String> entry : map.entrySet()) {
                            operation.get(splitDetypedName).get(entry.getKey()).set(entry.getValue());
                        }
                    } else {
                        operation.get(splitDetypedName).set(modelType, propertyValue);
                    }
                } catch (RuntimeException e) {
                    throw new RuntimeException("Failed to get value "+property.getJavaName(), e);
                }
            }
        }

        return operation;
    }
270895
public List<SQLProperty> getForeignKeysToEntity(SQLiteEntity entity, String fieldName) {
		List<SQLProperty> result = new ArrayList<>();
		if (StringUtils.hasText(fieldName)) {
			for (SQLProperty item : this.collection) {
				if (item.isForeignKey() && entity.getName().equals(item.foreignParentClassName)
						&& item.getName().equals(fieldName)) {
					result.add(item);
				}
			}
		} else {
			for (SQLProperty item : this.collection) {
				if (item.isForeignKey() && entity.getName().equals(item.foreignParentClassName)) {
					result.add(item);
				}
			}
		}
		return result;
	}
322302
private void buildEntityFromCursor(Object entity, HashMap obj, EntityType entityType)
    {
        Iterator<Attribute> iter = entityType.getAttributes().iterator();
        while (iter.hasNext())
        {
            Attribute attribute = iter.next();
            Field field = (Field) attribute.getJavaMember();
            if (field.isAnnotationPresent(Id.class))
            {
                PropertyAccessorHelper.set(entity, field, obj.get(ID));
            }
            else
            {
                PropertyAccessorHelper.set(entity, field, obj.get(((AbstractAttribute) attribute).getJPAColumnName()));
            }

        }
    }
581272
private void generateInsert(M2MEntity entity, String packageName) {
		if (!isMethodAlreadyDefined(entity, "insert")) {
			// @formatter:off
			MethodSpec methodSpec = MethodSpec.methodBuilder("insert").addModifiers(Modifier.PUBLIC)
					.addModifiers(Modifier.ABSTRACT).addAnnotation(AnnotationSpec.builder(BindSqlInsert.class).build())
					.addParameter(ParameterSpec.builder(TypeUtility.className(packageName, entity.name), "bean")
							.addAnnotation(
									AnnotationSpec.builder(BindSqlParam.class).addMember("value", "$S", "bean").build())
							.build())
					.returns(Integer.TYPE).build();
			// @formatter:on
			classBuilder.addMethod(methodSpec);
		}
	}
1109711
@SuppressWarnings("unchecked")
	@Override
	public <E> int bulkInsert(final Class<E> entityType, final Stream<E> entities,
			final InsertsCondition<? super E> condition) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);
			SqlContext context = handler.createBulkInsertContext(this, metadata, entityType);
			context.setSqlKind(SqlKind.BULK_INSERT);

			// IDアノテーションが付与されたカラム情報を取得する
			MappingColumn[] idColumns = MappingUtils.getIdMappingColumns(entityType);

			setGeneratedKeyColumns(context, idColumns, metadata);

			int frameCount = 0;
			int count = 0;
			List<E> entityList = new ArrayList<>();
			for (Iterator<E> iterator = entities.iterator(); iterator.hasNext();) {
				E entity = iterator.next();

				if (!entityType.isInstance(entity)) {
					throw new IllegalArgumentException("Entity types do not match");
				}

				entityList.add(entity);

				handler.setBulkInsertParams(context, entity, frameCount);
				frameCount++;

				if (condition.test(context, frameCount, entity)) {
					count += doBulkInsert(context, entityType, handler, metadata, idColumns, entityList);
					frameCount = 0;
					entityList.clear();

					// 新しいSqlContextを作成する前にgeneratedKeyColumnsを退避しておく
					String[] generatedKeyColumns = context.getGeneratedKeyColumns();
					context = handler.createBulkInsertContext(this, metadata, entityType);
					context.setSqlKind(SqlKind.BULK_INSERT);
					// 実行結果から生成されたIDを取得できるようにPreparedStatementにIDカラムを渡す
					context.setGeneratedKeyColumns(generatedKeyColumns);
				}
			}
			return count + (frameCount > 0 ? doBulkInsert(context, entityType, handler, metadata, idColumns, entityList)
					: 0);

		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.BULK_INSERT, e);
		}
	}
449706
public function buildInsertQuery($entity) {

        $mapper = MapperBuilder::buildFromMapping($this->mapping, get_class($entity));
        $fields = "";
        $values = "";
        foreach ($mapper->getPropertys() as $property) {
            if ($property->getColumn() != "id") {
                $method = "get" . $property->getName();
                $entity->$method();
                $fields .= "`" . $property->getColumn() . "`, ";
                $values .= "'" . $entity->$method() . "', ";
            }
        }

        $fields = substr_replace($fields, "", -2);
        $values = substr_replace($values, "", -2);

        $query = "INSERT INTO `" . $mapper->getTable() . "` (" . $fields . ") VALUES (" . $values . ");";

        return $query;
    }
851303
public static <T> T insertObject(T object)
    {
        return SqlClosure.sqlExecute(c -> OrmElf.insertObject(c, object));
    }
885622
@Override
	public void put(Object entity) {
		if (entity == null) {
			throw new IllegalArgumentException("'entity' must not be [" + entity + "]");
		}
		
		if (operation != null) {
			throw new IllegalStateException("Log [" + operation + "] -> ["
					+ Log.Operation.PUT
					+ "] is not allowed: This operation must be first");
		}
		
		Key id = Keys.create(Translation.toKind(entity.getClass()), Entities.keyValue(entity));
		Entity e = datastore.get(local, id);
		
		if (e != null) {
			throw new EntityExistsException(id);
		}
		
		this.entity = entity;
		operation = Log.Operation.PUT;
	}
549780
public SQLInsertClause insertIgnore(RelationalPath<?> entity) {
        SQLInsertClause insert = insert(entity);
        insert.addFlag(Position.START_OVERRIDE, "insert ignore into ");
        return insert;
    }
750818
public int insert(Entity record) throws SQLException {
		Connection conn = null;
		try {
			conn = this.getConnection();
			return runner.insert(conn, record);
		} catch (SQLException e) {
			throw e;
		} finally {
			this.closeConnection(conn);
		}
	}
985453
protected function insertIntoDatabase(Entity $entity)
    {
        $primaryKey = $this->mapper->getPrimaryKey($this->getTable());
        $values = $entity->getModifiedRowData();
        $this->connection->query(
            'INSERT INTO %n %v',
            $this->getTable(),
            $values
        );
        return isset($values[$primaryKey]) ? $values[$primaryKey] : $this->connection->getInsertId();
    }
790344
public function getTranslation($entity, $property, $locale)
    {
        $metadata = $this->metadataCollection->getMetadata($entity);
        if($metadata === null) {
            return null;
        }

        $property = $metadata->getProperty($property);
        if($property === null) {
            return null;
        }

        $strategy = $this->strategyResolver->getStrategy($property->getStrategy());
        return $strategy->getTranslation($entity, $property, $locale, $metadata);
    }
890331
public FessMessages addSuccessCrudUpdateCrudTable(String property) {
        assertPropertyNotNull(property);
        add(property, new UserMessage(SUCCESS_crud_update_crud_table));
        return this;
    }
1175951
public QueryResults<ProjectionEntity> newProjectionEntityQuery(String kind, String property) {
    // [START newProjectionEntityQuery]
    Query<ProjectionEntity> query =
        Query.newProjectionEntityQueryBuilder().setKind(kind).addProjection(property).build();
    QueryResults<ProjectionEntity> results = datastore.run(query);
    // Use results
    // [END newProjectionEntityQuery]
    return results;
  }
733709
private String setProperty(Node node, HierarchicalProperty property)
   {

      String propertyName = WebDavNamespaceContext.createName(property.getName());

      if (READ_ONLY_PROPS.contains(property.getName()))
      {
         return WebDavConst.getStatusDescription(HTTPStatus.CONFLICT);
      }

      try
      {

         Workspace ws = node.getSession().getWorkspace();
         NodeTypeDataManager nodeTypeHolder = ((WorkspaceImpl)ws).getNodeTypesHolder();
         NodeData data = (NodeData)((NodeImpl)node).getData();
         InternalQName propName =
            ((SessionImpl)node.getSession()).getLocationFactory().parseJCRName(propertyName).getInternalName();
         PropertyDefinitionDatas propdefs =
            nodeTypeHolder.getPropertyDefinitions(propName, data.getPrimaryTypeName(), data.getMixinTypeNames());
         if (propdefs == null)
         {
            throw new RepositoryException();
         }

         PropertyDefinitionData propertyDefinitionData = propdefs.getAnyDefinition();
         if (propertyDefinitionData == null)
         {
            throw new RepositoryException();
         }

         boolean isMultiValued = propertyDefinitionData.isMultiple();

         if (node.isNodeType(WebDavConst.NodeTypes.MIX_VERSIONABLE) && !node.isCheckedOut())
         {
            node.checkout();
            node.save();
         }

         if (!isMultiValued)
         {
            node.setProperty(propertyName, property.getValue());
         }
         else
         {
            String[] value = new String[1];
            value[0] = property.getValue();
            node.setProperty(propertyName, value);
         }

         node.save();
         return WebDavConst.getStatusDescription(HTTPStatus.OK);

      }
      catch (AccessDeniedException e)
      {
         return WebDavConst.getStatusDescription(HTTPStatus.FORBIDDEN);
      }
      catch (ItemNotFoundException e)
      {
         return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND);
      }
      catch (PathNotFoundException e)
      {
         return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND);
      }
      catch (RepositoryException e)
      {
         return WebDavConst.getStatusDescription(HTTPStatus.CONFLICT);

      }

   }