包含标签: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_…… -
Differences between Java interfaces and abstract classes
Basic grammatical differences public interface Animal { // 所有动物都会吃 public void eat(); // 所…… -
Hibernate addclass method: load entity class
addClass(Class persistentClass) Example Configuration config = new Configuration(); //创建Configuration对象 Config…… -
Hibernate criteria interface setfirsresult method: sets the starting point of the result set
setFirstResult(int firstResult) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
JSP JSTL < FMT: formatdate > tag: format time
Example 1@H_502_112 @This example uses the < FMT: formatdate > tag to format the current time into different …… -
Hibernate alleq method: set a series of equality conditions
Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 Map map = new HashMap(); /…… -
Hibernate like method: set the condition of fuzzy query
like(String propertyName,Object value) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //创建…… -
Hibernate AVG method: calculate the average value of a column
avg(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //定义Criteria对象 …… -
JSP Response. Isnew() method: judge whether the current user is a new user
isNew() Example <% out.print(session.isNew()); %> -
Setmaxresults method of Hibernate criteria interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria示…… -
Struts2 ServletActionContext. Getservletcontext() method: get ServletContext object
public static ServletContext getServletContext() Example //获取上下文 ServletContext context = ServletActionContext…… -
Spring deleteall method: deletes all entity objects in the specified collection
deleteAll(Collection entities) Example public void delBoyUser(Collection users){ HibernateTemplate htm = getHiber…… -
Spring update method: updates the specified entity object
update(Object entity) Example public static void main(String[] args){ ApplicationContext context = new ClassPathX…… -
Hibernate query interface setdouble method: bind parameters with mapping type of double
Grammar 1 setDouble(int position,double val) Example String hql = "from GoodsForm where price=?"; //定义查询HQL语句…… -
Spring GetUserName method: get the user name to access the database
getUsername() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Spring saveOrUpdate method: saves or updates entity objects
saveOrUpdate(Object entity) Example 1 public static void main(String[] args){ ApplicationContext context = new Cl…… -
Addorder method of Hibernate criteria interface: sets the collation of the result set
addOrder(Order order) Example Session session = sessionFactory.openSession(); //定义session对象 Criteria criteria …… -
Object serialization control input and output
What is object serialization public interface Serializable { } serialize public ObjectOutputStream (OutputStream ou…… -
JSP Session. Getattribute () method: get the attribute value according to the attribute name
getAttribute(String name) Example <% session.getAttribute("user"); %> Typical application <form name=…… -
Online examination system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives Functional structure System business process development…… -
Java 9 enhanced “diamond” syntax
List<String> strList = new ArrayList<String>(); Map<String,Integer> scores = new HashMap<Strin…… -
JSP JSTL < x: choose > tag: complete condition judgment
body content( and subtags) Example <%@taglib prefix="x" uri="http://java.sun.com/jsp…… -
Hibernate load method: load entity objects through oid
load(Class theClass,Serializable id) Example Session session = sessionFactory.openSession(); //创建Session对象 Use…… -
Library management system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives System functional structure System flow development envi…… -
Hibernate query interface setentity method: used to bind entity class parameters
setEntity(String name,Object val) Example Dept d = new Dept(); //定义表示部门实体的JavaBean对象 d.setId(3); //设…… -
New method for map in Java 8
public class MapTest { public static void main(String[] args) { Map map = new HashMap(); // …… -
JSP JSTL < x: when > Tags: execute code according to conditions
< x: when select = "XPATHexpression" > body content < / X: when > Example <%@taglib prefix="x" uri="h…… -
Hibernate hibernate. use_ sql_ Comments attribute: Specifies whether to output comment information
hibernate. use_ sql_ Comments = attribute value Example <property name="hibernate.use_sql_comments"> true …… -
Struts 2 set tag: defines a variable
Example <body> <!--将表达式user.username的值保存在默认范围中,即action范围--> <s:set name="…… -
Hibernate dialect property: Specifies the SQL dialect of the database
hibernate. Dialect = attribute value Example 1 <property name="hibernate.dialect"> org.hibernate.dialect.sq…… -
Spring queryforint method: int type single value query
Grammar 1 queryForInt(String sql) Example public int getUserCount(){ String sql = "SELECT count(*)FROM tb_user"; …… -
Hibernate min method: calculate the minimum value of a column
min(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //获取Criteria对象 ……