Farseer.net lightweight open source framework entry: Detailed description of data modification, farseer.net entry
Navigation
Tutorial: Farseer.net lightweight open-source frameworkDirectory
Previous: Farseer.net lightweight open source framework entry:Add data details
Next article: Farseer.net lightweight open source framework entry:Detailed description of data deletion
Update methods (basic)
1 Users info = new Users (); 2 info. UserName = "Zhang San"; 3 info. PassWord = "PassWord"; 4 5 // modify the data with the specified user ID 1. 6 Users. Data. Where (o => o. ID = 1). Update (info );
1 // modify the data with the specified user ID 1. 2 Users info = new Users () {UserName = "Zhang San", PassWord = "PassWord"}; 3 Users. Data. Update (1, info );
1 // modify the data with the specified user ID 1. 2 Users info = new Users () {UserName = "Zhang San", PassWord = "PassWord"}; 3 info. ID = 1; 4 Users. Data. Update (info );
1 // modify the data with the specified user ID 1. 2 Users info = new Users () {UserName = "Zhang San", PassWord = "PassWord"}; 3 info. Update (1 );
1 // modify the data with the specified user ID 1. 2 new Users () {UserName = "James", PassWord = "PassWord"}. Update (1 );
1 // modify the data with the specified user ID 1. 2 Users info = new Users () {UserName = "Zhang San", PassWord = "PassWord"}; 3 info. ID = 1; 4 info. Update ();
1 // modify user IDs in batches to: 1, 2, 3, 4, 52 var lst = new List <int> {1, 2, 3, 4, 5}; 3 Users. data. where (o => lst. contains (o. ID )). update (info );
Update methods (single value)
1 // Add 12 Users to the field value. data. where (o => o. ID = 1 ). updateValue (o => o. loginCount. getValueOrDefault (), 1); 3 Users. data. where (o => o. ID = 1 ). select (o => new {o. loginCount }). updateValue (1); 4 Users. data. select (o => new {o. loginCount }). updateValue (1, 1 );
You can modify the parameters by adding 1. The last parameter 1 of the above three methods is the value to be superimposed.
1 In front of the Code in line 2 represents ID = 1.
Framework Conventions
When the attribute is not assigned a value, that is, when the attribute is null. No corresponding field SQL is generated.
For example:
1 new Users () {UserName = "James"}. Update (1 );
The Users entity actually has many fields, such as PassWord, GenderType, and LoginCount.
Because we do not assign a value to it, it is null. Databases do not assign values to them. That is, the equivalent SQL is:
1 Update set UserName = "zhangsan" From Members_User Where ID = 1
Navigation
Tutorial: Farseer.net lightweight open-source frameworkDirectory
Previous: Farseer.net lightweight open source framework entry:Add data details
Next article: Farseer.net lightweight open source framework entry:Detailed description of data deletion
What is the framework in java? For example, what is the concept of java's three open-source frameworks?
In fact, the framework is very simple. You can think of it as a tool or even a plug-in.
The role of the framework is to encapsulate a common and common technology,
It helps you deal with some basic things, so that you don't have to write complicated things any more.
Take the struts you want to learn for example: it is actually written in java. It is no different from the class we write. We can implement what we implement.
For example, we use request. getParameter () to receive client data, but if there are many parameters, we need to write a lot, which is very troublesome. Struts helps us implement it. You don't need to write it, but simply write an attribute. In essence, request. getParameter () is used ()..
So you don't need to care about what the framework is, as long as you get started with it. You use it as a tool. This is the framework.
What is the Java open-source technical framework? Let me explain in detail,
Currently, the mainstream open-source technical frameworks are SSH, namely Spring struts2 and hibernate.
Spring Framework [Java Open-Source J2EE Framework]
Spring is a powerful framework that solves many common problems in J2EE development. Spring provides consistent methods for managing business objects and encourages injection of good habits of interface programming rather than class programming. Spring's architecture is based on the Inversion of Control container using the JavaBean attribute. However, this is only part of the complete picture: Spring is unique in the use of IoC containers as a complete solution to build a focus on all architecture layers. Spring provides a unique data access abstraction, including a simple and efficient JDBC framework, which greatly improves efficiency and reduces possible errors. Spring's Data Access architecture also integrates Hibernate and other O/R mapping solutions. Spring also provides a unique transaction management abstraction that provides a consistent programming model for various underlying transaction management technologies, such as JTA or JDBC transactions. Spring provides an AOP framework written in the standard Java language, which provides POJOs with declarative transaction management and other enterprise transactions-if you need to-implement your own aspects. This framework is powerful enough to allow applications to get rid of the complexity of ejbs and enjoy key services related to traditional ejbs. Spring also provides a powerful and flexible MVC Web framework that can be integrated with IoC containers. [SpringIDE: The next auxiliary development plug-in on the Eclipse platform ].
Struts [Java open-source Web Framework]
Struts is an MVC framework based on the Sun J2EE platform. It is mainly implemented using Servlet and JSP technologies. Because Struts can fully meet the needs of application development, it is easy to use and agile, and has received a lot of attention in the past year. Struts integrates Servlet, JSP, custom tags, and message resources into a unified framework. Developers do not need to code themselves to implement a full set of MVC patterns during development, it saves a lot of time, so Struts is a very good application framework. [StrutsIDE: an Eclipse plug-in for Struts-assisted development]
Hibernate [Java open-source persistent layer framework]
Hibernate is an open-source object relationship ing framework that encapsulates JDBC objects in a lightweight manner, so that Java programmers can use the object programming thinking to manipulate the database as they wish. Hibernate can be used in any scenario where JDBC is used. It can be used in both Java client programs and Servlet/JSP Web applications. The most revolutionary thing is that, hibernate can replace CMP in the J2EE architecture of application EJB to fulfill the task of data persistence. Hibernate auxiliary development tools on the Eclipse platform: [Hibernate Synchronizer] [MiddlegenIDE]