Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 2.38 KB

翻译格式规范示例.md

File metadata and controls

76 lines (50 loc) · 2.38 KB

翻译格式规范示例

标题示例:

1. New & Noteworthy(一级标题)

1.1. What’s new in Spring Data JPA 1.11(二级标题)

3.3.1. Fine-tuning repository definition(三级标题)

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.
}
  1. Saves the given entity.
  2. Returns the entity identified by the given id.
  3. Returns all entities.
  4. Returns the number of entities.
  5. Deletes the given entity.
  6. Indicates whether an entity with the given id exists.