@Override public Object clone() { Category clone = new Category(); // shallow copies clone( clone ); clone.setParent( getParent() ); // deep copies clone.setLogicalColumns( new ArrayList<LogicalColumn>() ); for ( LogicalColumn col : getLogicalColumns() ) { clone.addLogicalColumn( col ); } return clone; } }
protected void populateCategories( ModelerWorkspace workspace ) { RelationalModelNode model = workspace.getRelationalModel(); LogicalModel logicalModel = workspace.getDomain().getLogicalModels().get( 0 ); logicalModel.getCategories().clear(); for ( CategoryMetaData catMeta : model.getCategories() ) { Category cat = new Category(); cat.setName( new LocalizedString( this.getLocale(), catMeta.getName() ) ); cat.setId( catMeta.getName() ); for ( FieldMetaData fieldMeta : catMeta ) { LogicalColumn lCol = fieldMeta.getLogicalColumn(); LogicalTable lTable = lCol.getLogicalTable(); if ( !lTable.getLogicalColumns().contains( lCol ) ) { lTable.addLogicalColumn( lCol ); } lCol.setName( new LocalizedString( locale, fieldMeta.getName() ) ); AggregationType type = fieldMeta.getDefaultAggregation(); lCol.setAggregationType( type ); setLogicalColumnFormat( fieldMeta.getFormat(), lCol ); Set<AggregationType> possibleAggs = new HashSet<AggregationType>(); possibleAggs.add( fieldMeta.getDefaultAggregation() ); possibleAggs.addAll( fieldMeta.getSelectedAggregations() ); lCol.setAggregationList( Arrays.<AggregationType>asList( possibleAggs .toArray( new AggregationType[possibleAggs.size()] ) ) ); cat.addLogicalColumn( lCol ); } logicalModel.addCategory( cat ); } }
Category cat = new Category( logicalModel ); cat.setId( category.getAttribute( "name" ) ); //$NON-NLS-1$ xmiConceptMap.put( category.getAttribute( "xmi.id" ), cat ); //$NON-NLS-1$
logicalModel.setName( new LocalizedString( locale.getCode(), modelName ) ); Category mainCategory = new Category( logicalModel ); String categoryID = Settings.getBusinessCategoryIDPrefix() + modelName; mainCategory.setId( categoryID );
.setDescription( new LocalizedString( locale.getCode(), "This is the data model for " + modelName ) ); Category mainCategory = new Category( logicalModel ); String categoryID = Settings.getBusinessCategoryIDPrefix() + modelName; mainCategory.setId( categoryID );
Category category = new Category( logicalModel ); convertConceptFromLegacy( bizCategory, category );