1. How to generate common annotations for web service clients, or write them by hand
(recommended tutorial: java introductory tutorial )
@WebService(serviceName="PojoService", portName="PojoPort", name="PojoPortType", targetNamespace="http//:Pojo")
serviceName corresponds to
portName corresponds to
name corresponds to
targetNamespace corresponds to targetNamespace="http//:Pojo"
Define the display of schemaLocation
@WebMethod(operationName="queryPojo",exclude=true)
operationName The method name and exclude of the interface are used to prevent a certain inherited method from being exposed as a web service. The default is false
@WebResult (name="returnWord") The return value of the interface
Parameters of the @WebParam (name="cityName") interface
(Recommendations for more related interview questions: java common interview questions)
2. Mybatis processes big data
Table partitioning is divided into horizontal partitioning (hash partitioning, time, interval partitioning) and vertical partitioning (separate tables for uncommon fields). For example, interval partitioning. If there is a cross-table query, use the keyword union union all
3. AOP IOC advantages and disadvantages
AOP disadvantages: slightly lower performance, only applicable to method calls, must be in the Spring container
AOP advantages : Obtain an object directly from the IOC container and use it directly without creating it in advance, allowing logical business decomposition and decoupling code, changing the shortcomings of OOP (Object Oriented Programming) object-oriented programming
IOC Disadvantages: Generate an The steps of the object become complicated (ignored), and there is a lack of IDE reconstruction support. If the class name is modified, it needs to be modified manually in the XML file. This seems to be the shortcoming of all XML methods
IOC advantages: Realize decoupling between components and improve the flexibility and maintainability of the program
(Learning video recommendation: java course)
4. spring transaction Propagation attributes and isolation levels
NEVER There must be no things, otherwise an error will be reported, and method calls with things will not work;
REQUIRED ordinary method calls, single things, method calls with things , just use things with method calls
REQUIRES_NEW No matter whether there are method calls of things or not, I insist on executing my own things
SUPPORTS If there are method calls of things, use yours. If there are no method calls of things, there will be no things.
Dirty Reads Dirty Reads: What the customer sees is not the real data of the database. Before the transaction is submitted, other things are not allowed to access the modified values
Phantom Reads Phantom Reads: A transaction reads Data that has been inserted in another transaction is not allowed to add new data before other transactions have processed the data
Non-Repeatable Reads: Subsequent read data reads updated data submitted by other transactions , leading to inconsistency in reading data before and after, solve the problem of reading data after modification;
5. Spring Mvc returns json technology
The first type: each json view controller Configure a Jsoniew
Second: Use JSON tools to serialize objects into json, commonly used tools Jackson, fastjson, gson
Third: Use spring mvc3 annotation @ResponseBody
The above is the detailed content of Java interview questions summarized from many years of development experience - (6). For more information, please follow other related articles on the PHP Chinese website!