Understanding of PO, VO, BO, POJO, DAO, DTO, TO, QO, Bean, conn in java

O/R Mapping is Object Relational Abbreviation for Mapping (object-relational mapping). In layman’s terms, it means binding objects to relational databases and using objects to represent relational data. in O/R In the world of Mapping, there are two basic and important things that need to be understood, namely VO and PO. VO, Value Object, PO, persistent object (Persisent Object), which are composed of a set of properties and their get and set methods. Structurally, there is nothing different about them. But it is completely different in its meaning and essence. 1. VO is created using the new keyword and recycled by GC. PO is created when new data is added to the database and deleted when data in the database is deleted. And it can only survive in one database connection and will be destroyed when the connection is disconnected. 2. VO is a value object. To be precise, it is a business object. It lives in the business layer and is used by business logic. The purpose of its existence is to provide a place for data to live. PO is stateful, and each attribute represents its current state. It is an object representation of physical data. Using it, we…

Mybatis reverse engineering generates JavaBean, dao, mappergeneratorSqlmapCustom

import java.io.File; import java.util.ArrayList; import java.util.List; import org.mybatis.generator.api.MyBatisGenerator; import org.mybatis.generator.config.Configuration; import org.mybatis.generator.config.xml.ConfigurationParser; import org.mybatis.generator.internal.DefaultShellCallback; public class GeneratorSqlmap { public void generator() throws Exception{ List warnings = new ArrayList(); boolean overwrite = true; //Specify reverse engineering configuration file File cOnfigFile= new File(“generatorConfig.xml”); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration cOnfig= cp.parseConfiguration(configFile); DefaultShellCallback callback = new DefaultShellCallback(overwrite); MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); myBatisGenerator.generate(null); } public static void main(String[] args) throws Exception { try { GeneratorSqlmap generatorSqlmap = new GeneratorSqlmap(); generatorSqlmap.generator(); } catch (Exception e) { e.printStackTrace(); } } } XML configuration file: ​ ​ ​ Screenshots of relevant documents:

Description of several objects in Java development (PO, VO, DTO, BO, POJO, DAO, SAO, etc.)

1. PO: (persistant object), persistent object can be seen as a java object that maps to a table in the database. Using Hibernate to generate PO is a good choice. 2. VO: (value object), value object is usually used for data transfer between business layers. Like PO, it only contains data. But it should be an abstracted business object, which may or may not correspond to a table, depending on the needs of the business. PO can only be used in the data layer, and VO is used in business logic layer and presentation layer. Each layer operates its own data objects, which reduces the coupling between layers and facilitates future system maintenance and expansion. 3. DAO: (Data Access Objects), data access object interfaceDAO is the Data Access Object data access interface, data access: as the name suggests Just deal with the database. Sandwiched between business logic and database resources. J2EE developers use the Data Access Object (DAO) design pattern to separate the underlying data access logic from the high-level business logic. Implementing the DAO pattern can focus more on writing data access code. The DAO pattern is one of the standard J2EE design patterns. Developers use this pattern to…

JavaBean, POJO, Entity, VO, PO, DAO

Java Bean, POJO, Entity, and VO are actually Java objects, but they are used in different situations. ​ ​ Java Bean: It is an ordinary Java object, but with some constraints added. The declared property is private and implements the Get and set methods. ​ POJO: Plain Old Java Object. Just an ordinary object; ​ Entity: The meaning of entity. Entity is declared only when accessing the database. To put it bluntly, an Entity is a record in the corresponding table. When a record is inserted, an Entity is inserted. ​ VO: Value Object. PO: Persistent Object. Persistent objects. There is nothing special about VO and PO, because with Hibernate, there will naturally be some new things. ​ ​ DAO: data Access Object: Data access object. Some directly translate it into database access objects. To put it simply, it means dealing with the database. ​ According to the Spring MVC hierarchy: ​ JavaBean: Presentation Layer ​ Entity: Service layer ​ Dao: Data access layer.

Java’s (PO, VO, TO, BO, DAO, POJO) explanation

Recently I am writing an interface for Android, in which the server data needs to define a VO (Value Object) object for encapsulation and transmission The concepts of VO, PO, BO, QO, DAO and POJO are still relatively vague, so I will record them here: O/R Mapping is the abbreviation of Object Relational Mapping. In layman’s terms, it means binding objects to relational databases and using objects to represent relational data. In the world of O/R Mapping, there are two basic and important things that need to be understood, namely VO and PO. PO (persistant object) persistent object The concept that appears when o/r is mapped. If there is no o/r Mapping, no such concept exists anymore. Usually corresponds to the data model (database ), which itself also handles some business logic. It can be seen as a java object that maps to a table in the database. The simplest PO corresponds to a record in a table in the database. Multiple records can use a collection of PO . PO should not contain any operations on the database. VO(value object) Value object Usually used for data transfer between business layers, and PO also only contains data. But it should…

DAO, Service, Web simple encapsulation of JavaEE 3-layer architecture

Since most projects are done using the three open source SSH frameworks, the DAO and Service layers are simply encapsulated. The encapsulation method is very simple, which is to encapsulate common methods such as Hibernate’s CURD. These methods need to be written in a DAO. Service is the same. The logic implemented is generally GeneralDAO(Interface). AbstractGeneralDAOImpl(Abstract class), GeneralService(Interface), AbstractGeneralServiceImpl(Abstract class). Specific IDAO extends GeneralDAO, IDAOImpl extends AbstractGeneralDAOImpl, IService extends GeneralService, IServiceImpl extends AbstractGeneralServiceImpl The implementation code is as follows. GeneralDAO 1: import java.io.Serializable; 2: import java.util.Collection; 3: import java.util.List; 4: 5: import PagingVO; 6: 7: /** 8: * General DAO 9: * 10: * @author Hacker-TTAO 11: * @version 0.1.0 12: */ 13: public interface GeneralDAO { 14: 15: T findByID(ID id); 16: 17: List findAll(); 18: 19: PagingVO getPagingData(int currentPage, int pageSize); 20: 21: T save(T entity); 22: 23: void save(T… entity); 24: 25: T update(T entity); 26: 27: void update(Collection entity); 28: 29: void saveOrUpdate(T entity); 30: 31: void saveOrUpdate(Collection entities); 32: 33: void delete(T entity); 34: 35: void delete(ID id); 36: 37: void delete(Collection entities); 38: 39: void marge(T eneity); 40: 41: void marge(T… eneity); 42: 43: int getCount(); 44: } AbstractGeneralDAOImpl 1: import java.io.Serializable; 2: import…

What are PO, VO, DAO, BO and POJO respectively? (Explanation of several JAVA objects)

PO: persistent object persistent object The most vivid understanding is that a PO is a record in the database. The advantage is that a record can be processed as an object and can be easily converted into other objects. It can be seen as a Java object that maps to a table in the database. The simplest PO corresponds to a record in a table in the database. Multiple records can use a collection of POs. The PO should not contain any operations on the database. BO: business object business object Java objects that encapsulate business logic can perform business operations by calling DAO methods and combining PO and VO. The main function is to encapsulate business logic into an object. This object can contain one or more other objects. For example, a resume has educational experience, work experience, social relations, etc. We can map educational experience to a PO, work experience to a PO, and social relationships to a PO. Create a BO object corresponding to the resume to process the resume. Each BO contains these POs. When dealing with business logic in this way, we can deal with BO. VO: value object value object, ViewObject presentation layer object…

An introduction to several objects in Java (PO, DO, DTO, DAO, POJO)

PO PO is apersistant object—a persistent object. The concept that appears during O/R mapping ,If there is no O/R mapping,this concept does not exist. Usually corresponds to the data model (database), and itself also has some business logic processing. It can be thought of as a Java object that maps to a table in the database. The simplest PO is a collection corresponding to a record in a certain table in the database – multiple records can use PO. The PO should not contain any operations on the database. DO DO is Domain Object—Domain Object is a tangible object abstracted from the real world or intangible business entity. Generally corresponds to the table structure in the data. TO TO is Transfer Object—data transfer object with different ties (relationships) in the application Objects transferred between DTO DTO is the concept of Data Transfer Object—Data Transfer Object The design pattern derived from J2EE’s original purpose is to provide coarse-grained data entities for EJB distributed applications to reduce the number of distributed calls, thereby improving the performance and reducing the cost of distributed calls. Network load “but here” I generally refer to the data transfer objects between the presentation layer and the service…

What do VO, PO, BO, QO, DAO, POJO mean in Java?

What do VO, PO, BO, QO, DAO, POJO mean in Java?

What do VO, PO, BO, DAO, POJO mean in Java I recently encountered VO in a project, my God. . . Then let’s learn and remember together First of all, a brief explanation: O/R Mapping is the abbreviation of Object Relational Mapping (Object relational mapping). To put it simply, it is to bind objects to relational databases and use objects to represent relational data. Java WEBWe need to be more proficient in using the three-tier architecture VO: Value Object Created with the new keyword, GC recycling is usually used for data transfer between business layers. It is generally an abstracted business object, which may or may not correspond to a data table. In the web layer, corresponding to a web page or swt interface, a VO object is used to correspond to the value of an interface. ​ PO: Persistant Object Attributes correspond to fields in the database table one-to-one, and can be regarded as Java objects mapped to tables in the database. Generated by database insert and deleted by database delete. Its life cycle is closely related to the database, but the PO should not contain any operations on the database. The java files are generally the field attributes…

The role of the javawebdao package_The role of action, dao, model, service packages and other packages under 20190416src

The role of the javawebdao package_The role of action, dao, model, service packages and other packages under 20190416src

1.MVC and SSH MVC is the structure, Model, View, Controller SSH is the framework, Spring (xx.xml), Struts, Hibernate (xx.hbm. xml). src: com.action com.dao com.model com .service com.util Function: Thefirststep:Obtainuserinputdatafromtheclient,thatis,usernameandpassword,andthenhanditovertotheactionforprocessing. Step2:Theactionneedstousethefunctionsprovidedbytheserviceinterface,suchaslogin,registration,modificationofinformation,etc.,andreturntheexecutionresults,andthenrespondtotheuser. Step3:Theservicelayerisresponsibleforbusinesslogic.Itusesthedaointerfacetoadd,delete,modifyandquerydatainmultipletablesinthedatabasetocompleteafunction.Inactualapplications,itisnotassimpleasloggingin. Step4:Hibernatecompletesthepersistenceofentityclasses.Alldaolayersareresponsibleforthemanagementofentityclassesinthemodellayer,thatis,themanagementoftabledataisrealized. Inaddition,atransactionmanagerisusedtomakethemanagementofthingsmorestandardizedandthecodemoreconcise.Iwillnotintroduceithere.Youcanrefertootherarticles. 2.Thefunctionsofaction,dao,model,servicepackagesandotherpackages 1.Controllerpackage(actionpackage):Thispackageplacesvariousstrutsactions. Namingrules:xxxUserAction.java 2.daopackage:Thispackageplacesvariousdao(dataaccessobjects),thatis,placesimplementationclassesfordatabaseaccess Theroleofthedaopackage: DAO(DataAccessObject)dataaccessobjectisanobject-orienteddatabaseinterface,thatis,dealingwiththedatabase. (1)PO(inuser.dao) Thispackageplacesvariousdao(dataaccessobjects),thatis,itplacestheimplementationclass(POJO)fordatabaseaccess.Whenusing”HibernateReverseEngineering” in myeclipse to perform reverse operations, a DAO corresponding to a certain table will be generated in a certain directory. After generation, the DAO can be dragged into the dao package. In some projects, we can see the POJO package, which actually stores the POJO in the DAO package. Naming rules: User.java (xxx is the table name of the corresponding database) (2) PO interface class (in user.dao) Based on For the automatically generated DAO, we can establish its corresponding interface, and store all PO’s operation methods on the database in this interface. Naming rules: UserDAO.java (3) Implementation class of PO interface (in user.dao.impl) Then create an impl in the dao package Package, place the implementation of the DAO interface in the impl package. For example, the UserDAO interface has an implementation class called UserDAOImpl. Place this class in the impl package. The DAO interface can implement spring’s IoC operation (this is the application of the bridge mode , separate…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索