SpringDataJpa源码分析
我们在定义
Repository的时候通常定义的时一个接口,而并没有去实现这个接口,那么Jpa是如何让开发者无需自己实现接口就可以使用Repository去操作数据库?
动态代理!!!
Repository原理
试想一下JPA是如何做的?
- 通过动态代理将接口实例化成对应的类。
- 解析方法名或根据指定的方法名
- 并根据得到的结果转换为数据库操作
尝试写一个示例
- 自定义一个
Repository
public interface CustomRepository<T, ID> extends Repository<T, ID> {/*** 查询前num条数据* @param num* @return*/List<T> findByFirst(Long num);
}
- 对自定义
Repository的代理逻辑
/*** @author yuanmengfan(mf.yuan @ qq.com) on 2024/8/7 23:26* 自定义Repository的代理*/
@Data
public class CustomRepositoryInvocationHandler implements InvocationHandler {// 用于操作数据库private EntityManager em;// 知晓操作那个对象private Class<?> entityClass;public CustomRepositoryInvocationHandler(EntityManager em, Class<?> entityClass) {this.em = em;this.entityClass = entityClass;}@Overridepublic Object invoke(Object proxy, Method method, Object[] args) {Object result = null;String name = method.getName();switch (name) {// 根据方法名定义不同操作数据库的逻辑case "findByFirst":CriteriaBuilder cn = em.getCriteriaBuilder();CriteriaQuery query = cn.createQuery(entityClass);Root from = query.from(entityClass);result = em.createQuery(query.select(from)).setMaxResults(Math.toIntExact((Long) args[0])).getResultList();break;}return result;}
}
- 测试下创建出来的代理对象是否能正常运行
@Testpublic void test() {// 初始化IOC容器AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(JpaConfig.class);LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean = applicationContext.getBean(LocalContainerEntityManagerFactoryBean.class);// 创建EntityManagerEntityManager em = localContainerEntityManagerFactoryBean.getNativeEntityManagerFactory().createEntityManager();Class<?> proxyClass = UserCustomRepository.class;// 获取接口泛型信息ParameterizedType parameterizedType = (ParameterizedType) proxyClass.getGenericInterfaces()[0];Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();Class entityClass = (Class) actualTypeArguments[0];Class idClass = (Class) actualTypeArguments[1];// 通过动态代理创建对象UserCustomRepository proxyInstance = (UserCustomRepository) Proxy.newProxyInstance(proxyClass.getClassLoader(), new Class[]{proxyClass}, new CustomRepositoryInvocationHandler(em, entityClass));System.out.println(proxyInstance.findByFirst(5L));}

已经可以根据我们指定的类型来操作数据库了。
源码跟踪验证
@Test
public void test(){// 初始化IOC容器AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(JpaConfig.class);UserJpaRepository bean = applicationContext.getBean(UserJpaRepository.class);Optional<TUser> byId = bean.findById(5L);
}
能发现这里在IOC容器中的是代理对象。

可以明显的看出这里是使用的JDK动态代理。

这里可以看见实际上我们的对象是SimpleJpaRepository

实际调用findById也是通过EntityManage去操作数据库

Spring是如何整合Jpa呢?
疑问
怎么知道要注册那些Repository?
@ComponentScan+@Component
// 添加
@ComponentScan(basePackages = "com.mfyuan")
public class JpaConfig{}// 添加
@Component
public interface UserCustomRepository extends CustomRepository<TUser, Long> {}@Test
public void test1() {// 初始化IOC容器AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(JpaConfig.class);// 尝试从容器中获取BeanUserCustomRepository bean = applicationContext.getBean(UserCustomRepository.class);
}

为什么还是拿不到这个Bean呢?
因为Repository是接口不是类,不会被注册到IOC容器中。在扫描成BeanDefinition是被过滤掉了。
ConfigurationClassParser#doProcessConfigurationClass
ComponentScanAnnotationParser#parse 处理@Component的解析
ClassPathBeanDefinitionScanner#doScan
#findCandidateComponents
#scanCandidateComponents
#isCandidateComponent(metadataReader) 判断是否包含@Component注解

#isCandidateComponent(sbd) 判断是否为接口或者抽象类

:::
如何解决不扫描接口的问题呢?
ClassPathBeanDefinitionScanner:自定义一个扫描器(让接口也可以别扫描到)。BeanDefinitionRegistryPostProcessor:在BeanDefinition注册的过程中可以允许进干预。
:::
public class CustomClassPathBeanDefinitionScanner extends ClassPathBeanDefinitionScanner {public CustomClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry) {super(registry);// 添加过滤器只扫描实现CustomRepository接口的类}/*** 允许接口被扫描** @param beanDefinition the bean definition to check* @return*/@Overrideprotected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {AnnotationMetadata metadata = beanDefinition.getMetadata();return metadata.isInterface();}
}
@Component
public class CustomBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor {@Overridepublic void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {CustomClassPathBeanDefinitionScanner definitionScanner = new CustomClassPathBeanDefinitionScanner(registry);// 清空原有filter definitionScanner.resetFilters(false);// 添加过滤器只扫描实现CustomRepository接口的类definitionScanner.addIncludeFilter(new AssignableTypeFilter(CustomRepository.class));// 能将 com.mfyuan.repository 下的接口也进行注册了definitionScanner.scan("com.mfyuan.repository");}@Overridepublic void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {BeanDefinitionRegistryPostProcessor.super.postProcessBeanFactory(beanFactory);}
}
到现在我们的接口就可以被扫描成BeanDefinition,但是又遇到一个问题?

与之前的错误不同的是已经不再提前找不到对应类型的Bean了,而是接口不能实例化的。
:::
如何将对应的Repository接口注入到容器中?
可以将通过动态代理后的对象放入到容器中,这里就解决了接口不能实例化的问题。
但是不可能一个一个去创建动态代理的对象吧,这样想想就很痛苦。
使用FactoryBean来定义创建过程。与前面Repository原理结合。
:::
@Data
public class CustomRepositoryFactoryBean implements FactoryBean {private Class<?> repositoryInterface;@Autowiredprivate LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean;public CustomRepositoryFactoryBean(Class<?> repositoryInterface) {this.repositoryInterface = repositoryInterface;}/*** FactoryBean的特性这个方法的返回值是注册到容器中对象*/@Overridepublic Object getObject() {// 创建EntityManagerEntityManager em = localContainerEntityManagerFactoryBean.getNativeEntityManagerFactory().createEntityManager();// 获取接口泛型信息ParameterizedType parameterizedType = (ParameterizedType) repositoryInterface.getGenericInterfaces()[0];Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();Class<?> entityClass = (Class<?>) actualTypeArguments[0];// Class idClass = (Class) actualTypeArguments[1];// 通过动态代理创建对象return Proxy.newProxyInstance(repositoryInterface.getClassLoader(), new Class[]{repositoryInterface}, new CustomRepositoryInvocationHandler(em, entityClass));}/*** FactoryBean的特性这个方法的返回值是注册到容器的对象类型*/@Overridepublic Class<?> getObjectType() {return repositoryInterface;}
}
重写CustomClassPathBeanDefinitionScanner#doScan 对扫描到的BeanDefinition进行修改
public class CustomClassPathBeanDefinitionScanner extends ClassPathBeanDefinitionScanner {// .....@SneakyThrows@Overrideprotected Set<BeanDefinitionHolder> doScan(String... basePackages) {// 这里拿到的就行自定义扫描器 扫出来的所有BeanDefinitionSet<BeanDefinitionHolder> beanDefinitionHolders = super.doScan(basePackages);for (BeanDefinitionHolder beanDefinitionHolder : beanDefinitionHolders) {ScannedGenericBeanDefinition beanDefinition = (ScannedGenericBeanDefinition) beanDefinitionHolder.getBeanDefinition();// 得到扫描到的repositoryClassString repositoryClassName = beanDefinition.getBeanClassName();// 设置BeanDefinition的Class为FactoryBean// mybatis 这里也是这样做的 只不过是新注册了一个BeanDefinitionbeanDefinition.setBeanClass(CustomRepositoryFactoryBean.class);// 添加一个构造参数beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(repositoryClassName);}return beanDefinitionHolders;}
}
测试
@Test
public void test1() {// 初始化IOC容器AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(JpaConfig.class);// 尝试从容器中获取BeanUserCustomRepository bean = applicationContext.getBean(UserCustomRepository.class);System.out.println(bean.findByFirst(5L));
}
能够走自定义Repository里面的方法了。
解释
CustomRepository:相当于一个顶层接口,他去定义对应的统一的数据库操作。类似JpaRepository,CrudRepository等
CustomRepositoryInvocationHandler:相当于是对顶层接口所有的方法进行了一个实现。类似SimpleJpaRepository
源码验证
// 导入JpaRepositoriesRegistrar
@Import(JpaRepositoriesRegistrar.class)
public @interface EnableJpaRepositories {}// 实现了ImportBeanDefinitionRegistrar就代表有动态注册BeanDefinition的能力
class JpaRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport {}public abstract class RepositoryBeanDefinitionRegistrarSupportimplements ImportBeanDefinitionRegistrar, ResourceLoaderAware, EnvironmentAware {@Overridepublic void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry,BeanNameGenerator generator) {// ...// 委托RepositoryConfigurationDelegate进行注册RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configurationSource, resourceLoader,environment);delegate.registerRepositoriesIn(registry, extension);}@Overridepublic Streamable<BeanDefinition> getCandidates(ResourceLoader loader) {// 定义的扫描器RepositoryComponentProvider scanner = new RepositoryComponentProvider(getIncludeFilters(), registry);scanner.setConsiderNestedRepositoryInterfaces(shouldConsiderNestedRepositories());scanner.setEnvironment(environment);scanner.setResourceLoader(loader);getExcludeFilters().forEach(scanner::addExcludeFilter);// 查找满足条件的组件return Streamable.of(() -> getBasePackages().stream()//.flatMap(it -> scanner.findCandidateComponents(it).stream()));}
}public class RepositoryConfigurationDelegate {// ...public List<BeanComponentDefinition> registerRepositoriesIn(BeanDefinitionRegistry registry,RepositoryConfigurationExtension extension) {Collection<RepositoryConfiguration<RepositoryConfigurationSource>> configurations = extension.getRepositoryConfigurations(configurationSource, resourceLoader, inMultiStoreMode);}
}public abstract class RepositoryConfigurationExtensionSupport implements RepositoryConfigurationExtension {public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(T configSource, ResourceLoader loader, boolean strictMatchesOnly) {// ...// 调用RepositoryBeanDefinitionRegistrarSupport.getCandidates 获得合适的对象for (BeanDefinition candidate : configSource.getCandidates(loader)) {}// ...}
}class RepositoryComponentProvider extends ClassPathScanningCandidateComponentProvider {public RepositoryComponentProvider(Iterable<? extends TypeFilter> includeFilters, BeanDefinitionRegistry registry) {// ....if (includeFilters.iterator().hasNext()) {for (TypeFilter filter : includeFilters) {addIncludeFilter(filter);}} else {// 添加 是Repository接口的类super.addIncludeFilter(new InterfaceTypeFilter(Repository.class));// 添加定义了RepositoryDefinition注解的类super.addIncludeFilter(new AnnotationTypeFilter(RepositoryDefinition.class, true, true));}// 排除带有NoRepositoryBean注解的类addExcludeFilter(new AnnotationTypeFilter(NoRepositoryBean.class));}@Overridepublic Set<BeanDefinition> findCandidateComponents(String basePackage) {// 这里就走到的Spring的findCandidateComponents 里面// 关键的两个方法则是isCandidateComponent(metadataReader) 与 isCandidateComponent(sbd)Set<BeanDefinition> candidates = super.findCandidateComponents(basePackage);// ...}// 这样的话就能将Repository接口及@RepositoryDefinition扫描成BeanDefinition了protected boolean isCandidateComponent(MetadataReader metadataReader) throws IOException {for (TypeFilter tf : this.excludeFilters) {if (tf.match(metadataReader, getMetadataReaderFactory())) {return false;}}for (TypeFilter tf : this.includeFilters) {if (tf.match(metadataReader, getMetadataReaderFactory())) {return isConditionMatch(metadataReader);}}return false;}@Overrideprotected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {boolean isNonRepositoryInterface = !ClassUtils.isGenericRepositoryInterface(beanDefinition.getBeanClassName());boolean isTopLevelType = !beanDefinition.getMetadata().hasEnclosingClass();boolean isConsiderNestedRepositories = isConsiderNestedRepositoryInterfaces();return isNonRepositoryInterface && (isTopLevelType || isConsiderNestedRepositories);}
}public abstract class RepositoryFactoryBeanSupport<T extends Repository<S, ID>, S, ID>implements InitializingBean, RepositoryFactoryInformation<S, ID>, FactoryBean<T>, BeanClassLoaderAware,BeanFactoryAware, ApplicationEventPublisherAware {public void afterPropertiesSet() {// ...// 传入repositoryInterface来得到代理对象this.repository = Lazy.of(() -> this.factory.getRepository(repositoryInterface, repositoryFragmentsToUse));// ...}
}public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, BeanFactoryAware {public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fragments) {// ...// 这里就是最终创建代理对象的地方,会判断是JDK动态代理还是CGLIB代理T repository = (T) result.getProxy(classLoader);// ...return repository;}
}

@EnableJpaRepositories(basePackages = "com.mfyuan.repository")@Import(JpaRepositoriesRegistrar.class)JpaRepositoriesRegistrar实现ImportBeanDefinitionRegistrar拥有动态注册的能力与BeanDefinitionRegistryPostProcessor一样- 自定义扫描器
RepositoryComponentProvide添加扫描Repository口及RepositoryDefinition注解的includeFilter及NoRepositoryBean注解的excludeFilter - 将扫描成功的获选Bean的信息创建成
BeanDefinition并修改它的BeanClassName(实际是JpaRepositoryFactoryBean) JpaRepositoryFactoryBean是一个BeanFactory,会为我们创建出一个动态代理的对象并放入到IOC容器中。
相关文章:
SpringDataJpa源码分析
我们在定义Repository的时候通常定义的时一个接口,而并没有去实现这个接口,那么Jpa是如何让开发者无需自己实现接口就可以使用Repository去操作数据库? 动态代理!!! Repository原理 试想一下JPA是如何做的…...
卷积神经网络 - 卷积神经网络与深度学习的历史篇
序言 卷积神经网络( Convolutional Neural Networks, CNN \text{Convolutional Neural Networks, CNN} Convolutional Neural Networks, CNN)与深度学习作为人工智能领域的两大重要分支,其发展历程充满了探索与突破。深度学习,作…...
初识 Floodfall 算法
文章目录 **一、Floodfall 算法的概述****二、深度优先搜索(DFS)和广度优先搜索(BFS)在 Floodfall 算法中的应用****三、算法的基本原理****四、应用场景** 一、Floodfall 算法的概述 Floodfall 算法通常用于解决与区域填充、图的…...
[Linux] LVM挂载的硬盘重启就掉的问题解决
问题:系统重启后挂在逻辑卷的盘会掉(必现) 环境:SUSE Linux 11 SP4 原因:boot.lvm是关闭的 解决:boot.lvm设置开启 参考资料: linux下lvm状态Not avaliable问题排查及处理(常见Suse操作系统…...
YOLOv8改进 | 主干网络 | 用EfficientNet卷积替换backbone【教程+代码 】
秋招面试专栏推荐 :深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 💡💡💡本专栏所有程序均经过测试,可成功执行💡💡💡 专栏目录 :《YOLOv8改进有效涨点》专栏介绍 & 专栏目录 | 目前已有80+篇内容,内含各种Head检测头、损失函数Loss、…...
数据库规范化设计 5大基本原则
规范化设计原则是数据库设计的基本原则,有助于减少数据冗余,提高数据一致性和完整性,简化数据管理,增强数据安全性,对整个开发项目至关重要。而缺乏规范化设计会导致数据冗余,增加存储成本,引发…...
【nginx】解决k8s中部署nginx转发不会自动更新域名解析启动失败的问题
文章目录 1. 问题2.解决办法3.扩展说明3.1 DNS解析阶段划分3.2 问题说明3.2.1 先看/etc/resolv.conf说明3.2.2 针对第一个问题3.2.3 针对第二个问题 【后端】NginxluaOpenResty高性能实践 参考: https://blog.csdn.net/u010837612/article/details/123275026 1. 问…...
LeetCode637 二叉树的层平均值
前言 题目: 637. 二叉树的层平均值 文档: 代码随想录——二叉树的层平均值 编程语言: C 解题状态: 求取平均值的时候出现了点问题 思路 C中,浮点数的相加会产生精度误差,求取平均值时最好只在最后一步进行…...
王学岗ASM
服务发现 package com.example.testasm;import android.content.Context; import android.os.Bundle;import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat;…...
【数据结构】—— 队列
1、队列的概念2、队列的结构如何选择合适的数据结构实现队列(数组or链表) 3、队列的链式存储3.1 队列的链式存储结构3.2 队列的常见接口3.3 队列的接口实现初始化判空入队列出队列获取队头元素获取队尾元素获取节点个数销毁 3.4 源代码 4、队列的顺序存储…...
vue中openlayers过滤高亮显示某个图层
vue中openlayers过滤高亮显示某个图层 openlayers库没有直接支持这样设置,所以可以使用库:ol-ext,地址:https://viglino.github.io/ol-ext/examples/filter/map.filter.crop.html 效果: 关键代码: /**…...
WPF篇(11)-ToolTip控件(提示工具)+Popup弹出窗口
ToolTip控件 ToolTip控件继承于ContentControl,它不能有逻辑或视觉父级,意思是说它不能以控件的形式实例化,它必须依附于某个控件。因为它的功能被设计成提示信息,当鼠标移动到某个控件上方时,悬停一会儿,…...
【mysql 第一篇章】系统和数据库的交互方法
一、宏观的查看系统怎么和数据库交互 在我们刚刚接触系统和数据库的时候不明白其中的原理,只知道系统和数据库是需要交互的。所以我们会理解成上图的形式。 二、MYSQL 驱动 随着我们的学习时间的加长以及对程序的了解,发现链接数据库是需要有别的工具辅…...
数据结构-位运算总结
位运算总结: 1.求位1的个数 191. 位1的个数 - 力扣(LeetCode) 有两种写法: 1.是把该数不断的去与0x1相与,得到该数的最后一位的值,然后判断他是不是1,再把该数更新一下整体往后移动一位也就…...
java 异常堆栈的由来
编写的程序代码内部错误产生的异常,如调用对象为空(空指针异常)、数组越界异常、除0异常等。这种通常称为未检查的异常(Runtime异常子类),在虚拟机中执行时会集中处理这些异常。其他运行中异常,通过throw语句主动抛出的…...
【推荐系统】【多任务学习】Progressive Layered Extraction (PLE)
Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations 文章目录 Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations1 论文出处2 背景2.1 背景介…...
java -转win32/win64免安装jre环境运行
由于java 转为exe,只能在装有JDK环境的电脑运行, 发给其他人也不能运行,缺少环境,程序自己背着jre走 1.先打好jar 包 2.使用exe4j 把jar包转成exe 运行程序 3.使用inno stup ,把exe运行程序加上jre环境 以下是具体实现…...
算法板子:容斥原理——求出 1∼n 中能被质数 p1,p2,…,pm 中的至少一个数整除的整数有多少个
1. 题目要点 1. 设:求1~10中能被质数2和3中至少一个数整除的数有多少个。1~10中能被质数2整除的数的集合记为S1{2,4,6,8,10},能被质数3整除的数的集合记为S2{3,6,9},能同时被质数2和3整数的数的集合为S1∩S2{6} 2. 这道题的目的是求S1∪S2∪S…...
用gurobipy求解带不等式约束条件的优化问题
1. 引入 在当今的数据驱动世界中,优化问题无处不在,从工程设计到经济模型,再到机器学习算法的调参,优化都是实现效率最大化、成本最小化或性能最优化的关键工具。 这里有一个典型的数学优化问题,目标是在给定的约束条…...
漏洞复现-Adobe ColdFusion 远程代码执行漏洞(CVE-2023-38203)
1.漏洞描述 Adobe ColdFusion是一种服务器端的Web应用开发平台。它由Adobe Systems开发,用于创建动态的、交互式的Web应用程序和网站。 Adobe ColdFusion在2018u17及之前版本、2021u7及之前版本和2023u1及之前版本中存在任意代码执行漏洞。该漏洞是由于反序列化不…...
《Playwright:微软的自动化测试工具详解》
Playwright 简介:声明内容来自网络,将内容拼接整理出来的文档 Playwright 是微软开发的自动化测试工具,支持 Chrome、Firefox、Safari 等主流浏览器,提供多语言 API(Python、JavaScript、Java、.NET)。它的特点包括&a…...
解决本地部署 SmolVLM2 大语言模型运行 flash-attn 报错
出现的问题 安装 flash-attn 会一直卡在 build 那一步或者运行报错 解决办法 是因为你安装的 flash-attn 版本没有对应上,所以报错,到 https://github.com/Dao-AILab/flash-attention/releases 下载对应版本,cu、torch、cp 的版本一定要对…...
Reasoning over Uncertain Text by Generative Large Language Models
https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...
以光量子为例,详解量子获取方式
光量子技术获取量子比特可在室温下进行。该方式有望通过与名为硅光子学(silicon photonics)的光波导(optical waveguide)芯片制造技术和光纤等光通信技术相结合来实现量子计算机。量子力学中,光既是波又是粒子。光子本…...
C语言中提供的第三方库之哈希表实现
一. 简介 前面一篇文章简单学习了C语言中第三方库(uthash库)提供对哈希表的操作,文章如下: C语言中提供的第三方库uthash常用接口-CSDN博客 本文简单学习一下第三方库 uthash库对哈希表的操作。 二. uthash库哈希表操作示例 u…...
tomcat指定使用的jdk版本
说明 有时候需要对tomcat配置指定的jdk版本号,此时,我们可以通过以下方式进行配置 设置方式 找到tomcat的bin目录中的setclasspath.bat。如果是linux系统则是setclasspath.sh set JAVA_HOMEC:\Program Files\Java\jdk8 set JRE_HOMEC:\Program Files…...
论文阅读:Matting by Generation
今天介绍一篇关于 matting 抠图的文章,抠图也算是计算机视觉里面非常经典的一个任务了。从早期的经典算法到如今的深度学习算法,已经有很多的工作和这个任务相关。这两年 diffusion 模型很火,大家又开始用 diffusion 模型做各种 CV 任务了&am…...
Unity VR/MR开发-VR开发与传统3D开发的差异
视频讲解链接:【XR马斯维】VR/MR开发与传统3D开发的差异【UnityVR/MR开发教程--入门】_哔哩哔哩_bilibili...
前端调试HTTP状态码
1xx(信息类状态码) 这类状态码表示临时响应,需要客户端继续处理请求。 100 Continue 服务器已收到请求的初始部分,客户端应继续发送剩余部分。 2xx(成功类状态码) 表示请求已成功被服务器接收、理解并处…...
ArcGIS Pro+ArcGIS给你的地图加上北回归线!
今天来看ArcGIS Pro和ArcGIS中如何给制作的中国地图或者其他大范围地图加上北回归线。 我们将在ArcGIS Pro和ArcGIS中一同介绍。 1 ArcGIS Pro中设置北回归线 1、在ArcGIS Pro中初步设置好经纬格网等,设置经线、纬线都以10间隔显示。 2、需要插入背会归线…...
