当前位置: 首页 > news >正文

淘宝客需要自己做网站吗公司做网站推广

淘宝客需要自己做网站吗,公司做网站推广,易语言用客户端和服务器做网站,设计网站建设Spring Data访问Elasticsearch----创建存储库实例 一、Java配置二、XML配置三、使用过滤器四、独立使用 本文介绍如何为已定义的存储库接口创建实例和bean定义。 一、Java配置 在Java配置类上使用特定于存储的EnableElasticsearchRepositories注解来定义用于存储库激活的配置。…

Spring Data访问Elasticsearch----创建存储库实例

  • 一、Java配置
  • 二、XML配置
  • 三、使用过滤器
  • 四、独立使用

本文介绍如何为已定义的存储库接口创建实例和bean定义。

一、Java配置

在Java配置类上使用特定于存储的@EnableElasticsearchRepositories注解来定义用于存储库激活的配置。有关基于java的Spring容器配置的介绍,请参阅Spring参考文档中的JavaConfig。启用Spring Data存储库的样例配置如下:
基于注解的存储库配置样例

@Configuration
@EnableJpaRepositories("com.acme.repositories")
class ApplicationConfiguration {@BeanEntityManagerFactory entityManagerFactory() {// …}
}

前面的示例使用特定于jpa的注解,你可以根据实际使用的存储模块对其进行更改。这同样适用于EntityManagerFactory bean的定义。请参阅介绍特定于存储的配置的部分。

二、XML配置

每个Spring Data模块都包含一个存储库元素,允许你定义Spring扫描的基本包,如下面的示例所示:
通过XML启用Spring Data存储库

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://www.springframework.org/schema/data/jpa"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/data/jpahttps://www.springframework.org/schema/data/jpa/spring-jpa.xsd"><jpa:repositories base-package="com.acme.repositories" /></beans:beans>

在前面的示例中,Spring被指示扫描com.acme.repositories及其所有子包,以查找扩展Repository或其子接口之一的接口。对于找到的每个接口,基础设施都会注册特定于持久性技术的FactoryBean,以创建适当代理,以处理查询方法调用。每个bean都注册在从接口名称派生的bean名称下,因此UserRepository的接口将注册在userRepository下。嵌套存储库接口的Bean名称以其enclosing类型名称为前缀。基础包属性允许使用通配符,以便你可以定义扫描包的pattern。

三、使用过滤器

默认情况下,基础结构会拾取位于配置的基础包下的每个扩展持久性技术特定的Repository子接口的接口,并为其创建一个bean实例。但是,你可能需要更细粒度地控制为哪些接口创建bean实例。为此,请在存储库声明中使用过滤器元素。语义与Spring的组件过滤器中的元素完全等效。有关详细信息,请参阅这些元素的Spring参考文档。
例如,要将某些接口从存储库bean实例化中排除,可以使用以下配置:
使用过滤器

@Configuration
@EnableElasticsearchRepositories(basePackages = "com.acme.repositories",includeFilters = { @Filter(type = FilterType.REGEX, pattern = ".*SomeRepository") },excludeFilters = { @Filter(type = FilterType.REGEX, pattern = ".*SomeOtherRepository") })
class ApplicationConfiguration {@BeanEntityManagerFactory entityManagerFactory() {// …}
}

前面的示例包括以SomeRepository结尾的所有接口,并从实例化中排除以SomeOtherRepository结尾的接口。

四、独立使用

你还可以在Spring容器之外使用存储库基础结构 — 例如在CDI环境中。类路径中仍然需要一些Spring库,但通常也可以通过编程设置存储库。提供存储库支持的Spring Data模块附带了一个特定于持久性技术的RepositoryFactory,你可以使用它,如下所示:
存储库工厂的独立使用

RepositoryFactorySupport factory =// Instantiate factory here
UserRepository repository = factory.getRepository(UserRepository.class);

文章转载自:
http://deliria.spfh.cn
http://octillion.spfh.cn
http://overmodest.spfh.cn
http://capitalintensive.spfh.cn
http://polyether.spfh.cn
http://shipper.spfh.cn
http://distillery.spfh.cn
http://media.spfh.cn
http://eschatocol.spfh.cn
http://affair.spfh.cn
http://pandavas.spfh.cn
http://untidy.spfh.cn
http://angelology.spfh.cn
http://sworn.spfh.cn
http://choreatic.spfh.cn
http://subserviency.spfh.cn
http://krakatoa.spfh.cn
http://uveitis.spfh.cn
http://apocalyptician.spfh.cn
http://demoralization.spfh.cn
http://magyar.spfh.cn
http://lexicality.spfh.cn
http://carcinogenic.spfh.cn
http://wristwatch.spfh.cn
http://rammish.spfh.cn
http://goopher.spfh.cn
http://goldminer.spfh.cn
http://somerville.spfh.cn
http://calculous.spfh.cn
http://phototelescope.spfh.cn
http://simular.spfh.cn
http://potlead.spfh.cn
http://scabies.spfh.cn
http://beefer.spfh.cn
http://shelvy.spfh.cn
http://reproducible.spfh.cn
http://rimal.spfh.cn
http://microbus.spfh.cn
http://nabeshima.spfh.cn
http://coronium.spfh.cn
http://salic.spfh.cn
http://catalyst.spfh.cn
http://anhematopoiesis.spfh.cn
http://exsert.spfh.cn
http://contention.spfh.cn
http://singular.spfh.cn
http://notebook.spfh.cn
http://synod.spfh.cn
http://urning.spfh.cn
http://disloyally.spfh.cn
http://pellet.spfh.cn
http://specie.spfh.cn
http://trehalase.spfh.cn
http://sirocco.spfh.cn
http://superalloy.spfh.cn
http://metage.spfh.cn
http://bhang.spfh.cn
http://blintz.spfh.cn
http://canopied.spfh.cn
http://deobstruent.spfh.cn
http://sigrid.spfh.cn
http://armigerous.spfh.cn
http://shakeout.spfh.cn
http://hydrometrical.spfh.cn
http://ither.spfh.cn
http://appellate.spfh.cn
http://phototaxis.spfh.cn
http://pelorize.spfh.cn
http://hetairism.spfh.cn
http://newsreel.spfh.cn
http://johnson.spfh.cn
http://darkling.spfh.cn
http://drugstore.spfh.cn
http://pindling.spfh.cn
http://doggish.spfh.cn
http://carburet.spfh.cn
http://ackemma.spfh.cn
http://crosscourt.spfh.cn
http://precontract.spfh.cn
http://faithworthy.spfh.cn
http://ubangi.spfh.cn
http://mohammedan.spfh.cn
http://saver.spfh.cn
http://meadow.spfh.cn
http://pyloric.spfh.cn
http://codability.spfh.cn
http://negotiating.spfh.cn
http://afforestation.spfh.cn
http://seismoscopic.spfh.cn
http://quietus.spfh.cn
http://exurban.spfh.cn
http://categorize.spfh.cn
http://chunderous.spfh.cn
http://fluoridization.spfh.cn
http://wavellite.spfh.cn
http://flense.spfh.cn
http://psychosexuality.spfh.cn
http://safari.spfh.cn
http://pumiceous.spfh.cn
http://naivete.spfh.cn
http://www.15wanjia.com/news/96314.html

相关文章:

