如何为无穷大的pojos 13实现索引的编程定义?根据在线文档这里:代码没有改变。但是,hibernate-6中不再存在所引用的类,而hibernate-6是由无穷大的-13使用的。
请注意,不可能在pojo类上使用要索引的注释,因为它在其他地方被代码使用,这些代码不能依赖无穷大或hibernate等,所以我需要遵循以前在无穷大类-11中工作的编程路线。
这是当前在无穷大-11中工作的代码:
EmbeddedCacheManager cacheManager = new DefaultCacheManager(new GlobalConfigurationBuilder().jmx().build());
SearchMapping mapping = new SearchMapping();
mapping.entity(MyData.class).indexed().property("expiry", ElementType.FIELD).field();
Properties properties = new Properties();
properties.put(Environment.MODEL_MAPPING, mapping);
properties.put("hibernate.search.default.indexBase", "/some/path");
Configuration dcc = cacheManager.getDefaultCacheConfiguration();
ConfigurationBuilder b = new ConfigurationBuilder();
if (dcc != null)
b = b.read(dcc);
b.indexing().addIndexedEntity(MyData.class).withProperties(properties);发布于 2022-03-04 15:09:55
我还使用了Infinispan13.0.6。这种配置工作得很好。
这是我的配置:
ConfigurationBuilder builder = new ConfigurationBuilder();
Properties p = new Properties();
try(Reader r = new FileReader("/srv/ws-emporium/hotrod-client.properties")) {
p.load(r);
builder.withProperties(p);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
remoteCacheManager = new RemoteCacheManager(builder.build());
cache = remoteCacheManager.getCache("teste15Fev22");我的属性文件内容:
infinispan.client.hotrod.server_list = server1:11222;server2:11322
infinispan.client.hotrod.auth_username=admin
infinispan.client.hotrod.auth_password=password
infinispan.client.hotrod.connection_pool.max_active = 10
infinispan.client.hotrod.connection_pool.exhausted_action = WAIT
infinispan.client.hotrod.connection_pool.max_wait = 1
infinispan.client.hotrod.connection_pool.min_idle = 20
infinispan.client.hotrod.connection_pool.min_evictable_idle_time = 300000
infinispan.client.hotrod.connection_pool.max_pending_requests = 20
infinispan.client.hotrod.marshaller=org.infinispan.commons.marshall.JavaSerializationMarshaller
infinispan.client.hotrod.java_serial_allowlist=.*https://stackoverflow.com/questions/70887340
复制相似问题