包含标签:Java 的文章
-
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
How about your salary? What are the employment directions?
Web development Android Development Client development Game development -
Hibernate hibernate. max_ fetch_ Depth attribute: sets the grab depth
hibernate. max_ fetch_ Depth = attribute value Example <property name="hibernate.max_fetch_depth"> 1 </…… -
Struts 2 interceptor interface: interceptor
Syntax: public interface Interceptor extends Serializable{ void destroy(); void init(); String intercept(Ac…… -
Struts 2 basic configuration file
<struts> <!—设置常量的值--> <constant name="name" value="value"></constant> …… &…… -
Hibernate criteria interface setprojection method: sets the projection column of the query
setProjection(Projection projection) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //示例化…… -
Struts 2 < include > element: contains other configuration files
Syntax: …….. < include file="file"/> Example <!DOCTYPE struts PUBLIC "-//Apache Software Foundatio…… -
The difference between Java empty string and null
String str = null; System. out. println(str.length()); if (str.length() == 0) if (str.equals("")) if (str == null) if …… -
Hibernate default_ batch_ fetch_ Size attribute: sets the default fetching quantity
hibernate. default_ batch_ fetch_ Size = attribute value Example <property name="hibernate.default_batch_fetch_si…… -
Hibernate isnotnull method: judge whether it is not null
isNotNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria…… -
JSP requestscope object: an implicit object that accesses the scope of the request
${requestScope.expression} Example ${requestScope.user} -
JSP Response. Getmaxinactivival() method: get the valid time of the session
getMaxInactiveInterval() Example <% long timeNum = session.getMaxInactiveInterval(); out.println("这个sessi…… -
JSP Response. Setstatus() method: sets the status code of the response
setStatus(int sc) Example <% response.setStatus(200); %> -
Hibernate hibernate. use_ identifer_ Rollback attribute: reset default
hibernate. use_ identifer_ Rollback = attribute value Example <property name="hibernate.use_identifer_rollback"&g…… -
Hibernate get method: load entity objects through oid
get(Class clazz,Serializable id) Example Session session = sessionFactory.openSession(); //创建session对象 UserFor…… -
Tomcat installation and startup
In addition to tomcat, commonly used servlet containers include Weblogic, JBoss, webspher, etc. Selection of Tomcat ve…… -
Why use up transformation instead of directly creating subclass objects?
Example 1 public class Animal { public void sleep() { System.out.println("小动物在睡觉"); } …… -
Spring getbeannamesfortype method: get bean name by type
getBeanNamesForType(Class type) Example public static void main(String[] args){ ApplicationContext context = new…… -
JSP Response. Getid () method: get a unique ID ID
getId() Example <% String ID = session.getId(); out.println("这个session的ID是:"+ID); %> -
Setmaxresults method of Hibernate query interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Session session = sessionFactory.openSession(conn); //获取session对象 String…… -
Createalias method of Hibernate criteria interface: establish connection query
Grammar 1 createAlias(String associationPath,String alias) Example Session session = sessionFactory.openSession(); …… -
JSP JSTL < SQL: param > tag: specify SQL parameters
parameter value Example <%@page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%&…… -
Hibernate query interface list method: returns the list collection of query results
list() Example Session session = sessionFactory.openSession(); //获取session对象 String hql = "from UserForm"; //…… -
Java uses internal classes to implement multiple inheritance
Example 1 public class Father { public int strong() { // 强壮指数 return 9; } } pu…… -
Java operates generics through reflection
Generic and class classes public class ObjectFactory { public static Object getInstance(String clsName) { …… -
Hibernate createsqlquery method: creates an sqlQuery object
createsqlQuery(String queryString) Example Session session = sessionFactory.openSession(); //创建Session对象 Strin…… -
-
Struts 2 iterator tag: tag of iterative data
< s: iterator value = "collection element" id = "ID number" status = "instance name" > < s: property / > &…… -
Java computing GPA
import java.util.InputMismatchException; import java.util.Scanner; public class Test03 { public static void…… -
Java StringBuffer replaces special characters
import java.util.Scanner; public class test2 { public static void main(String[] args) { System.out.…… -
Hibernate default_ entity_ Mode attribute: Specifies the default entity representation mode
hibernate. default_ entity_ Mode = attribute value Example <property name="hibernate.default_entity_mode"> …… -
Java perfects the error message of division operation
public class Compute { private int[] num = new int[2]; public int[] getNum() { return num; }……