jQuery是随着Web2.0兴起的JavaScript库之一,因为其独特的优点,受到越来越多人的追捧! 1.1 JavaScript和JavaScript库 1.1.1 JavaScript简介 JS是一种脚本语言. JS的优点:是网页和用户之间实现了一种实时的.动态的和交互的关系,是网页可以包含更多活跃的元素和更加精彩的内容. JS的不足:复杂的文档对象模型(DOM).不一致的浏览器实现和便捷的开发.调试工具的缺乏. 1.1.2 JavaScript库作用及对比 JS库出现的目的是为了简化J…
  2 数组2.8 创建对象数组循环数组2.9 数组排序 2 数组 2.8 创建对象数组 //数组化对象 var student =[ { "role":101, "name":"ben", "emailid":"ben@gmail.com" }, { "role":102, "name":"Ian", "emailid":&q…
目录 第七章 C控制语句:分支和跳转 第八章 字符输入/输出和输入验证 第九章 函数 第十章 数组和指针 第七章 C控制语句:分支和跳转 if else 用法 if (expression) //expression为真时,运行花括号内语句 { statement1 } else //不为真时,运行else的花括号内语句 { statement2 } ctype.h系列的字符函数 #include <stdio.h> #include <ctype.h> //包含isalpha()…
目录 第四章 字符串和格式化输入/输出 第五章 运算符.表达式和语句 第六章 C控制语句:循环 虽然匆匆忙忙,但还是要做笔记,虽然大概都知道...... 挑一些容易忘记的地方 第四章 字符串和格式化输入/输出 C语言没有专门储存字符串的变量类型,字符串通常被存储在char类型的数组中,字符串在末尾会有一个空字符\0,一种非打印字符,ASCⅡ码是0.C语言中字符串一定以空字符结束,这意味着数组的容量至少比存储字符串的字符数多1.通常可以用'\0'字符来作为遍历字符串的结束条件. strlen()函…
目录 第一章 初识C语言 1 使用C语言的7个步骤 1.1 定义程序目标 1.2 设计程序(功能实现) 1.3 编写代码 1.4 编译 1.5 运行程序 1.6 测试和调试程序 1.7 维护和修改代码 2 windows下集成开发环境 第二章 C语言概述 1 示例程序1 1.1 程序讲解 1.1.1 头文件 1.1.2 main函数 1.1.3 注释 1.1.4 花括号.声明 1.1.5 赋值.printf函数.return语句 2 示例程序2 2.1 程序讲解 2.1.1 多条声明 2.1.2…
一.代码 1. package org.jpwh.model.inheritance.tableperclass; import org.jpwh.model.Constants; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persi…
一.结构 二.代码 1. package org.jpwh.model.inheritance.mappedsuperclass; import javax.persistence.MappedSuperclass; import javax.validation.constraints.NotNull; @MappedSuperclass public abstract class BillingDetails { @NotNull protected String owner; // ...…
There are four different strategies for representing an inheritance hierarchy: Use one table per concrete class and default runtime polymorphic behavior. Use one table per concrete class but discard polymorphism and inheritance relationships comple…
一.结构 二.Hibernate支持的UserTypes接口  UserType —You can transform values by interacting with the plain JDBC PreparedStatement (when storing data) and ResultSet (when loading data).By implementing this interface, you can also control how Hibernate caches a…
一.结构 二.代码 1. package org.jpwh.model.advanced; import java.io.Serializable; import java.math.BigDecimal; import java.util.Currency; /* This value-typed class should be <code>java.io.Serializable</code>: When Hibernate stores entity instance dat…
一.简介 1. 2. 3. 4. to override this default mapping. The JPA specification has a convenient shortcut annotation for this purpose, @Lob @Entity public class Item { @Lob protected byte[] image; @Lob protected String description; // ... } This maps the by…
一.数据库 二.代码 1. package org.jpwh.model.advanced; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.validation.constraints.NotNull;…
Each @AttributeOverride for a component property is “complete”: any JPA or Hibernate annotation on the overridden property is ignored. This means the @Column annotations on the Address class are ignored—all BILLING_* columns are NULL able!(Bean Valid…
一.数据库 二.代码 1. package org.jpwh.model.simple; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.validation.constraints.NotNull; /** * * Instead of <code>@Entity</code>, this component POJO is marked with <cod…
一.简介 在JPA中,默认所有属性都会persist,属性要属于以下3种情况,Hibernate在启动时会报错 1.java基本类型或包装类 2.有注解 @Embedded 3.有实现java.io.Serializable 二.Overriding basic property defaults 1.@javax.persistence.Transient 如果不想属性被持久化,则注解 @javax.persistence.Transient 2.@Basic(optional = false…
一.自定义映射的表名 1. @Entity @Table(name = "USERS") public class User implements Serializable { // ... } 2.用定界符 //@Table(name = "`USER`")的标准 @Table(name = "`USER`") //JPA的标准 @Table(name = "\"USER\"") 若全部SQL都加定界符,…
一.简介 1.You now have three methods for distinguishing references:  Objects are identical if they occupy the same memory location in the JVM . This can be checked with the a == b operator. This concept is known as object identity. Objects are equal i…
一.介绍 1.这种引用方式不对,但删除时不能级联 要这种引用方式 2.The Bid class could be a problem. In object-oriented modeling, this is marked as a composition (the association between Item and Bid with the diamond). Thus, an Item is the owner of its Bid instances and holds a col…
一.JpaRepository 1.要使Spring自动生成实现类的步骤 (1)配置文件xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:…
一.结构 二.Repository层 1. package spittr.db; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import spittr.domain.Spitter; /** * Repository interface with operations for {@link Spitter} persistence. * @author habuma *…
一.结构 二.Repository层 1. package spittr.db; import java.util.List; import spittr.domain.Spitter; /** * Repository interface with operations for {@link Spitter} persistence. * @author habuma */ public interface SpitterRepository { long count(); Spitter s…
一.注入EntityManagerFactory的方式 package com.habuma.spittr.persistence; import java.util.List; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import org.springframework.dao.DataAccessException; import org.springfr…
一.EntityManagerFactory的种类 1.The JPA specification defines two kinds of entity managers:  Application-managed—Entity managers are created when an application directly requests one from an entity manager factory. With application-managed entity manage…
一.结构 二.Repository层 1. package spittr.db; import java.util.List; import spittr.domain.Spitter; /** * Repository interface with operations for {@link Spitter} persistence. * @author habuma */ public interface SpitterRepository { long count(); Spitter s…
一.redirect为什么会丢数据? when a handler method completes, any model data specified in the method is copied into the request as request attributes, and the request is forwarded to the view for rendering. Because it’s the same request that’s handled by both…
No matter what happens, good or bad, the outcome of a servlet request is a servlet response. If an exception occurs during request processing, the outcome is still a servlet response. Somehow, the exception must be translated into a response. Spring…
一.用 MultipartFile 1.在html中设置<form enctype="multipart/form-data">及<input type="file"> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Spitter</title> <link rel="stylesheet&q…
一.什么是multipart The Spittr application calls for file uploads in two places. When a new user registers with the application, you’d like them to be able to provide a picture to associate with their profile. And when a user posts a new Spittle , they ma…
一.所有声明都用xml 1. <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=&quo…
一. 1.如想在DispatcherServlet在Servlet容器中注册后自定义一些操作,如开启文件上传功能,则可重写通过AbstractAnnotationConfigDispatcherServletInitializer 的customizeRegistration() 来实现 // After AbstractAnnotation ConfigDispatcherServletInitializer registers DispatcherServlet with the servl…