Java
-
Hibernate cache. use_ second_ level_ Cache attribute: determines whether to close the L2 cache
hibernate. cache. use_ second_ level_ Cache = attribute value Example <property name="hibernate.cache.use_second_…… -
Spring saveOrUpdate method: saves or updates entity objects
saveOrUpdate(Object entity) Example 1 public static void main(String[] args){ ApplicationContext context = new Cl…… -
Spring queryforint method: int type single value query
Grammar 1 queryForInt(String sql) Example public int getUserCount(){ String sql = "SELECT count(*)FROM tb_user"; …… -
What are the mainstream java web development frameworks?
Mainstream Java Web Development Framework 1) Spring framework 2) Spring MVC framework 3) Mybatis framework The word "i…… -
JSP JSTL < C: out > tag: output tag
grammar Syntax format 1: Syntax format 2: defalultValue Example <%@taglib prefix="c" uri="http://java.…… -
Spring executefind method: callback query operation
executeFind(HibernateCallback action) Example public List getSmallUser(final Integer ID){ HibernateTemplate htm =…… -
Hibernate criteria interface setprojection method: sets the projection column of the query
setProjection(Projection projection) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //示例化…… -
Createalias method of Hibernate criteria interface: establish connection query
Grammar 1 createAlias(String associationPath,String alias) Example Session session = sessionFactory.openSession(); …… -
Hibernate rollback method: rollback transaction
rollback() Example Transaction tx = null; try{ Session session = sessionFactory.openSession(); //定义Session…… -
Springweb < form: Options > tab: defines multiple options for a drop-down selection box or list box
Example 1 public class Fans{ List fanList = new ArrayList(); //定义一个List集合 public List getFanList(){ /…… -
Java collection interface
Example 1 public static void main(String[] args) { ArrayList list1 = new ArrayList(); // 创建集合 list1 Ar…… -
JSP JSTL < C: redirect > tag: redirect tag
Syntax format 1: …… Syntax format 2: Example <%@taglib prefix="c" uri="http://java.sun.com/jsp/j…… -
Implementation of java example air ticket discount in low and peak seasons
Use if else statement to realize air ticket discount in low and peak seasons public static void main(String[] args) …… -
Java imitation landlords shuffle licensing games
public class Main { public static void main(String[] args) { // 1. 准备牌 String[] arr1 = { "…… -
Struts actionsupport class: Business Controller
import com. opensymphony. xwork2. ActionSupport; // Inherit actionsupport base class public class XXX extends actionsu…… -
Java object type conversion and forced object type conversion
Example 1 Animal:动物 Animal:可爱的动物 Cat:吃饭 Animal:动物在吃饭 Cat:可爱的小猫 Cat:猫喜欢吃鱼 Force ob…… -
Differences between Java interfaces and abstract classes
Basic grammatical differences public interface Animal { // 所有动物都会吃 public void eat(); // 所…… -
Addorder method of Hibernate criteria interface: sets the collation of the result set
addOrder(Order order) Example Session session = sessionFactory.openSession(); //定义session对象 Criteria criteria …… -
Hibernate min method: calculate the minimum value of a column
min(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //获取Criteria对象 …… -
Hibernate EQ method: set equal condition
eq(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //定义Crit…… -
Hibernate cache. region_ Prefix attribute: sets the prefix name of the L2 cache
hibernate. cache. region_ Prefix = attribute value Example <property name="hibernate.cache.region_prefix"> …… -
Spring setpassword method: set the password to connect to the database
setPassword(String password) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setPassword(p…… -
Struts 2 < include > element: contains other configuration files
Syntax: …….. < include file="file"/> Example <!DOCTYPE struts PUBLIC "-//Apache Software Foundatio…… -
JSP JSTL < SQL: param > tag: specify SQL parameters
parameter value Example <%@page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%&…… -
Hibernate commit method: commit transaction
翻译错误 Invalid Access Limit Example Session session = sessionFactory.openSession(); //定义Session对象 Transactio…… -
Spring saveorupdateall method: saves or updates the collection of entity objects
saveOrUpdateAll(Collection entities)@H_ 403_ 3 @ Parameter Description: Example 1 public static void main(String[] a…… -
Spring queryforobject method: the result of the query is returned as an object type
queryForObject(String sql,Class requiredType) Example public static void main(String[] args){ ApplicationContext …… -
Spring getservletcontext method: get ServletContext context
getServletContext() Example public class LoginAction extends AbstractController{ @Override protected ModelAn…… -
Java interface: definition and implementation of interface, definition and implementation of interface
Define interface public interface A { publicA(){…} // 编译出错,接口不允许定义构造方法 } public interface…… -
Hibernate addscalar method: returns a combination of scalar and entity
addScalar(String columnAlias,Type type) Example String sql = "select avg(result.english)as avgEnglish from tb_result…… -
JSP Response. Removeattribute() method: removes the specified session attribute
removeAttribute(String name) Example <% session.removeAttribute("user"); %> -
Hibernate query interface setparameter method: bind parameters of any type
setParameter(String name,Object val) Example String hql = "from UserForm where username=:userName"; //定义查询HQL语……
