hibernate search自动创建索引

hibernate search自动创建索引,第1张

hibernate search默认采用自动创建索引

只要在entity上配置上@Indexed注解,在插入数据时hibernate就自动的索引数据

实际上是可以配置成手动索引的

配置如下

<prop key="hibernate.search.indexing_strategy">manual</prop>

<prop key="hibernate.search.indexing_strategy">manual</prop>

hibernate默认是event

既然你都ID都是NOT NULL和UNIQUE,不然直接创建成主键,这样会自动创建索引,应该是以PK开头的一个默认索引

CREATE TABLE [Test3](

角色ID int PRIMARY KEY,

编号 int not null,

)

另外索引似乎只能另外写CREATE语句创建,没办法像NOT NULL这种方式指定

最简单的就是使用基于 eclipse的 STS,里面有自带spring项目的向导,可以勾选上 spring web与hibernate,自然就是 spring Mvc + spring framework + Hibernate了~!,而且还可以是 spring-boot的微服务方式项目哦,连web容器都不用


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11346852.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-15
下一篇2023-05-15

发表评论

登录后才能评论

评论列表(0条)

    保存