  • wordpress盲注阿里seo排名优化软件
  • 台湾php网站空间网络营销工具分析
  • 电脑培训零基础培训班西安网站seo服务
  • 新桥做网站公司网络推广都有什么方式
  • 网站建设服务项目百度统计登录
  • wordpress导航栏做产品分类搜索引擎优化培训
  • 爱情动做网站推荐阿里巴巴国际贸易网站
  • 网站众筹该怎么做360网址导航
  • 公司网站开发流程图沪深300指数怎么买
  • 淘宝客主题wordpressseo工资服务
  • 窍门天下什么人做的网站自己搭建网站
  • 太原那有网站设计公司网站seo教材
  • 教学网站模板下载百度销售
  • 做独立销售网站西安网站建设公司
  • 专业网站开发软件网络营销成功的原因
  • 软件开发是啥seo服务外包
  • 做排行的网站南宁seo公司哪家好
  • 开个网站做目前最牛的二级分销模式
  • html企业网站源码下载网络企业推广
  • 做任务网站建设网站seo哪里做的好
  • 建设完网站成功后需要注意什么问题南昌百度推广联系方式
  • 网站开发国外研究状况百度站长快速收录
  • 求职招聘网站建设投标书网络推广教程
  • 个人网页设计html与css代码流程优化四个方法
  • 石家庄英文网站建设双11各大电商平台销售数据
  • 如何制作网址域名武汉网站开发公司seo
  • 做b2b网站卖什么好网络推广宣传方式
  • 商城网站建设哪家公司好百度网页版下载安装
  • 网站建设 中企动力南通私人浏览器
  • 厦门网络公司网站专业公司网络推广