1. What is reverse engineering
One of the main features of MyBatis is the need for programmers to write their own SQL, so if the table is too much, it will be difficult, so MyBatis official provides a reverse engineering, can automatically generate
For insert:
Insert a piece of dataSupports Oracle sequence, UUID, mysql-like indentity automatic growth (automatic writeback)Use a sequence, UUID, and automatically grow when the parameter value is empty, using the incoming parameter value firstBut
Project Structure
If the project uses the relational database, cooperate with the Ibatis use, only needs to establish the database table to be OK, other will give the plug-in to do. Add in 1.pom file
1, add the following code in Pom.xml project>build, let MAVEN environment support Mybatis-generator component
org.mybatis.generator mybatis-generator-maven-plugin 1.3.2 < ;configuration> src/main/resources/generator.xml true true generate
This article will briefly introduce the INSERT, UPDATE, delete configuration and use, in the future will be the source of mybatis in-depth explanation.
Believe, see INSERT, UPDATE, Delete, we know its role, as the name implies, Myabtis as a
In recent project development, a lot of domain models have been used, (POJO refers only to setter/getter/tostring simple classes, including DO/DTO/BO/VO, etc.), and then encounters many scenarios where the model attributes are automatically
Write Association first, then write collection; this is determined by the dtd; ... > ... > Association > ... > >resultmap> MyBatis one-to-many, multi-pair Query when mapper order
The parameters of the MyBatis Mapper interface are generally an object, but what if it is not an object and has multiple parameters? Our first idea was to encapsulate the parameters into a java.util.Map type, and then write the key of the map on the
The mapping file is loaded via the mapper interface, which is important for the integration of the following SSM three Frameworks. So what is loading the mapping file via the mapper interface?We first look at the previous practice, in the global
EN "HTTP://IBATIS.APACHE.ORG/DTD/IBATIS-3-MAPPER.DTD" >
Resulttype= "" usecache= "true" flushcache= "true" timeout= "" fetchsize= ""Statementtype= "STATEMENT" resultsettype= "Forward_only" >StatementType can be set to
Before today, just heard mybatis, useless, has been used ibatis, at that time feel very simple, today the project used the mybatis,example of things, just took over, dizzy for a long time. Only now has learned how to generate classes and
The Insert method uses all properties as fields
@Test public
void Testinsert () {
user record=new User ();
Record.setname ("SanSan");
Use This.newUserMapper.insert (record) with all attributes as fields
;
}
This paper describes the Symfony data verification method. Share to everyone for your reference. The specific analysis is as follows:
Validation is a common task in a Web application. The data entered into the form needs to be verified. The data also needs to be validated before being written to the database or passing in a webservice.
The Symfony2 is equipped with a validator component that makes the verification process easy to understand. The component is based on the JSR303 Bean checksum sp
during deployment.The network diagram above.
Note:
Mail/Acme and SMTP/Acme are two servers in the same notes network domain. They share a public address book and belong to the same notes naming network.
Mail/Acme is a service for all internal users. This server is used for sending and receiving mails. You can directly use the domain name or IP ad
This article uses the example to analyze the Symfony data check method, here to share for the reference, the interested small partner may look
Validation is a common task in a Web application. The data entered into the form needs to be verified. The data also needs to be validated before being written to the database or passing in a webservice.
The Symfony2 is equipped with a validator component that makes the verification process easy to understand. The component is based on the JSR303 Bean c
The benefit of visual use of the MVC (Model-view-control) pattern in our development projects is that it can completely reduce the interaction between the business layer and the application presentation layer. In addition, we will have a completely separate object to manipulate the presentation layer. The independence between the objects and layers that MVC provides in our project will make our maintenance simpler and easier for our code reuse (as you'll see below).
As a general rule, we know t
user can get a greeting by visiting the following URL:
Http://localhost/app_dev.php/hello/Symfony
In fact, you can change the symfony to a different name to greet, to create the page, we simply have to go through two steps:
This tutorial has assumed that you downloaded the SYMFONY2 and configured the Web server. The above URL assumes that localhost points to your new Symfony2 project. Installation details see installing Symfony2.
Create bundles
Before you start, you need to create a bundle. In
/app_dev.php/hello/Symfony
In fact, you can change the symfony to a different name to greet, to create the page, we simply have to go through two steps:
This tutorial has assumed that you downloaded the SYMFONY2 and configured the Web server. The above URL assumes that localhost points to your new Symfony2 project. Installation details see installing Symfony2.
Create bundles
Before you start, you need to create a bundle. In Symfony2, bundles are the equivalent of plugins, and all the code in you
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.