本文整理汇总了Java中org.neo4j.ogm.session.Session类的典型用法代码示例。如果您正苦于以下问题:Java Session类的具体用法?Java Session怎么用?Java Session使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Session类属于org.neo4j.ogm.session包,在下文中一共展示了Session类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
@Override
public Session get()
{
if (!isWorking())
{
begin();
}
Session session = sessions.get();
if (session == null)
{
throw new IllegalStateException("Requested Session outside work unit. " +
"Try calling UnitOfWork.begin() first, or use a PersistFilter if you " +
"are inside a servlet environment.");
}
return session;
}
示例2: configurePersistence
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
protected void configurePersistence() {
bind(String[].class).annotatedWith(Neo4j.class).toInstance(packages);
if (null != properties) {
bind(Properties.class).annotatedWith(Neo4j.class).toInstance(properties);
} else {
bind(Properties.class).annotatedWith(Neo4j.class).toProvider(Providers.of(null));
}
bind(Neo4jPersistService.class).in(Singleton.class);
bind(PersistService.class).to(Neo4jPersistService.class);
bind(UnitOfWork.class).to(Neo4jPersistService.class);
bind(Session.class).toProvider(Neo4jPersistService.class);
transactionInterceptor = new Neo4jLocalTxnInterceptor();
requestInjection(transactionInterceptor);
}
示例3: customNeo4jOperations
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
@Test
public void customNeo4jOperations() {
load(CustomNeo4jOperations.class);
assertThat(this.context.getBean(Neo4jOperations.class))
.isSameAs(this.context.getBean("myNeo4jOperations"));
assertThat(this.context.getBeansOfType(org.neo4j.ogm.config.Configuration.class))
.hasSize(0);
assertThat(this.context.getBeansOfType(SessionFactory.class)).hasSize(0);
assertThat(this.context.getBeansOfType(Session.class)).hasSize(0);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:Neo4jDataAutoConfigurationTests.java
示例4: InventoryServiceV1
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
@Autowired
public InventoryServiceV1(InventoryRepository inventoryRepository,
ProductRepository productRepository, Session neo4jTemplate) {
this.inventoryRepository = inventoryRepository;
this.productRepository = productRepository;
this.neo4jTemplate = neo4jTemplate;
}
示例5: load
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
public <T> T load(Class<T> targetClass, Long id) {
final Session session = getSession();
try {
return session.load(targetClass, id);
} finally {
closeSession(session);
}
}
示例6: loadAll
import org.neo4j.ogm.session.Session; //导入依赖的package包/类
public <T> Collection<T> loadAll(Class<T> targetClass, Collection<Long> ids) {
final Session session = getSession();
try {
return session.loadAll(targetClass, ids);
} finally {
closeSession(session);
}
}