本文整理汇总了Java中com.orientechnologies.orient.object.db.OObjectDatabaseTx.save方法的典型用法代码示例。如果您正苦于以下问题:Java OObjectDatabaseTx.save方法的具体用法?Java OObjectDatabaseTx.save怎么用?Java OObjectDatabaseTx.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orientechnologies.orient.object.db.OObjectDatabaseTx
的用法示例。
在下文中一共展示了OObjectDatabaseTx.save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: save
import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET> RET save(final Object iContent)
{
final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();
try
{
return (RET) databaseTx.save(iContent);
}
finally
{
databaseTx.close();
}
}
示例2: initializeData
import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Override
public void initializeData() {
final OObjectDatabaseTx db = context.getConnection();
for (int i = 0; i < 10; i++) {
/*
Important notion on proxies:
When you create object you can use simple pojo, but after save don't expect orient will update
the same instance with id and version!
Save method will return different object instance (actually proxy) which have new fields set.
*/
db.save(new Sample("Sample" + i, (int) (Math.random() * 200)));
}
}
示例3: initializeData
import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Override
public void initializeData() {
final OObjectDatabaseTx db = context.getConnection();
for (int i = 0; i < 10; i++) {
/**
* Important notion on proxies:
* When you create object you can use simple pojo, but after save don't expect orient will update
* the same instance with id and version!
* Save method will return different object instance (actually proxy) which have new fields set.
*/
db.save(new Sample("Sample" + i, (int) (Math.random() * 200)));
}
}