當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。