• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IMappingStrategy类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy的典型用法代码示例。如果您正苦于以下问题:Java IMappingStrategy类的具体用法?Java IMappingStrategy怎么用?Java IMappingStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IMappingStrategy类属于org.eclipse.emf.cdo.server.db.mapping包,在下文中一共展示了IMappingStrategy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createStore

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
protected IStore createStore() {
	final IDBAdapter dbAdapter = getAdapter();

	final IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
	final IDBConnectionProvider dbConnectionProvider = dbAdapter.createConnectionProvider(getDataSource());

	return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
}
 

开发者ID:emfjson,
项目名称:emfjson-samples,
代码行数:9,
代码来源:CDOServer.java

示例2: createStore

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
protected IStore createStore() {
	mappingStrategy = createMappingStrategy();
	Map<String, String> props = new HashMap<String, String>();
	props.put(IMappingStrategy.PROP_QUALIFIED_NAMES, "true"); //$NON-NLS-1$
	mappingStrategy.setProperties(props);
	store = CDODBUtil.createStore(mappingStrategy, createDBAdapter(), DBUtil.createConnectionProvider(getDataSource()));
	mappingStrategy.setStore(store);
	return store;
}
 

开发者ID:opencanarias,
项目名称:model-repository-benchmark,
代码行数:10,
代码来源:AbstractDBCDOModelRepository.java

示例3: createStore

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
private IStore createStore(JdbcDataSource dataSource) {
    IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true);
    IDBAdapter dbAdapter = new H2Adapter();
    IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
    return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
}
 

开发者ID:atlanmod,
项目名称:NeoEMF,
代码行数:7,
代码来源:CdoBackend.java

示例4: createMappingStrategy

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
protected IMappingStrategy createMappingStrategy() {
	return CDODBUtil.createHorizontalMappingStrategy(false);
}
 

开发者ID:opencanarias,
项目名称:model-repository-benchmark,
代码行数:4,
代码来源:AbstractDBCDOModelRepository.java

示例5: getMappingStrategy

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
protected IMappingStrategy getMappingStrategy() {
	return mappingStrategy;
}
 

开发者ID:opencanarias,
项目名称:model-repository-benchmark,
代码行数:4,
代码来源:AbstractDBCDOModelRepository.java

示例6: start

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
@LevelStarted
public void start(DataSourceFactory dataSourceFactory) throws SQLException {
	
	try {
		OMPlatform.INSTANCE.setDebugging(true); 
		OMPlatform.INSTANCE.addLogHandler(org.eclipse.net4j.util.om.log.PrintLogHandler.CONSOLE); 
		OMPlatform.INSTANCE.addTraceHandler(org.eclipse.net4j.util.om.trace.PrintTraceHandler.CONSOLE); 
		
		Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
	    
		TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
	    
	    CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server

	    
		CDOStoreConfig storeConfig = (CDOStoreConfig) getConfig();
	    
		// adapter -> Adapter definito in db-core-cdo.xmi (per es. MySQLAdapter)
		IDBAdapter adapter = DBUtil.getDBAdapter(storeConfig.getAdapter());

		// provider
		Properties dataSourceProps = new Properties();
		dataSourceProps.put("class", storeConfig.getDriver());
		dataSourceProps.put("url", storeConfig.getUrl());
		dataSourceProps.put("user", storeConfig.getCredentials().getUser());
		dataSourceProps.put("password", storeConfig.getCredentials().getPassword());
		
		// TODO retrieve dataFactory by adapter 
		DataSource dataSource = dataSourceFactory.createDataSource(dataSourceProps);		
		IDBConnectionProvider provider = DBUtil.createConnectionProvider(dataSource); 

		// store 		
		Map<String, String> databaseProps = new HashMap<String, String>();
		databaseProps.put("readerPoolCapacity", "10");
		databaseProps.put("writerPoolCapacity", "10");
			
		// strategy 
		IMappingStrategy strategy = createMappingStrategy(); 
				 
		Map<String, String> mappingProps = new HashMap<String, String>();
		mappingProps.put("toManyReferences", "ONE_TABLE_PER_CLASS"); 
		mappingProps.put("qualifiedNames", "false");

		strategy.setProperties(mappingProps);
			
		IDBStore store = CDODBUtil.createStore(strategy, adapter, provider, databaseProps);		
		strategy.setStore(store); 

		// repository 
		Map<String, String> repositoryProps = new HashMap<String, String>(); 
		repositoryProps.put("overrideUUID", "");
		repositoryProps.put("supportingAudits", "false");
		repositoryProps.put("supportingBranches", "false");
		IRepository repository = CDOServerUtil.createRepository(storeConfig.getRepository(), store, repositoryProps); 
		CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository); 
		
		
		QServerSocketConfig socketConfig = storeConfig.getSocketConfig();
		Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", socketConfig.getAddress()+":"+socketConfig.getPort());
		
		System.out.println("CDO activated");
	}
	catch(Exception e) {
		e.printStackTrace();
	}
}
 

开发者ID:asupdev,
项目名称:asup,
代码行数:67,
代码来源:CDOStoreActivatorHook.java

示例7: createMappingStrategy

点赞 2

import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy; //导入依赖的package包/类
private IMappingStrategy createMappingStrategy() {
	//Oppure: CDODBUtil.createMappingStrategy("horizontal")
	return new InternalMappingStrategy();
}
 

开发者ID:asupdev,
项目名称:asup,
代码行数:5,
代码来源:CDOStoreActivatorHook.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)