用于Model对象转化为DO对象

@param dataColumnPair
@return DataMediaPairDO
359026
private DataColumnPairDO modelToDo(ColumnPair dataColumnPair) {
        DataColumnPairDO dataColumnPairDo = new DataColumnPairDO();
        dataColumnPairDo.setId(dataColumnPair.getId());
        dataColumnPairDo.setSourceColumnName(dataColumnPair.getSourceColumn() == null ? null : dataColumnPair.getSourceColumn().getName());
        dataColumnPairDo.setTargetColumnName(dataColumnPair.getTargetColumn() == null ? null : dataColumnPair.getTargetColumn().getName());
        dataColumnPairDo.setDataMediaPairId(dataColumnPair.getDataMediaPairId());
        dataColumnPairDo.setGmtCreate(dataColumnPair.getGmtCreate());
        dataColumnPairDo.setGmtModified(dataColumnPair.getGmtModified());

        return dataColumnPairDo;
    }
86988
public static ServiceAdapter<DataSource> forDataSource() {
		return new SimpleServiceAdapter<DataSource>(true, false) {
			@Override
			protected void start(DataSource instance) throws Exception {
				Connection connection = instance.getConnection();
				connection.close();
			}

			@Override
			protected void stop(DataSource instance) {
			}
		};
	}
58676
protected String[] getColumns(final String[] columns, final EntityMetadata m)
    {
        List<String> columnAsList = new ArrayList<String>();
        if (columns != null && columns.length > 0)
        {
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                    m.getPersistenceUnit());
            EntityType entity = metaModel.entity(m.getEntityClazz());
            for (int i = 1; i < columns.length; i++)
            {
                if (columns[i] != null)
                {
                    Attribute col = entity.getAttribute(columns[i]);
                    if (col == null)
                    {
                        throw new QueryHandlerException("column type is null for: " + columns);
                    }
                    columnAsList.add(((AbstractAttribute) col).getJPAColumnName());
                }
            }
        }
        return columnAsList.toArray(new String[] {});
    }
1063354
@SneakyThrows
    public static IPersonAttributeDao newStubAttributeRepository(final PrincipalAttributesProperties p) {
        val dao = new NamedStubPersonAttributeDao();
        val pdirMap = new LinkedHashMap<String, List<Object>>();
        val stub = p.getStub();
        stub.getAttributes().forEach((key, value) -> {
            val vals = StringUtils.commaDelimitedListToStringArray(value);
            pdirMap.put(key, Arrays.stream(vals).collect(Collectors.toList()));
        });
        dao.setBackingMap(pdirMap);
        if (StringUtils.hasText(stub.getId())) {
            dao.setId(stub.getId());
        }
        return dao;
    }
1101387
private SystemParameterDO modelToDo(SystemParameter systemParameter) {
        SystemParameterDO systemParameterDo = new SystemParameterDO();
        systemParameterDo.setValue(systemParameter);
        systemParameterDo.setGmtCreate(new Date());
        systemParameterDo.setGmtModified(new Date());
        return systemParameterDo;
    }
1169569
static IDataModel toDataModel(final Workbook book, final ICellAddress address) {
        if (book == null || address == null) { return null; }
        if (address instanceof A1RangeAddress) { throw new CalculationEngineException("A1RangeAddress is not supported, only one cell can be converted to DataModel."); }
        
        Sheet s = book.getSheetAt(0); /* TODO: only one sheet is supported */
        Row r = s.getRow(address.a1Address().row());
        if (r == null) { return null; }
        Cell c = r.getCell(address.a1Address().column());
        if (c == null || CELL_TYPE_FORMULA != c.getCellType()) { return null; }

        return createDataModelFromCell(s, create((XSSFWorkbook) book), fromRowColumn(c.getRowIndex(), c.getColumnIndex()));
    }
995890
public function setDataVencimento($dataVencimento, $format = 'dmY')
    {
        $this->dataVencimento = trim($dataVencimento, '0 ') ? Carbon::createFromFormat($format, $dataVencimento) : null;

        return $this;
    }
49185
public function toDatamapperObject()
    {
        // directly set private properties if entity extends the datamapper entity class (fast!)
        if (is_subclass_of($this->class, '\ProAI\Datamapper\Support\Entity')) {
            $class = $this->class;

            return $class::newFromEloquentObject($this);
        }

        // set private properties via reflection (slow!)
        $reflectionClass = new ReflectionClass($this->class);

        $entity = $reflectionClass->newInstanceWithoutConstructor();

        // attributes
        foreach ($this->mapping['attributes'] as $attribute => $column) {
            $this->setProperty(
                $reflectionClass,
                $entity,
                $attribute,
                $this->attributes[$column]
            );
        }

        // embeddeds
        foreach ($this->mapping['embeddeds'] as $name => $embedded) {
            $embeddedReflectionClass = new ReflectionClass($embedded['class']);

            $embeddedObject = $embeddedReflectionClass->newInstanceWithoutConstructor();
            foreach ($embedded['attributes'] as $attribute => $column) {
                // set property
                $this->setProperty(
                    $embeddedReflectionClass,
                    $embeddedObject,
                    $attribute,
                    $this->attributes[$column]
                );
            }

            $this->setProperty(
                $reflectionClass,
                $entity,
                $name,
                $embeddedObject
            );
        }

        // relations
        foreach ($this->mapping['relations'] as $name => $relation) {
            // set relation object
            if (! empty($this->relations[$name])) {
                $relationObject = $this->relations[$name]->toDatamapperObject();
            } elseif (in_array($relation['type'], $this->manyRelations)) {
                $relationObject = new ProxyCollection;
            } else {
                $relationObject = new Proxy;
            }
            
            // set property
            $this->setProperty(
                $reflectionClass,
                $entity,
                $name,
                $relationObject
            );
        }

        return $entity;
    }
