标题示例:
Nullability annotations(普通标题,这个例子在3.3.2节)
代码块示例(例与数字之间空一格,数字后加.,如果是java文件,将xml改为java即可):
例 1. Using the Spring Data release train BOM
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>${release-train}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
语句块示例(这个例子在文档最前面):
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
超链接和无序列表示例(1.1节):
- Improved compatibility with Hibernate 5.2.
- Support any-match mode for Query by Example.
- Paged query execution optimizations.
- Support for exists projection in repository query derivation.
语句中的代码示例(1.2节第3条):
The following annotations have been enabled to build own, composed annotations: @EntityGraph
, @Lock
, @Modifying
, @Query
, @QueryHints
and @Procedure
.
代码中的序号与有序列表示例(3.1节,代码中的序号放在最长一行代码的后面,并空一格,其余序号与其保持竖直):
例 3. CrudRepository interface
public interface CrudRepository<T, ID extends Serializable>
extends Repository<T, ID> {
<S extends T> S save(S entity); 1
Optional<T> findById(ID primaryKey); 2
Iterable<T> findAll(); 3
long count(); 4
void delete(T entity); 4
boolean existsById(ID primaryKey); 6
// … more functionality omitted.
}
- Saves the given entity.
- Returns the entity identified by the given id.
- Returns all entities.
- Returns the number of entities.
- Deletes the given entity.
- Indicates whether an entity with the given id exists.