Framework day38 SVN installation and use, SSH Practice Project CRM, Environment Building (MyEclipse Hibernate inversion engine generates PO and mapping)

Source: Internet
Author: User
Tags version control system tortoisesvn

1 Version control

1.1 Introduction

 Versioning (Revision control): A standard practice for maintaining a blueprint for a project that tracks the process of engineering blueprints from birth to finalization. is a system that records changes in the content of several files so that future revisions of specific revisions can be consulted. It is also a software engineering skill to ensure that the same files edited by different people are updated during the development process.


1.2 No version control

 Code Management Confusion

 Backup multiple versions with large disk space

• Difficulty resolving code conflicts

 Easy to cause bug

 Difficult to trace the revision of the problem code and modification time

 difficult to revert to the previous correct version

 Permission control is not possible

 Project version issue is difficult

1.3 Version control software

cvs (Concurrent Versions System) is a version control system that represents a collaborative version or a concurrent version system, which facilitates software development and users to work together.

vss (Visualsource Safe) is only available under Windows as a member of Microsoft Visual Studio, and its primary task is to manage project files (C #,. NET, etc.)

Git is a version control tool for Linux kernel development. It uses a distributed version of the repository, without server-side software support, so that the release and exchange of source code is extremely convenient. Git is fast, and it's naturally important for big projects like Linuxkernel. The best of Git is its combined tracking (merge tracing) capability. (GitHub)

SVN (Subversion)is an open source version control system with a branch management system designed to replace CVS.

2 SVN

2.1 Installing SVN

 Download: http://subversion.apache.org/

 Installation

32-bit system, can be installed: 1.6.5 (recommended installation version)

64 for the system, 1.8.0 "Setup-subversion-1.8.0-1.msi"

 Note: Check the system environment variables, need to configure the installation directory

 Test Installation Success


2.2 TortoiseSVN Graphical interface

After the SVN is installed, it can be manipulated from the command line. However, it is not used in the general enterprise, it is recommended to use graphical interface operation.

 All operations, right-click

TortoiseSVN-1.6.6.17493 and setup-subversion-1.6.5 match.

Tortoisesvn-1.8.0.24401-x64 and Setup-subversion-1.8.0-1 match

Install "tortoisesvn-1.8.0.24401-x64-svn-1.8.0"

 Success

After success, right-click has the corresponding increment option

Note: After the installation is complete, rewrite the computer (the relevant file folder will be marked with icon after reboot)

2.3 Configuring the Warehouse

 Configuration Location: G:\repository\svn (not recommended: Chinese, space, etc.)

 command to create a warehouse (learn)

Format:cmd> svnadmin Create warehouse name (warehouse path)

Example: G:\repository\svn>svnadmin Createbbs

 Graphical creation

1. Create a folder (the name of the warehouse)

2. Right-click, select Create Warehouse, note: Create warehouse is folder must be empty.

 Directory structure (Learn)

2.4 Start SVN

2.4.1 Mode 1: Manual

 Mode 1: Start with command

Format:cmd> svnserve–d–r Document Warehouse Path

-D Background execution

-r version Library root directory

SVN protocol default port number: 3690

 When starting the SVN Server cmd Command window cannot be closed.

2.4.2 Mode 2: Operating system

 Configure the service of the Operating system window (SERVICES.MSC)

Cases

SC Create svn binpath= "D:\Programe\svn\bin\svnserve.exe--service-r F:\repository\svn" displayname= "Svn-service" start= Auto depend= Tcpip


 There may be a problem

[SC] Openscmanger Failure 5: Access Denied

Solution: Run cmd with an administrator

 Start and stop

Netstart SVN

Netstop SVN

 Service Removal

Format: SC Delete Service name


2.4.3 Single warehouse and multi-warehouse

SVN Service at startup, set the warehouse path, will resolve the warehouse type (single, many), different warehouse types, access in different ways.

 Multi-warehouse, can access the designated warehouse ""

Example:c:\users\admin>svnserve-d-r G:\repository\svn

There are multiple warehouses under the path "G:\REPOSITORY\SVN" to set up the warehouse

Access: "BBS" warehouse under Multi-warehouse

Svn://localhost:3690/bbs

 Single warehouse, only one warehouse can be accessed

Example:c:\users\admin>svnserve-d-r G:\repository\svn\bbs

Access:

svn://localhost:3690/

2.5 svn Operation


1 connect to the SVN server,checkout (and project first) to download the server code locally.

2 will be submitted locally to the server,commit

3 from the server to download the others,update

2.5.1 Checkout Check out

 Select or create the specified folder right-click Checkout, enter the SVN server address, use multi-warehouse

 Error

No boot,

No permissions available for checkout

2.5.2 Commit Commit

Action: Right-click to select Commit

Error:

There is no permission to access the warehouse.

Solution: Enable the warehouse to be accessed anonymously.

Location: G:\repository\svn\bbs\conf\svnserve.conf (remove anon-access in front of # # Note Do not leave blank spaces)

Write read-write, read, read-only, none no permissions

2.5.3 Update Updates

 Update the data submitted by other users to the local

Action: Right-click to select Update

2.6 SVN Permissions Configuration

2.6.1 Open Permissions

Configuration file Location: G:\repository\svn\bbs\conf\svnserve.conf

1 configuration authentication for read-write

2 Configuring user and password storage locations

passwd = file name, same directory as svnserve.conf

3 Configuring User Rights

Authz represents a file name

2.6.2 Writing users and Passwords

 Location: G:\repository\svn\bbs\conf\passwd

 Configure the user, one line represents a user, the format "User=password"

2.6.3 Writing user Rights

 Location: G:\repository\svn\bbs\conf\authz

 configuration group, format "group name = user, user 2,..... ", separated by commas with multiple users.

 Configuration Single Warehouse

[/] indicates a single warehouse root

[/doc] Represents a single warehouse/doc directory

user = permission, for example: Harry = RW

Permission values: Read (' R '), Read-write (' RW '), no Access (').

*= indicates that there are users other than the rights user, no access rights

 Configure multi-Warehouse

[Warehouse Name:/] Indicates the root of the specified warehouse. Example: [bbs:/]

@ Group name = Permissions Set permissions for group

*= R indicates that except for setting permissions for users, only Read permissions.

[bbs:/]

@itheima = RW

User3 = R

* =

2.7 Icon Demo


2.8 MyEclipse in SVN operation


2.8.1 Installing plugins

 Mode 1: Copy the plugin to the specified location

Specification directory for Eclipse plug-ins

Eclipse

|--features

|--plugins

 Mode 2: Write the link file

The plugin is extracted to any directory, for example: D:\java\MyEclipse\MyEclipse 10\svn\eclipse

Dropins Directory Add link file

File name customization: Svn.link

Content: Path=d:\\java\\myeclipse\\myeclipse10\\svn\\eclipse

 Successful Installation

2.9 SVN Server directory specification


Trunk, mainline (all code)

Branches, branch (current mainline copy, or other version copy)

tags, tags, tags in the content can not be modified, the general production version.

3 SSH Project Exercise-CRM



3.1 Project Name

CRM (Customer relationship Management).

 Practice Project School and (student) relationship

3.2 Function Modules


 HR/Employee Management

Login (Interceptor, checker)

Add (Department and Job Ajax query data)

Edit (Label echoing)

Conditional query

 Teaching Department/course category

Paging + conditional Query

 Teaching department/class management

Add (JavaScript time plugin)

File Upload

File download

4 Building the Environment

4.1 Creating a Project

 Project Name: CRM

4.2 Importing Jar Packages

SSH (slightly)

3.3 Importing prototypes

• Import the artwork into the project by writing the prototype page. The artwork provides HTML pages, and you need to modify the JSP pages yourself.

4.4 Package Structure

 Overall format: COM.ITHEIMA.CRM. module NAME. Package Structure

 For example:

Com.itheima.crm.staff.dao

Com.itheima.crm.staff.dao.impl

Com.itheima.crm.staff.service

Com.itheima.crm.staff.servcie.impl

Com.itheima.crm.staff.web.action

Com.itheima.crm.staff.domain

Com.itheima.crm.utils

One course category with multiple classes (one to many)

A department with multiple positions (one to many)

A job with multiple employees (one-to-many)

4.5 Creating databases and tables

 Perform spring--day04\crm\ Crm.sql

4.6 Generating the PO class

use MyEclipse's hibernate inversion engine to generate the PO and mapping files automatically through the database tables .

Step One : Set the project to "Hibernate project", Project right-click Add Hibernate support

1. Use MyEclipse to provide hibernate jar packages (or import them yourself)

2. Select already provided Hibernate.cfg.xml

3. Do not create a tool class

Step Two : Create the package Com.itheima.crm.domain

Step three : Select the MyEclipse DataBase Explorer view

Step four : Right-click New database Connection (new)

Step five : Create new Connection Details

Step Six : Select all the tables and use Hibernate to reverse the engine

Step Seven : Configure the Reverse engine 1

Step Eight : Determine the primary key generation strategy

 Step Nine: Copy the PO class and the mapping file, and then modify the content accordingly.

4.7 Spring Configuration

 Load Properties

 Configure Data Source DataSource

 Configure sessionfactory, load all Hbm.xml

hibernate Transaction Management

 Use <import > All modules using a separate configuration file



Framework day38 SVN installation and use, SSH Practice Project CRM, Environment Building (MyEclipse Hibernate inversion engine generates PO and mapping)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.