43585
public function dataTable()
    {
        return (new EloquentDataTable($this->query()))
            ->editColumn('lft', '<i class="fa fa-dot-circle-o"></i>')
            ->addColumn('action', function (Category $category) {
                return view('administrator.categories.datatables.action', $category->toArray());
            })
            ->editColumn('authenticated', function (Category $category) {
                return view('administrator.categories.datatables.authenticated', $category->toArray());
            })
            ->addColumn('pub', function (Category $category) {
                return '<span class="badge bg-green">' . $category->countPublished() . '</span>';
            })
            ->addColumn('unpub', function (Category $category) {
                return '<span class="badge bg-yellow">' . $category->countUnpublished() . '</span>';
            })
            ->editColumn('hits', function (Category $category) {
                return '<span class="badge bg-blue">' . $category->hits . '</span>';
            })
            ->editColumn('title', function (Category $category) {
                return view('administrator.categories.datatables.title', compact('category'));
            })
            ->editColumn('created_at', function (Category $category) {
                return $category->created_at->format('Y-m-d');
            })
            ->rawColumns(['lft', 'published', 'authenticated', 'hits', 'title', 'action', 'pub', 'unpub']);
    }
188702
public ColumnModel extractColumnModel(Column column) {
        LOG.debug("Extracting model for column {}", column.getName());
        ColumnModel model = new ColumnModel();
        model.setName(this.nameProvider.getMethodNameForColumn(column));
        model.setDbName(column.getName());
        model.setDbTableName(column.getParent().getName());
        model.setDbFullTableName(column.getParent().getFullName());

        model.setSqlType(column.getColumnDataType().getName());
        model.setSqlTypeInt(column.getColumnDataType().getJavaSqlType().getVendorTypeNumber());
        String javaDataTypeName = dataTypeProvider.getCanonicalDataTypeName(column);
        model.setJavaTypeName(javaDataTypeName);
        model.setNotNull(!column.isNullable());
        model.setPartOfPrimaryKey(column.isPartOfPrimaryKey());
        model.setPartOfForeignKey(column.isPartOfForeignKey());
        model.setExplicitAttribute(explicitAttributeDecider.isExplicitAttribute(column));
        model.setUnique(column.isPartOfUniqueIndex() || column.isPartOfPrimaryKey());

        model.setConvenienceSetters(convenienceSetterProvider.getConvenienceSetters(column, javaDataTypeName));

        return model;
    }
872193
public static function getColumnModelFromMetadata(ColumnsMetadata $metadata_columns)
    {
        $cm = new ColumnModel();
        $cm->setMetatadata($metadata_columns);
        foreach ($metadata_columns as $name => $meta) {
            $column = new Column($name);
            $column->setType(self::getColumnTypeByMetadataType($meta->getDataType()));
            $column->setVirtual(false);
            $cm->add($column);
        }

        return $cm;
    }
1142683
public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
    {
        if ($this->dataObject)
            $this->dataObject->bindColumn($column, $param, $type, $maxlen, $driverdata);
    }
374514
Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) {
        try {
            // Allocate a new entity
            Object entity         = clazz.newInstance();
            
            idMapper.setValue(entity, id);
            setEntityFieldsFromColumnName(entity, c.getRawName().duplicate());
            valueMapper.setField(entity, c.getByteBufferValue().duplicate());
            return entity;
        } catch(Exception e) {
            throw new PersistenceException("failed to construct entity", e);
        }
    }
92859
@Override
    public DataMedia findById(Long dataMediaId) {
        Assert.assertNotNull(dataMediaId);
        List<DataMedia> dataMedias = listByIds(dataMediaId);
        if (dataMedias.size() != 1) {
            String exceptionCause = "query dataMediaId:" + dataMediaId + " but return " + dataMedias.size()
                                    + " dataMedia.";
            logger.error("ERROR ## " + exceptionCause);
            throw new ManagerException(exceptionCause);
        }
        return dataMedias.get(0);

    }
54315
public static DataMediaPair findDataMediaPair(Pipeline pipeline, Long pairId) {
        Assert.notNull(pipeline);
        for (DataMediaPair pair : pipeline.getPairs()) {
            if (pair.getId().equals(pairId)) {
                return pair;
            }
        }

        throw new ConfigException("no such DataMediaPair , the pairId = " + pairId);
    }
345643
public void addColumnPair(String localColumn, String remoteColumn)
    {
        if (!_localColumns.contains(localColumn))
        {    
            _localColumns.add(localColumn);
        }
        if (!_remoteColumns.contains(remoteColumn))
        {    
            _remoteColumns.add(remoteColumn);
        }
    }
461708
public void setDataModel(final TableDataModel dataModel) {
		getOrCreateComponentModel().dataModel = dataModel;
		getOrCreateComponentModel().rowIndexMapping = null;

		if (dataModel instanceof BeanTableDataModel) {
			((BeanTableDataModel) dataModel).setBeanProvider(new DataTableBeanProvider(this));
			((BeanTableDataModel) dataModel).setBeanProperty(".");
		}

		if (dataModel instanceof ScrollableTableDataModel) {
			int startIndex = getCurrentPage() * getRowsPerPage();
			int endIndex = startIndex + getRowsPerPage() - 1;
			((ScrollableTableDataModel) dataModel).setCurrentRows(startIndex, endIndex);
		}

		// Flush the repeater's row contexts and scratch maps
		repeater.reset();
	}