1-2 Building a Common Project

Basic module construction steps

1 Create a new module on the parent project, the type is maven

2 Modify pom.xml

<!--增加jpa依赖、lombok组件、fastjson组件、数据库连接插件-->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.56</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>
    </dependencies>

3 Create the cn.hzp.domain package under src/main/java, and create entity classes User, Projduct, Order under the package

Create entity classes User, Projduct, Order under the package

  • Note that the name in the entity comment corresponds to the name of the database table, and the name can contain underscores

Guess you like

Origin blog.csdn.net/weixin_45544465/article/details/105936482