本文整理匯總了Java中com.holonplatform.core.datastore.DatastoreConfigProperties類的典型用法代碼示例。如果您正苦於以下問題:Java DatastoreConfigProperties類的具體用法?Java DatastoreConfigProperties怎麽用?Java DatastoreConfigProperties使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DatastoreConfigProperties類屬於com.holonplatform.core.datastore包,在下文中一共展示了DatastoreConfigProperties類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import com.holonplatform.core.datastore.DatastoreConfigProperties; //導入依賴的package包/類
public void setup() {
// tag::setup[]
EntityManagerFactory entityManagerFactory = getEntityManagerFactory(); // get the EntityManagerFactory to use
JpaDatastore datastore = JpaDatastore.builder() // obtain the builder
.entityManagerFactory(entityManagerFactory) // <1>
.autoFlush(true) // <2>
.traceEnabled(true) // <3>
.build();
datastore = JpaDatastore.builder() // obtain the builder
.entityManagerFactory(entityManagerFactory) // <4>
.entityManagerInitializer(emf -> emf.createEntityManager()) // <5>
.entityManagerFinalizer(em -> em.close()) // <6>
.build();
datastore = JpaDatastore.builder() // obtain the builder
.entityManagerFactory(entityManagerFactory) // <7>
.dataContextId("test") // <8>
.configuration(
DatastoreConfigProperties.builder("test").withPropertySource("datastore.properties").build()) // <9>
.build();
// end::setup[]
}
示例2: setup
import com.holonplatform.core.datastore.DatastoreConfigProperties; //導入依賴的package包/類
public void setup() {
// tag::setup[]
JdbcDatastore datastore = JdbcDatastore.builder() // obtain the builder
.dataSource(getDataSource()) // <1>
.database(DatabasePlatform.ORACLE) // <2>
.build();
datastore = JdbcDatastore.builder() // obtain the builder
.dataSource(DataSourceConfigProperties.builder().withPropertySource("jdbc.properties").build()) // <3>
.dialect(new MyDialect()) // <4>
.build();
datastore = JdbcDatastore.builder() // obtain the builder
.dataContextId("db1") // <5>
.dataSource(DataSourceConfigProperties.builder("db1").withPropertySource("jdbc.properties").build()) // <6>
.configuration(
DatastoreConfigProperties.builder("db1").withPropertySource("datastore.properties").build()) // <7>
.build();
// end::setup[]
}
示例3: configuration2
import com.holonplatform.core.datastore.DatastoreConfigProperties; //導入依賴的package包/類
public void configuration2() throws IOException {
// tag::config2[]
DatastoreConfigProperties config1 = DatastoreConfigProperties.builder("one")
.withPropertySource("datastore.properties").build();
DatastoreConfigProperties config2 = DatastoreConfigProperties.builder("two")
.withPropertySource("datastore.properties").build();
// end::config2[]
}