Applied to actual project: 1.thrift object to the DTO
The interaction between 2.pojo and DTO
The reciprocal transfer between 3.pojo and VO
Or do you prefer to stick code directly csdn code address
1. Core conversion Tool class, no processing for particularly complex types because the business scenario is not yet covered
Package Littlehow.convert;
Import Org.slf4j.Logger;
Import Org.slf4j.LoggerFactory;
I
Since JDK5.0 introduced annotations (Annotation), Java development has been simplified a lot, allowing developers to almost get rid of complex
Trouble with configuration files. This article describes the set of annotations that spring provides equivalent to the Commons Attribut attribute class and the implementation class annotationsjmxattributesource of a policy interface jmxattributesource that allows Mbeaninfoassembler to read these notes. This article shows you how to quickly and easily get
As already mentioned, Spring MVC can be used by @pathvariable to map the values in the URL to the parameters of the target method, or you can use @requestparam to pass a single parameter, if you need to pass more than one parameter at a time, you need to write multiple corresponding annotations, Is there a simpler and more convenient way to do that? The answer is that spring MVC has the automatic boxing function, which allows the assignment to be done for the corresponding properties of the back
Pay attention to the following points when writing, releasing, and testing a WebService with 0 configurations:
1. The pojo class cannot use the package keyword to declare a package.
2. axis2 can hot publish WebService by default. That is to say, Tomcat can automatically publish WebService without restarting when the. Class file of WebService is copied to the pojo directory. To cancel the hot release of axis
The last article discussed spring's design goal: Making Jee development easier.
Okay, as a Java developer, we should all know the Struts framework, and do not know the differences between struts1 and struts2.
First, the two are almost completely different frameworks, and struts2 is more like an upgraded version of another framework webwork. Of course, what we want to discuss here is not struts2, but the advantages of struts2:
The development mode based on action
In the previous article, we briefly introduced the use of roboguice ([4] use of the injection framework roboguice :( your first System Service injection). Today, let's take a look at the method of using annotations for common Java objects:
(1) To use annotations for common Java objects in an activity, you must perform the following two steps:
①: Create an activity that inherits the roboactivity
②: Use @ inject to annotate pojo (common Java object)
Pr
Pojo: plain ordinary Java object. Its concept is basically the same as that of JavaBean, but it has no other methods except some private attributes and the corresponding get and set methods. For example:Public class user {Private long ID;Private string name;Public void setid (long ID ){This. ID = ID;}Public void setname (string name ){This. Name = Name;}Public long GETID (){Return ID;}Public String getname (){Return name;}}
1. Corresponding to Dao and service
Generally, Hibernate Dao only operates on one pojo object, so a DaO corresponds to one pojo object. The service layer manages transactions (declarative transactions) to process multiple pojo objects (data operations on multiple tables ). The service layer (its interface implementation class) is injected with multiple Dao obje
Vo, to, Po, pojo, Bo
VO: Actually very fuzzy, usually refers to valueobject and viewobject
Viewobject: the object required by the UI, such as the formbean of struts
Value Object: a general term for valueobject and transfer object.
To: transfer object, data transmission object, in ApplicationProgramObjects transmitted between different tie
Po: Persistent Object (Persistent Object), basically entity
Pojo
1. First define an entity User type that receives the data, and a userquery type for the input parameter.1 Public classUser {2 Public intID;3 PublicString username;4 PublicDate birthday;5 PublicString sex;6 PublicString address;7 }8 Public classUserQuery {9 PrivateString Orderbyclause;Ten PrivateListOredcriteria; One Public voidAddusernamelike (String username) { AOredcriteria.add (NewCriteria ("username like", username)); - } - Public voidAddsexg
we handle business logic like this, we can deal with BO.7.POJO (Plain ordinary Java object) simple, rule-free Java objects?? Java object of traditional meaning. In some object/relation Mapping tools, the Persisent object that maintains database table records is a pure Java object that conforms to the Java Bean specification and does not add other properties and methods. My understanding is the most basic Java Bean, only attribute fields and setter an
How does eclipse quickly create Pojo?1. New Pojotest class2. Adding member variables3. Join Setter/getterSelect "Source" in the Alt+shft+s or right-click menu. Select "Generate Setters and Getters" in the pop-up menuTick the fields that need to generate the Setter/getter method.Click "OK" to add a good setter/getter method.4. Adding constructorsSelect "Source" in the Alt+shft+s or right-click menu. Select "Generate Constructor using Fields" in the pop
After searching the internet for definitions of all nouns, I summed up the following tableSome of the object abbreviations in Java should be understood.2018.04.21
definitions and roles of many Java object abbreviations, differences and linkages
Type
Defined
Role
Other
Pojo
(Plain ordinary Java object) Simple Java objects
Common JavaBeans, which can sometimes be used as VO (value-object) or
has 100 attributes.But we just show 10 fields on the interface,The client uses the Web service to get the data, and there is no need to pass the entire PO object to the client.At this point we can pass the result to the client with a DTO with only these 10 attributes, and this will not expose the service-side table structure. After the client is reached, if the interface is displayed with this object, then its identity will be converted to VO.Pojo:Plain ordinary Java object simple Java objectsP
from the perspective of the business model.A Java object that encapsulates business logic, which is combined with PO,VO to perform business operations by invoking the DAO method. The main role is to encapsulate business logic as an object.This object can include one or more other objects.such as a resume, education experience, work experience, social relations and so on.We can put the education experience corresponding to a PO, work experience corresponding to a PO, social relations correspondi
more focused on writing data access code.The DAO pattern is one of the standard Java EE design patterns. Developers use this pattern to separate the underlying data access operations from the high-level business logic. A typical DAO implementation has the following several components:1. A DAO factory class;2. a DAO interface;3. A concrete class that implements the DAO interface;4. Data transfer objects (sometimes called value objects).The specific DAO class contains the logic to access data fro
Tags: ack pojo tom utf-8 pos DDP param model not foundToday at work, you need to insert the user's registration information into the database, the beginning is to use all the model properties as the parameters of the DAO interface, and then think of something wrong, if there are 100 properties, then I this interface is not to have 100 parameters to pass in? So I consider the whole model or DTO as the parameters of the DAO interface, to the SQL paramet
In eclipse, how does one insert pojo into the crystal report? This is what we need to do in the fourth article.
First, we should create an object class.
Here I use orderitems. Java as an example, codePackage com. jrc. beans;
Public class orderitems ...{
Public int ID; // the ID of the corresponding database table
Public int quantity; // number of products, which are not available in database tables
Public orderitems (int id, int quantity )...{
Super
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.