*# 1.京淘架构设计原理图
2.京淘物理模型图
2.1需求描述
说明:做后端开发,对于表结构应该特别的熟悉。但是常规的数据库软件,不能做到非常直观的展现表与表的关联关系。导致程序员开发频繁的查询数据库字典(包含了项目中所有的表设计)
2.2 PowerDesinger(PD)
PowerDesigner最初由Xiao-Yun Wang(王晓昀)在SDP Technologies公司开发完成。PowerDesigner是Sybase的企业建模和设计解决方案,采用模型驱动方法,将业务与IT结合起来,可帮助部署有效的企业体系架构,并为研发生命周期管理提供强大的分析与设计技术。PowerDesigner独具匠心地将多种标准数据建模技术(UML、业务流程建模以及市场领先的数据建模)集成一体,并与 .NET、WorkSpace、PowerBuilder、Java™、Eclipse 等主流开发平台集成起来,从而为传统的软件开发周期管理提供业务分析和规范的数据库设计解决方案。此外,它支持60多种关系数据库管理系统(RDBMS)/版本。PowerDesigner运行在Microsoft Windows平台上,并提供了Eclipse插件。
总结:PD是数据库设计业务分析的一站式的解决方案.
2.2 PowerDesinger(PD)安装
1).PD安装包路径
2).PD安装路径
3).PD汉化说明
汉化完成之后,发送桌面快捷方式即可
2.3 PD使用
1).物理模型图创建
2).如果数据库类型选项不能正常展现,则按照如下操作进行
3).关于面板工具说明
2.4 新建第一张表
考虑要素:
1.表名
2.字段信息
3.字段类型
4.主键说明
5.主键自增
1).编辑表名
2).编辑字段
3).主键自增
双击主键字段行首.跳出右侧的操作
4).动态sql语句
2.5 常见表关系
业务说明: 数据表通过建立主外键的关联关系来实现业务的关联.
2.5.1 一对一
结构说明: 一对一核心依然是主外键关联(特殊). 双向一对一
场景说明: user表 用户信息------user_info表 用户详情信息
关联问题:
1. user表----->user_info表 一个用户对应一个用户详情信息.
2. user_info表------>user表 一个用户详情表对应一个用户
如果表结构满足上述的关系,则是 典型一对一
2.5.2 一对多
业务说明: 用户和部门
关联问题:
user表------部门表 一个用户(员工) -------一个部门 1对1
部门表------user表 一个部门-----------多个员工 1对多
- 1
- 2
- 3
- 4
2.5.3 多对多
说明: 多对多的实质就是双向一对多
业务场景:
权限表--------角色表
1个权限 ---------- 多个角色 1-多
1个角色--------------多个权限 1-多
表画法: 如果表设计出现了多对多,则一般都会有中间表参与.
2.6 京淘项目表结构设计
3.SpringBoot框架加强
3.1开发工具 STS/IDEA
3.1.1开发环境 JDK配置
1.检查JDK版本
2.JDK本地路径
3.删除多余的JDK配置
4.配置JDK
3.2 Maven环境配置
Maven 是一站式的项目管理工具. 负责管理项目的生命周期 创建/更新/维护/打包/部署
核心机制: 本地仓库 私服镜像 中央仓库
3.2.1 Maven配置
1).导入maven配置
2).导入settings文件
3).settings文件私服镜像配置
连接的阿里云的服务器仓库 <mirror> <id>aliyun</id> <name>aliyun for maven</name> <mirrorOf>*</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> </mirror>
<span class="token generics function"><span class="token punctuation"><</span>profile<span class="token punctuation">></span></span>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>
1.8
</maven.compiler.compilerVersion>
</properties>
</profile>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
4).settings文件私服镜像配置2(二选一)
连接的阿里云私服镜像服务器
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
3.3 修改STS配置
3.3.1 设定字符集编码
3.3.2 关闭校验
3.4 创建SpringBoot项目
3.4.1根据官方模板创建项目
3.4.2选择jar包文件
项目创建完成
3.5Maven工具高级用法
3.5.1 jar包依赖的传递性原理说明
说明: maven中 如果 A----->B-------->C 那么在项目中引入A包,就可以自动的引入BC!!!如何实现的???
Maven工具解析原理:
1). 用户通过dependency标签依赖jar包时,maven工具会通过坐标去本地仓库中查找改jar包文件.
2). maven查找jar包文件之后,解析当前jar包的POM.xml文件,引入相关依赖.
3.5.2 maven中jar包传输原则(了解)
问题:jar包文件 如何保证在远程传输的过程中不被别人篡改???
算法介绍: SHA1算法
SHA-1(英语:Secure Hash Algorithm 1,中文名:安全散列算法1)是一种密码散列函数,美国国家安全局设计,并由美国国家标准技术研究所(NIST)发布为联邦数据处理标准(FIPS)。SHA-1可以生成一个被称为消息摘要的160位(20字节)散列值,散列值通常的呈现形式为40个十六进制数。
3.5关于SpringBoot配置说明
3.5.1 POM.xml文件说明
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<span class="token operator"><</span><span class="token operator">!</span><span class="token operator">--</span>maven坐标 将来通过坐标唯一定位项目文件的位置 <span class="token operator">--</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>com<span class="token punctuation">.</span>jt<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>springboot_demo1<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>version<span class="token punctuation">></span></span><span class="token number">0.0</span><span class="token number">.1</span><span class="token operator">-</span>SNAPSHOT<span class="token operator"><</span><span class="token operator">/</span>version<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>name<span class="token punctuation">></span></span>springboot_demo1<span class="token operator"><</span><span class="token operator">/</span>name<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>description<span class="token punctuation">></span></span>Demo project <span class="token keyword">for</span> Spring Boot<span class="token operator"><</span><span class="token operator">/</span>description<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">!</span><span class="token operator">--</span>parent标签作用<span class="token operator">:</span>管理所有被springBoot整合之后的jar包的版本定义 springBoot特点<span class="token operator">:</span> 开箱即用 引入jar包就可以添加相对应的功能<span class="token punctuation">.</span> 定义了当前springBoot2<span class="token punctuation">.</span><span class="token number">3.1</span>所有的相关依赖的版本号信息<span class="token punctuation">.</span> <span class="token operator">--</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>parent<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>spring<span class="token operator">-</span>boot<span class="token operator">-</span>starter<span class="token operator">-</span>parent<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>version<span class="token punctuation">></span></span><span class="token number">2.3</span><span class="token number">.1</span><span class="token punctuation">.</span>RELEASE<span class="token operator"><</span><span class="token operator">/</span>version<span class="token operator">></span> <span class="token operator"><</span>relativePath <span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span><span class="token operator">!</span><span class="token operator">--</span> lookup parent from repository <span class="token operator">--</span><span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>parent<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>properties<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>java<span class="token punctuation">.</span>version<span class="token punctuation">></span></span><span class="token number">1.8</span><span class="token operator"><</span><span class="token operator">/</span>java<span class="token punctuation">.</span>version<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>properties<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>dependencies<span class="token punctuation">></span></span> <span class="token operator"><</span><span class="token operator">!</span><span class="token operator">--</span>在webjar包的内部关联整合了所有的springMVC的jar包信息<span class="token punctuation">.</span> 所以只需要引入一个jar包<span class="token punctuation">,</span>则可以关联整合所有的有关mvc的依赖包信息 <span class="token operator">--</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>dependency<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>spring<span class="token operator">-</span>boot<span class="token operator">-</span>starter<span class="token operator">-</span>web<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>dependency<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>dependency<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>spring<span class="token operator">-</span>boot<span class="token operator">-</span>starter<span class="token operator">-</span>test<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>scope<span class="token punctuation">></span></span>test<span class="token operator"><</span><span class="token operator">/</span>scope<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>exclusions<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>exclusion<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>org<span class="token punctuation">.</span>junit<span class="token punctuation">.</span>vintage<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>junit<span class="token operator">-</span>vintage<span class="token operator">-</span>engine<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>exclusion<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>exclusions<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>dependency<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>dependencies<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">!</span><span class="token operator">--</span>负责项目打包 更新 maven操作相关的配置 必须添加 <span class="token operator">--</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>build<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>plugins<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>plugin<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>groupId<span class="token punctuation">></span></span>org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token operator"><</span><span class="token operator">/</span>groupId<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>artifactId<span class="token punctuation">></span></span>spring<span class="token operator">-</span>boot<span class="token operator">-</span>maven<span class="token operator">-</span>plugin<span class="token operator"><</span><span class="token operator">/</span>artifactId<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>plugin<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>plugins<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>build<span class="token operator">></span>
</project>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
项目打包说明:
3.5.2 SpringBoot主启动类说明
问题说明: 为什么指定了主启动类的方式 tomcat服务器可以自动的运行,并且SpringMVC的框架可以自动的配置?
解释:
package com.jt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication //2.springBoot最为重要的入口注解
public class SpringBootRun {
<span class="token comment">/**
* 程序执行的过程:
* 1.利用main方法执行springboot启动程序.
* 2.程序加载@SpringBootApplication
* @Target(ElementType.TYPE) 当前注解对类有效
@Retention(RetentionPolicy.RUNTIME) 在运行期改注解有效
@Documented 相关文档信息
@Inherited 可以被继承
--- 上述的注解是元注解
@SpringBootConfiguration springBoot的主启动类就是一个配置类
@EnableAutoConfiguration
开箱即用:只要导入指定的jar包文件,则可以自动的实现配置!!!
@AutoConfigurationPackage //定义包扫描的路径信息 主启动类的包路径
以后写代码至少同包及子包中.
@Import(AutoConfigurationImportSelector.class) 实现了开箱即用的功能
总结: springBoot中选择器的配置.扫描pom.xml文件中的jar包文件.
之后将jar包文件中的配置予以执行.
AutoConfigurationImportSelector implements
DeferredImportSelector, BeanClassLoaderAware,
ResourceLoaderAware, BeanFactoryAware,
EnvironmentAware, Ordered
说明: Aware是Spring框架从项目启动-到项目的效果的各个时期的接口.
了解: 加载第三方的类信息
@ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
*
* @param args
*/</span>
<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span>String<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
SpringApplication<span class="token punctuation">.</span><span class="token function">run</span><span class="token punctuation">(</span>SpringBootRun<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
Aware作用.
3.6关于jar包文件说明
说明: 当项目开发完成之后,需要将项目进行打包部署. 将项目中的.java文件编译为.class文件之后打包到Linux服务器中运行.
运行jar包项目: 利用dos命令窗口执行 java -jar demo.jar
关闭服务器: ctrl + c
</div><div><div></div></div><div><div></div></div>
<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-60ecaf1f42.css" rel="stylesheet">
</div>