if you are not me,
如果你不是我,
get away from my computer
远离我的电脑
第一天的进程
仓储:小型的仓库,采够单,仓库,货物,条形码(随机生成的条形码),入库(把进的货物添加的仓库中就是入库,先查看商品是否存在,如果有把原啦的编号加一,没有会自动添加) -- 库存上线
公司给你一个新框架怎么理解内容,(先找项目中的jar包,找业务需求,在找核心技术)
了解业务(UML用例图),业界画图例图Rational rose UML 设计表结构非常清晰,查看表结构 非常强大 (用例图,类图,序列图,一些复杂的图)
我们都用PowerDesigner 画数据库建模 PD ROSE(都可以生成伪代码业务逻辑查询代码:表示一些不能执行的代码)
画图是为了让开发者能够更加的了解整个系统的概貌(项目的架构图)
自动生成的表字段
create table FACTORY_C (
FACTORY_ID VARCHAR2(40) not null,
FULL_NAME VARCHAR2(200),
FACTORY_NAME VARCHAR2(50),
CONTACTS VARCHAR2(30),
PHONE VARCHAR2(20),
MOBILE VARCHAR2(20),
FAX VARCHAR2(20),
CNOTE VARCHAR2(2000),
INSPECTOR VARCHAR2(30),
ORDER_NO INT,
CREATE_BY VARCHAR2(40),
CREATE_DEPT VARCHAR2(40),
CREATE_TIME TIMESTAMP,
constraint PK_FACTORY_C primary key (FACTORY_ID)
);
了解系统的架构
使用SyBase PowerDesigner 创建建表语句
开发步奏 PD数据库建模 创建基础表
数据库为什么要有主建因为那是数据库的(????)
主建的介绍 int /long UUID 字符串 查询速度慢 UUID36位字符串
创建表成功后,在创建PO实体类
项目开发环境介绍:
工具Eclipse + 环境JDK1.8 JRE 1.8 + 中间件tomcat8.0 + 数据库Oracle10g + MAVEN apache - maven 3.0.5 + 数据库建模PowerDesigner + excel 打印POI
使用web工程 拷贝lib文件夹放到web工程中 --------项目基本类
Maven工程如何增加依赖:
1.主要核心框架springmvc,spring,mybatis
2.数据库 c3p0 oracle/mysql 驱动
3.第三方核心jar包
4.其他功能jar junit poi
5.排促冲突jar servlet.jar TOMCAT 实现
创建mapper文件和映射字段
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.itcast.jk.mapper.FactoryMapper">
<!-- 配置类和表的映射字段 -->
<resultMap type="cn.itcatis.domain.Factory" id="factoryRM">
<id property="factoryid" column="FACTORY_ID"/>
<result property="fullName" column="FULL_NAME"/>
<result property="factoryName" column="FACTORY_NAME"/>
<result property="contacts" column="CONTACTS"/>
<result property="phone" column="PHONE"/>
<result property="mobile" column="MOBILE"/>
<result property="fax" column="FAX"/>
<result property="cnote" column="CNOTE"/>
<result property="inspector" column="INSPECTOR"/>
<result property="orderNo" column="ORDER_NO"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createDept" column="CREATE_DEPT"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
</mapper>
创建dao层实现接(增删改查口)实现类
定义FactoryDao 接口 加 factoryDaoImpl 实现类
定义FactoryService接口 加 FactoryServiceImp实现类
设置项目默认tomcat:端口号8080
提交参数的get提交是把数据拼接到url后面
Beans.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<!-- 1.加载数据库配置属性文件 -->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 1.扫描 service,dao -->
<context:component-scan base-package="cn.itcast.jk.service,cn.itcast.jk.dao"/>
<!-- 3.配置数据源dataSource 连接池 c3p0 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverClassName}"/>
<property name="jdbcUrl" value="${jdbc.url}"/>
<property name="user" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="maxPoolSize" value="${c3p0.pool.maxPoolSize}"/>
<property name="minPoolSize" value="${c3p0.pool.minPoolSize}" />
<property name="initialPoolSize" value="${c3p0.pool.initialPoolSize}"/>
<property name="acquireIncrement" value="${c3p0.pool.acquireIncrement}"/>
</bean>
<!-- 4.配置sessionFactory -->
<bean id="sq