当前位置: 首页>>代码示例>>Java>>正文


Java TargetServer类代码示例

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


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

示例1: getDbProperties

import org.eclipse.persistence.config.TargetServer; //导入依赖的package包/类
private static Map<String, String> getDbProperties() {
    Map<String, String> properties = new HashMap<String, String>();

    // Ensure RESOURCE_LOCAL transactions is used.
    properties.put(TRANSACTION_TYPE, PersistenceUnitTransactionType.RESOURCE_LOCAL.name());

    // Ensure that no server-platform is configured
    properties.put(TARGET_SERVER, TargetServer.None);

    // give the package name of metaentities
    properties.put("eclipselink.canonicalmodel.subpackage", "metaentity");
    return properties;
}
 
开发者ID:inepex,项目名称:ineform,代码行数:14,代码来源:EntityManagerInitializier.java

示例2: getDbProperties

import org.eclipse.persistence.config.TargetServer; //导入依赖的package包/类
private static Map<String, String> getDbProperties() {
		Map<String, String> properties = new HashMap<String, String>();
		 
	    // Ensure RESOURCE_LOCAL transactions is used.
	    properties.put(TRANSACTION_TYPE,
	        PersistenceUnitTransactionType.RESOURCE_LOCAL.name());
	 
	    // Configure the internal EclipseLink connection pool
	    properties.put(JDBC_DRIVER, "org.postgresql.Driver");
//	    properties.put(JDBC_URL, "jdbc:postgresql://localhost/IneFormTest");
//	    properties.put(JDBC_USER, "postgres");
//	    properties.put(JDBC_PASSWORD, "ine123pex");
	    properties.put(JDBC_URL, "jdbc:postgresql://localhost/IneFormTest");
	    properties.put(JDBC_USER, "IneFormTest");
	    properties.put(JDBC_PASSWORD, "IneFormTest");

	 
	    // Configure logging. FINE ensures all SQL is shown
	    properties.put(LOGGING_LEVEL, "FINE");
	    properties.put(LOGGING_TIMESTAMP, "false");
	    properties.put(LOGGING_THREAD, "false");
	    properties.put(LOGGING_SESSION, "false");
	 
	    // Ensure that no server-platform is configured
	    properties.put(TARGET_SERVER, TargetServer.None);
	    
	    //give the package name of metaentities
	    properties.put("eclipselink.canonicalmodel.subpackage", "metaentity");
	    return properties;		
	}
 
开发者ID:inepex,项目名称:ineform,代码行数:31,代码来源:EntityManagerInitializier.java

示例3: assignPropertiesTM

import org.eclipse.persistence.config.TargetServer; //导入依赖的package包/类
/**
 * @return {@link Properties}
 */
private static Properties assignPropertiesTM() {

	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.TARGET_DATABASE,
			"org.eclipse.persistence.platform.database.H2Platform");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.h2.Driver");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:h2:mem:jped-persist");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.JDBC_USER, "persist");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "persist");

	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_LOGGER, "DefaultLogger");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_LEVEL, "FINE");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_TIMESTAMP, "false");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_THREAD, "false");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_SESSION, "false");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.LOGGING_EXCEPTIONS, "false");

	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.CONNECTION_POOL_READ, "1");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.CONNECTION_POOL_INITIAL, "1");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.CONNECTION_POOL_MIN, "1");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.CONNECTION_POOL_MAX, "10");

	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.TARGET_SERVER, TargetServer.None);

	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.DDL_GENERATION, "create-tables");
	JpaEmbeddedH2Properties.properties.setProperty(PersistenceUnitProperties.DDL_GENERATION_MODE, "both");

	return JpaEmbeddedH2Properties.properties;
}
 
开发者ID:gtcGroup,项目名称:jped-parent-project,代码行数:32,代码来源:JpaEmbeddedH2Properties.java

示例4: init

import org.eclipse.persistence.config.TargetServer; //导入依赖的package包/类
public void init(String unitName) {

    Map<String, String> properties = Maps.newHashMap();

    // Ensure RESOURCE_LOCAL transactions is used.
    properties.put(TRANSACTION_TYPE, PersistenceUnitTransactionType.RESOURCE_LOCAL.name());

    // Configure the internal EclipseLink connection pool
    properties.put(JDBC_DRIVER, dbDriver);
    properties.put(JDBC_URL, dbUrl);
    properties.put(JDBC_USER, dbUser);
    properties.put(JDBC_PASSWORD, dbPassword);
    properties.put(JDBC_READ_CONNECTIONS_MIN, minRead);
    properties.put(JDBC_WRITE_CONNECTIONS_MIN, minWrite);

    // Configure logging. FINE ensures all SQL is shown
    properties.put(LOGGING_LEVEL, "FINE");
    properties.put(LOGGING_TIMESTAMP, "true");
    properties.put(LOGGING_THREAD, "false");
    properties.put(LOGGING_SESSION, "false");

    // Ensure that no server-platform is configured
    properties.put(TARGET_SERVER, TargetServer.None);

    properties.put(PersistenceUnitProperties.DDL_GENERATION, PersistenceUnitProperties.CREATE_ONLY);
    properties.put(PersistenceUnitProperties.DROP_JDBC_DDL_FILE, "drop.sql");
    properties.put(PersistenceUnitProperties.CREATE_JDBC_DDL_FILE, "create.sql");
    properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE,
        PersistenceUnitProperties.DDL_BOTH_GENERATION);

    // properties.put(PersistenceUnitProperties.SESSION_CUSTOMIZER,
    // EnableIntegrityChecker.class.getName());

    LOG.info("Starting connection manager with properties " + properties);

    EntityManagerFactory emFactory = Persistence.createEntityManagerFactory(unitName, properties);
    entityManager = emFactory.createEntityManager();
  }
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:39,代码来源:Bootstrap.java


注:本文中的org.eclipse.persistence.config.TargetServer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。