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


Java FullTextEntityManager.flush方法代码示例

本文整理汇总了Java中org.hibernate.search.jpa.FullTextEntityManager.flush方法的典型用法代码示例。如果您正苦于以下问题:Java FullTextEntityManager.flush方法的具体用法?Java FullTextEntityManager.flush怎么用?Java FullTextEntityManager.flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.search.jpa.FullTextEntityManager的用法示例。


在下文中一共展示了FullTextEntityManager.flush方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
    final String testValue = "test";

    assertThat(entityWithFullTextRepository.findCount(findByValue(testValue))).isEqualTo(0);

    EntityWithFullText entityWithFullText = new EntityWithFullText();
    entityWithFullText.setValue(testValue);
    entityWithFullText = entityWithFullTextRepository.save(entityWithFullText);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithFullText);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithFullTextRepository.find(findByValue(testValue))).containsExactly(entityWithFullText);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:18,代码来源:EntityWithFullTextRepositoryIT.java

示例2: test

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
    final String testValue = "test";

    assertThat(entityWithMultipleFullTextRepository.findCount(findByValue(testValue))).isEqualTo(0);

    EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
    entityWithMultipleFullText.setValue1(testValue);
    entityWithMultipleFullText.setValue2("abcdef");
    entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithMultipleFullText);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithMultipleFullTextRepository.find(findByValue(testValue))).containsExactly(entityWithMultipleFullText);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:19,代码来源:EntityWithMultipleFullTextRepositoryIT.java

示例3: deep_test

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void deep_test() {
    final String testValue = "test";

    assertThat(entityWithMultipleFullTextRepository.findCount(findByDeepValue(testValue))).isEqualTo(0);

    EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
    entityWithMultipleFullText.setValue1("abcdef");
    EntityWithFullText entityWithFullText = new EntityWithFullText();
    entityWithFullText.setValue(testValue);
    entityWithMultipleFullText.setEntityWithFullText(entityWithFullText);
    entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithMultipleFullText);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithMultipleFullTextRepository.find(findByDeepValue(testValue))).containsExactly(entityWithMultipleFullText);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:21,代码来源:EntityWithMultipleFullTextRepositoryIT.java

示例4: test

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
    final Integer testValue = 1995;

    assertThat(entityWithFullTextIntegerRepository.findCount(findByValue(testValue))).isEqualTo(0);

    EntityWithFullTextInteger entityWithFullTextInteger = new EntityWithFullTextInteger();
    entityWithFullTextInteger.setValue(testValue);
    entityWithFullTextInteger = entityWithFullTextIntegerRepository.save(entityWithFullTextInteger);
    EntityWithFullTextInteger another = new EntityWithFullTextInteger();
    another.setValue(1994);
    entityWithFullTextIntegerRepository.save(another);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithFullTextInteger);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithFullTextIntegerRepository.find(findByValue(testValue))).containsExactly(entityWithFullTextInteger);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:21,代码来源:EntityWithFullTextIntegerRepositoryIT.java

示例5: test_similarity

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test_similarity() {
    assertThat(entityWithFullTextRepository.findCount(findByValueWithSimilarity("tast"))).isEqualTo(0);

    EntityWithFullText entityWithFullText = new EntityWithFullText();
    entityWithFullText.setValue("test");
    entityWithFullText = entityWithFullTextRepository.save(entityWithFullText);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithFullText);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithFullTextRepository.find(findByValueWithSimilarity("tast"))).containsExactly(entityWithFullText);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:16,代码来源:EntityWithFullTextRepositoryIT.java

示例6: testAnd

import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void testAnd() {
    final String testValue1 = "abc";
    final String testValue2 = "def";

    assertThat(entityWithMultipleFullTextRepository.findCount(findByValue(testValue1, testValue2))).isEqualTo(0);

    EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
    entityWithMultipleFullText.setValue1(testValue1);
    entityWithMultipleFullText.setValue2(testValue2);
    entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);

    EntityWithMultipleFullText entityWithMultipleFullText2 = new EntityWithMultipleFullText();
    entityWithMultipleFullText2.setValue1(testValue1);
    entityWithMultipleFullText2.setValue2("toto");
    entityWithMultipleFullText2 = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText2);

    EntityWithMultipleFullText entityWithMultipleFullText3 = new EntityWithMultipleFullText();
    entityWithMultipleFullText3.setValue1("toto");
    entityWithMultipleFullText3.setValue2(testValue2);
    entityWithMultipleFullText3 = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText3);

    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
    fullTextEntityManager.index(entityWithMultipleFullText);
    fullTextEntityManager.index(entityWithMultipleFullText2);
    fullTextEntityManager.index(entityWithMultipleFullText3);
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.flush();

    assertThat(entityWithMultipleFullTextRepository.find(findByValue(testValue1, testValue2))).containsExactly(entityWithMultipleFullText);
}
 
开发者ID:jpasearch,项目名称:jpasearch,代码行数:32,代码来源:EntityWithMultipleFullTextRepositoryIT.java


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