When using Mybaitis to pass parameters, if only one parameter of type string is passed in, the XML file should use _parameter instead of the parameter name. The correct wording:[HTML]View Plaincopyprint?
span style="FONT-SIZE:18PX;" > -
Select id= "iscargobillnoexist" resulttype="Java.lang.Integer">
Select COUNT (1)
From T_entry_cargo_receiver_info
where 1=1
if test="_parameter! = null" >
and cargo_bill_no = #{span style="color: #ff0000;" >_parameterspan;,jdbctype=VA
In Mapper.xml, if the single parameter is a string type, and the parameters are judged in the SQL statement, the following is the same as if the If judgment appears. It is necessary to replace the parameters in the judgment with _parameter.In addition, it is null to determine whether a field is empty in orcal, in the same vein, it is not NULL to judge not to be empty.Error query:Id= "Select"Resultmap= "Resultmap"parametertype= "String" select Name,code,parent,level from Table = "Code!
46738747Using the MyBatis pass-through parameter, if you use the Interface:Public interface Usermapper {Query users by nameList}?Mapping.xml:?Selectt_id as ID,T_name as name,T_password as passwordFrom Mybatis_userwhere 1=1and T_name=#{name}ORDER BY t_idThere is no getter for property named ' ID ' in class ' java.lang.String '
I. Discovering problemsSelect Bzwzname, sum (buynumber) as Stocknumber from X_bzwz_ruku Group by Bzwzname_parameter!=null and name_parameter! =" "> have bzwzname like '% ' | | #{name_parameter}| | ' % ' Regardless of the parameter name, change to "_parameter".Three. cause AnalysisMyBatis by default with ONGL parsing parameters, so the object tree will automatically take the form of string.name values, causing error. The public List methodName (@Param (value= "name") String name can also be used
Before modificationSelectID= "Getgroupid"ParameterType= "Java.lang.Long"Resulttype= "Com.capinfo.weibo.system.entity.ColumnGroup">SELECT * from Common_columngroup Cwhere> ifTest= "Accountid!=null">C.accountid=#{parameter} and c.type=2if> where> Select>If the incoming type is a long type, the parameter needs to be uniformly modified to [_parameter], and the modified SQL statement is as follows (whatever your parameters are, change to "_parameter")SelectID= "Getgroupid"ParameterType= "
first, the problem foundSelect Num,name,phone from studentifTest = "Num!=null and num!=" >and num=#{num}if>MyBatis query passed in a string argument, reported there is no Getter forProperty named ' Num ' in ' Class java.lang.String '. Second, solve the problemSelect Num,name,phone from studentifTest = "_parameter!=null and_parameter!=" >and num=#{_parameter}if>regardless of the parameter name, change to"_pa
Parameter package There is no getter for property named 'xxx' in 'class java. lang. string' in mybatisgetter
I. Problems Found
Select num, name, phone from studentAND num = # {num}When you pass in a String to the Mybatis query, There is no getter for property named 'num' in 'class java. lang. string' is reported '.
Ii
First, the problem foundSelect Num,name,phone from Studentand num = #{num}The MyBatis query passes in a string-pass parameter, and is reported to there is no getters for the property named ' Num ' in ' Class java.lang.String '.Second, solve the problem select num,name,phone from student _ Parameter !=null and _parameter ! = "" > and num = #{ _parameter } Regardless of the parameter name, change to "_parameter". Third, th
first, the discovery of problems
and num = #{num}The MyBatis query passes in a string pass parameter, which is reported there is no getter for property named ' num ' class java.lang.String '.
ii. problem-solving
_parameter!=null and_parameter!=" ">and num = #{_parameter}Change to "_parameter" regardless of the parameter name.
Iii. analysis of Causes
MyBatis defaults to the use of Ongl parsing parameters, so
The properties of a JavaScript object consist of a name, a value, and a set of attributes (writable, enumerable, configurable, and so on). In ECMAScript 5, property values can be replaced by one or two methods, which are getter and setter.
var myobj = {
a:2, get
B () {return
3;
}
};
Console.log (MYOBJ.A);//2
Console.log (myobj.b);//3
In the code above, property A is called a " Data
= Object.getownpropertynames (obj);//get all of your own properties the for(vari=0;ii) { + if(Names[i]inch This) - Continue;//Skip an existing attribute the vardesc =Object.getownpropertydescriptor (Obj,names[i]);BayiObject.defineproperty ( This, Names[i],desc);//Copy the configuration of properties and properties. the } the } - }); - the varR ={}; the r.extend (p); theConsole.
Is property assessor good or edevil? C # thinks good and Java as contrast. What about JavaScript? Maybe yes, maybe no...
Mozilla spidermonkey introduce variety of solutions for getter and setter. Here is the sample:
Test-js-getset.js========================
function test1() {var obj = {prop getter: function () { return 'prop1'; }};trace(obj.prop);obj.prop
running JavaScript code and add it to the AST tree. The result of the class definition is to add a new node of type classliteral in the syntax abstraction tree.The node contains some information. First, it treats the constructor as a separate function and contains the class property set. These properties can be a method, a g
JavaScript-create your first class library, javascript-class library
Through the previous object-oriented and Prototype Learning Section. We know how to create a class, including private attributes and methods of the class, public
We know the code for getting the class name of a JavaScript user-defined class, although JavaScript is an object-based language. However, with its prototype feature, we can fully implement a very sexy OO compiling framework. Here we can look at the articles in the classic Forum 'Basically implement
Add and remove class names based on JavaScript and remove class names using javascript
Method 1: Use the className attribute;
Method 2: Use the classList API;
// Function reg (name) {return new RegExp ('(^ | \ s)' + name + '(\ s + | $) ');} // hasClass addClass removeClass toogleClassvar hasClass, addClass, removeClass
Detailed explanation of the principle of the Javascript class Inheritance Mechanism
Currently, JavaScript implementation inheritance is not implemented through the "extend" keyword, but through the constructor function and prototype attributes. First, create an animal class.JS Code
VaR animal = function () {// This is the constructor function.
This. Name = 'pi
How to use JavaScript to define a class, javascript a class
My original method is as follows:
function Dog(){ this.name = 'hachi';}Dog.prototype = { makeNoise:function(){ alert('wangwangwang'); }};
Later, I saw another complicated and seemingly unnecessary statement:
function Dog(){ var privateVariable = 'secret
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.