I. Principles of MAPPER Agent developmentRequires the namespace attribute value in the mapper mapping file, which must be the fully qualified name of the Mapper proxy interfaceRequires a declaration of the SQL statement label in the Mapper mapping file, consistent with the declaration of the Mapper interface method (me
1.pom.xml Environment Construction Reference http://my.oschina.net/u/555061/blog/5074742. Give the directory structure,3. Unlike the annotation method, the Usersmapper.java below the DAO package is no longer annotated,Package Com.xuebaosoft.mybatis3.mybatis_mapper.dao;import Java.util.list;import Java.util.map;importCom.xuebaosoft.mybatis3.mybatis_mapper.model.users;public interface Usersmapper {int deletebyprimarykey (String ID);int Insert (Users record);int insertselective (Users record);Users
First of all, the files in the Webroot directory are all available through the browser input path, directly read to theFor example, this:The webroot below Web-inf cannot be read directly by the browser input path.Because it's protected.If the JSP reads a picture.JSP under the webroot/jspPicture under the Webroot/imagThen we have to. /imag/xx.jpg gets the relative path.Because the servlet program is unable to read an absolute path such as C:\xx\xx\xx.Unless you change the Tomcat configuration
XML mapping configuration fileThe XML configuration file for MyBatis contains settings and attribute information that affect mybatis behavior very deeply. The advanced hierarchy of XML documents is as follows:PropertiesSettingsThese and other important tweaks, he modifies the way MyBatis behaves at runtime. The following table describes the settings information, their meaning and default values:TypealiasesA
User.java
In the enterprise model class can have hundreds of properties and may also inherit a lot of attributes, such model if the handwriting mapping file is not a big project!
This article introduces Ant+xdoclet matching to automatically generate mapping files.
Prerequisites: Ant and Xdocle jar packages.
The operation is very simple, you write a model clas
There are two solutions to a one-to-many association query: nested results and nested queriesIn the previous blog has already talked about one-on correlation query, in the MySQL database has already existed the class table class and teacher table teacher. To meet the requirements of a one-to-many association query, you also need to create a student table student. In this way, the information of teachers and students can be obtained while querying the class information.The SQL statement that crea
In a project, the user uses GeoServer as the GIS server (for reasons of course it is free to save money, verified may also be performance and stability, etc.), but the data collected in the hand is in ESRI format, which is matter, Because GeoServer is directly capable of supporting ESRI's shape file and arcsde two data formats, the user's mapping is also well-equipped with 40 or so of the layers and themati
This article will describe the basic configuration of hibernate and the application of the configuration file, which is critical for proper proficiency in the use of hibernate.
Detailed mapping elements in the configuration file
The mapping of object relationships is illustrated with an XML document.
in front of the statement (optional)property--properties to be compared (required)C, other element conditions:Employee_type = ' DEFAULT 'Property: Prepend-An element of the SQL statement that can be overridden, added in front of the statement (optional)Example:Open= "(" close= ")" conjunction= "OR" >Username= #userNameList []#Note: When using Properties of the Iterate:Prepend-an element of the SQL statement that can be overwritten, added in front of the statement (optional) property-the element
SSH refers to secure Shell, which is a secure transport protocol.The Ubuntu client accesses the remote server via SSH, the following steps are the client's configuration method:1. sudo apt-get install SSH2. Ssh-keygen(press ENTER to set default values)The Id_rsa and id_rsa.pub files are generated by default, respectively, the private key and the public key.Assume that the server IP for the 61.145.34.33,SSH service port number is 22, the server has a user root;The commands to log in to the server
mapping files for POJO classes and databases *.hbm.xml
The mapping between the Pojo class and the relational database can be defined with an XML document.
The map file has the extension. hbm.xml
Hibernate will generate various SQL statements based on this mapping f
Many people have problems with "generating artifacts" when generating mapping files for a table with myeclipse4.1.1. I also encountered this problem, made me also very depressed!After reading a lot of people's posts still can not be done. Finally, you find the following error message by looking at the. metadata\.log File:! ENTRY org.eclipse.core.runtime 4 2 2006-11-06 17:08:56.78! MESSAGE An internal error
MyBatis Mapper XML file-mapping and parameters
The true strength of MyBatis lies in its mapping statement and its magic. Because of its exceptional power, the mapper's XML file appears relatively simple. If you compare it to a JDBC code that has the same functionality, you'll immediately find that you've skipped near
The file used has a Unicode gb2312 mapping table The default is from gb2312 to unicode so the commented out part is the reverse order of the table. Don't spit out my slag sorting algorithm, Rush time and it's win slow down #include UNICODE to GB2312 pure C language Mapping method additional file Comment Area network
Label:Establishing a database connectionFind Window-open Perspective-myeclipse Database ExploreBlank out right-click NewNote that driver template and driver classname must be selected.This establishes a connection to the databaseThen right-click the table name to select Hibernate Reverse Engineering for reverse generationSRC Foleder and package to be set according to the projectThe first create Pojo is the build *.cfg.xmlThe second Java data object is the build
The SQL mapping file has a few top-level elements (in the order that they should be defined below).
Cache-Configure caching for a given namespace
cache-ref– references the cache configuration from other namespaces.
Resultmap– is the most complex and powerful element to describe how to load your objects from a database result set.
parametermap– has been abandoned! Vintage-style parametri
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.