DataModelDesc extends RootPersistentEntity { public static DataModelDesc getCopyOf(DataModelDesc orig) { return copy(orig, new DataModelDesc()); } DataModelDesc(); KylinConfig getConfig(); @Override String resourceName(); String getName(); void setName(String name); String getOwner(); void setOwner(String owner); boolean isDraft(); void setDraft(boolean isDraft); String getDescription(); void setDescription(String description); TableRef getRootFactTable(); String getRootFactTableName(); void setRootFactTableName(String rootFactTable); Set<TableRef> getAllTables(); Set<TableRef> getFactTables(); Map<String, TableRef> getAliasMap(); Set<TableRef> getLookupTables(); JoinTableDesc[] getJoinTables(); void setJoinTables(JoinTableDesc[] joinTables); JoinDesc getJoinByPKSide(TableRef table); JoinsTree getJoinsTree(); @Deprecated List<TableDesc> getLookupTableDescs(); boolean isLookupTable(TableRef t); boolean isLookupTable(String fullTableName); boolean isFactTable(TableRef t); boolean isFactTable(String fullTableName); boolean containsTable(TableDesc table); String getFilterCondition(); void setFilterCondition(String filterCondition); PartitionDesc getPartitionDesc(); void setPartitionDesc(PartitionDesc partitionDesc); RealizationCapacity getCapacity(); void setCapacity(RealizationCapacity capacity); TblColRef findColumn(String table, String column); TblColRef findColumn(String column); TableRef findTable(String table); TableRef findFirstTable(String tableIdentity); void init(KylinConfig config, Map<String, TableDesc> tables); void initInternal(KylinConfig config, Map<String, TableDesc> tables); boolean isStandardPartitionedDateColumn(); void addError(String message); void addError(String message, boolean silent); List<String> getError(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String getResourcePath(); static String concatResourcePath(String descName); List<ModelDimensionDesc> getDimensions(); String[] getMetrics(); void setDimensions(List<ModelDimensionDesc> dimensions); void setMetrics(String[] metrics); String getProject(); ProjectInstance getProjectInstance(); String getProjectName(); void setProjectName(String projectName); static DataModelDesc getCopyOf(DataModelDesc orig); static DataModelDesc copy(DataModelDesc orig, DataModelDesc copy);  }
@Test public void testGetCopyOf() throws JsonProcessingException { DataModelDesc desc = DataModelManager.getInstance(getTestConfig()).getDataModelDesc("test_kylin_inner_join_model_desc"); DataModelDesc copyDesc = DataModelDesc.getCopyOf(desc); copyDesc.setUuid(desc.getUuid()); copyDesc.setLastModified(desc.getLastModified()); String descStr = JsonUtil.writeValueAsIndentString(desc); String copyStr = JsonUtil.writeValueAsIndentString(copyDesc); assertEquals(descStr, copyStr); }
@Test public void testPartitionDescCopyOf() throws JsonProcessingException { PartitionDesc desc = DataModelManager.getInstance(getTestConfig()).getDataModelDesc("test_kylin_inner_join_model_desc").partitionDesc; PartitionDesc copyDesc = PartitionDesc.getCopyOf(desc); String descStr = JsonUtil.writeValueAsIndentString(desc); String copyStr = JsonUtil.writeValueAsIndentString(copyDesc); assertEquals(descStr, copyStr); }