本文整理了Java中javax.persistence.EntityManager.setProperty()
方法的一些代码示例,展示了EntityManager.setProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EntityManager.setProperty()
方法的具体详情如下:
包路径:javax.persistence.EntityManager
类名称:EntityManager
方法名:setProperty
[英]Set an entity manager property or hint. If a vendor-specific property or hint is not recognized, it is silently ignored.
[中]设置实体管理器属性或提示。如果无法识别特定于供应商的属性或提示,则会自动忽略该属性或提示。
代码示例来源:origin: rapidoid/rapidoid
@Override
public void setProperty(String propertyName, Object value) {
em.setProperty(propertyName, value);
}
代码示例来源:origin: rapidoid/rapidoid
@Override
public void setProperty(String propertyName, Object value) {
em().setProperty(propertyName, value);
}
代码示例来源:origin: Impetus/Kundera
/**
* Sets the up.
*
* @throws Exception
* the exception
*/
@Before
public void setUp() throws Exception
{
em = emf.createEntityManager();
em.setProperty("kundera.hdfs.outputfile.path", "hdfs://localhost:9000/sparkInputTest/input");
em.setProperty("kundera.hdfs.inputfile.path", "hdfs://localhost:9000/sparkInputTest/input");
em.setProperty("format", "json");
}
代码示例来源:origin: Impetus/Kundera
/**
* Sets the up.
*
* @throws Exception
* the exception
*/
@Before
public void setUp() throws Exception
{
em = emf.createEntityManager();
em.setProperty("kundera.fs.outputfile.path", OUTPUT_FILE_DIR);
em.setProperty("format", "csv");
}
代码示例来源:origin: Impetus/Kundera
/**
* Sets the up.
*
* @throws Exception
* the exception
*/
@Before
public void setUp() throws Exception
{
em = emf.createEntityManager();
em.setProperty("kundera.fs.inputfile.path", "src/test/resources/test.csv");
em.setProperty("format", "csv");
}
代码示例来源:origin: Impetus/Kundera
/**
* Setup.
*/
@Before
public void setup()
{
emf = Persistence.createEntityManagerFactory("es-refresh-indexes-pu");
em = emf.createEntityManager();
/*
* This property will force ES to refresh indexes on all the nodes after
* insert, update and delete operations.
*
*/
em.setProperty("es.refresh.indexes", true);
}
代码示例来源:origin: Impetus/Kundera
/**
* Sets the up.
*
* @throws Exception
* the exception
*/
@Before
public void setUp() throws Exception
{
em = emf.createEntityManager();
/*
* By default Bulk Operation is UNORDERED. But you can set this to
* ORDERED/UNORDERED using boolean true/false for a particular em
* instance
*/
em.setProperty(MongoDBClientProperties.ORDERED_BULK_OPERATION, true);
/*
*
* By default WriteConcern is ACKNOWLEDGED. But it can be changed to any
* desired value for a particular em instance
*/
em.setProperty(MongoDBClientProperties.WRITE_CONCERN, new WriteConcern(1));
}
代码示例来源:origin: Impetus/Kundera
em.setProperty("ttl.per.request", true);
em.setProperty("ttl.values", ttlValues);
em.setProperty(PersistenceProperties.KUNDERA_BATCH_SIZE, 5);
int counter = 0;
List<CQLUser> rows = prepareData(10);
代码示例来源:origin: Impetus/Kundera
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception
{
if (RUN_IN_EMBEDDED_MOODE)
{
CassandraCli.cassandraSetUp();
}
if (AUTO_MANAGE_SCHEMA)
{
createKeyspace();
createColumnFamily();
}
emf = Persistence.createEntityManagerFactory(persistenceUnit);
em = emf.createEntityManager();
em.setProperty(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);
}
代码示例来源:origin: Impetus/Kundera
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception
{
if (RUN_IN_EMBEDDED_MOODE)
{
CassandraCli.cassandraSetUp();
}
if (AUTO_MANAGE_SCHEMA)
{
createKeyspace();
createColumnFamily();
}
emf = Persistence.createEntityManagerFactory(persistenceUnit);
em = emf.createEntityManager();
em.setProperty(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);
}
代码示例来源:origin: Impetus/Kundera
em.setProperty("ttl.per.request", true);
em.setProperty("ttl.values", ttlValues);
代码示例来源:origin: kumuluz/kumuluzee
@Override
public void setProperty(String propertyName, Object value) {
em.setProperty(propertyName, value);
}
代码示例来源:origin: EvoSuite/evosuite
@Override
public void setProperty(String propertyName, Object value) {
em.setProperty(propertyName,value);
}
代码示例来源:origin: org.wildfly/wildfly-jpa
@Override
public void setProperty(String propertyName, Object value) {
entityManager.setProperty(propertyName, value);
}
代码示例来源:origin: Impetus/Kundera
Map<String, Map<String, Integer>> ttlValues = new HashMap<String, Map<String, Integer>>();
ttlValues.put("PERSONCASSANDRA", ttlColumns);
em.setProperty("ttl.per.request", true);
em.setProperty("ttl.values", ttlValues);
代码示例来源:origin: Impetus/Kundera
em.setProperty("ttl.per.request", true);
em.setProperty("ttl.values", ttlValues);
em.setProperty("ttl.per.request", true);
em.setProperty("ttl.values", ttlValues);
em.setProperty("ttl.per.session", true);
em.setProperty("ttl.values", ttlValues);
ttlValues = new HashMap<String, Integer>();
ttlValues.put("PERSONCASSANDRA", new Integer(10));
em.setProperty("ttl.per.session", true);
em.setProperty("ttl.values", ttlValues);
em.persist(p4);
em.clear();
代码示例来源:origin: Impetus/Kundera
em.setProperty(MongoDBClientProperties.WRITE_CONCERN, wcNew);
em.setProperty(MongoDBClientProperties.BATCH_SIZE, 5);
em.setProperty(MongoDBClientProperties.BATCH_SIZE,""+ 2);
Assert.assertEquals(2, client.getBatchSize());
代码示例来源:origin: org.codehaus.fabric3/fabric3-jpa-hibernate
public void setProperty(String s, Object o) {
initEntityManager();
em.setProperty(s, o);
}
代码示例来源:origin: stackoverflow.com
EntityManagerFactory emf = Persistence.createEntityManagerFactory("records");
EntityManager em = emf.createEntityManager();
em.setProperty(MongoDBClientProperties.WRITE_CONCERN, WriteConcern.UNACKNOWLEDGED);
RecordVersion recVersion = new RecordVersion();
//setting children
em.merge(recVersion);
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
public void setProperty(String name, Object value) {
EntityManager entityManager = getEntityManager();
try {
entityManager.setProperty(name, value);
} finally {
closeIfNoTx(entityManager);
}
}
/* (non-Javadoc)
内容来源于网络,如有侵权,请联系作者删除!