@Test public void testMergeTokensSorting() { LinkedList<MergerToken> tokens = new LinkedList<MergerToken>(); tokens.add(new AddColumnToModel(null, null)); tokens.add(new AddRelationshipToModel(null, null)); tokens.add(new CreateTableToDb(null)); tokens.add(new CreateTableToModel(null)); assertEquals(asList("CreateTableToDb", "CreateTableToModel", "AddColumnToModel", "AddRelationshipToModel"), toClasses(DefaultDbImportAction.sort(tokens))); }
protected static List<MergerToken> sort(List<MergerToken> reverse) { Collections.sort(reverse); return reverse; }
DefaultDbImportAction implements DbImportAction { protected static List<MergerToken> sort(List<MergerToken> reverse) { Collections.sort(reverse); return reverse; } }
DefaultDbImportAction implements DbImportAction { protected static List<MergerToken> sort(List<MergerToken> reverse) { Collections.sort(reverse); return reverse; } DefaultDbImportAction(@Inject Logger logger,
                                 @Inject ProjectSaver projectSaver,
                                 @Inject DataSourceFactory dataSourceFactory,
                                 @Inject DbAdapterFactory adapterFactory,
                                 @Inject DataMapLoader mapLoader,
                                 @Inject MergerTokenFactoryProvider mergerTokenFactoryProvider,
                                 @Inject DataChannelDescriptorLoader dataChannelDescriptorLoader,
                                 @Inject DataChannelMetaData metaData); }
DefaultDbImportAction implements DbImportAction { protected static List<MergerToken> sort(List<MergerToken> reverse) { Collections.sort(reverse); return reverse; } DefaultDbImportAction(@Inject Logger logger,
                                 @Inject ProjectSaver projectSaver,
                                 @Inject DataSourceFactory dataSourceFactory,
                                 @Inject DbAdapterFactory adapterFactory,
                                 @Inject DataMapLoader mapLoader,
                                 @Inject MergerTokenFactoryProvider mergerTokenFactoryProvider,
                                 @Inject DataChannelDescriptorLoader dataChannelDescriptorLoader,
                                 @Inject DataChannelMetaData metaData); static void flattenManyToManyRelationships(DataMap map, Collection<ObjEntity> loadedObjEntities,
                                                         ObjectNameGenerator objectNameGenerator); @Override void execute(DbImportConfiguration config); boolean hasTokensToImport(Collection<MergerToken> tokens); }
DefaultDbImportAction implements DbImportAction { protected static List<MergerToken> sort(List<MergerToken> reverse) { Collections.sort(reverse); return reverse; } DefaultDbImportAction(@Inject Logger logger,
                                 @Inject ProjectSaver projectSaver,
                                 @Inject DataSourceFactory dataSourceFactory,
                                 @Inject DbAdapterFactory adapterFactory,
                                 @Inject DataMapLoader mapLoader,
                                 @Inject MergerTokenFactoryProvider mergerTokenFactoryProvider,
                                 @Inject DataChannelDescriptorLoader dataChannelDescriptorLoader,
                                 @Inject DataChannelMetaData metaData); static void flattenManyToManyRelationships(DataMap map, Collection<ObjEntity> loadedObjEntities,
                                                         ObjectNameGenerator objectNameGenerator); @Override void execute(DbImportConfiguration config); boolean hasTokensToImport(Collection<MergerToken> tokens);  }