search
HomeJavaJavaInterview questionsJava interview questions summarized from many years of development experience - (6)

Java interview questions summarized from many years of development experience - (6)

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 under   

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!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function