当前位置: 首页>>代码示例>>Java>>正文


Java Session类代码示例

本文整理汇总了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;
}
 
开发者ID:mangrish,项目名称:guice-persist-neo4j,代码行数:20,代码来源:Neo4jPersistService.java

示例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);
}
 
开发者ID:mangrish,项目名称:guice-persist-neo4j,代码行数:18,代码来源:Neo4jPersistModule.java

示例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;
}
 
开发者ID:kbastani,项目名称:spring-cloud-event-sourcing-example,代码行数:8,代码来源:InventoryServiceV1.java

示例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);
    }
}
 
开发者ID:landawn,项目名称:AbacusUtil,代码行数:10,代码来源:Neo4jExecutor.java

示例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);
    }
}
 
开发者ID:landawn,项目名称:AbacusUtil,代码行数:10,代码来源:Neo4jExecutor.java


注:本文中的org.neo4j.ogm.session.Session类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。