-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path2019-08-01-hibernate-orm-config-profiles.adoc.po
109 lines (97 loc) · 7.11 KB
/
2019-08-01-hibernate-orm-config-profiles.adoc.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-05-12 15:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. type: YAML Front Matter: title
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy, no-wrap
msgid "Tips to use Hibernate ORM with Quarkus profiles and live coding mode"
msgstr "使用Hibernate ORM与Quarkus配置文件和实时编码模式的技巧"
#. type: YAML Front Matter: synopsis
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy, no-wrap
msgid "Hibernate ORM lets you generate or update the database schema. Let's explore when to use such option in combination with live coding."
msgstr "Hibernate ORM允许你生成或更新数据库模式。让我们探讨一下何时结合现场编码使用这种选项。"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"Quarkus live coding (aka dev mode) is really useful for applications that mix front end or services and database access.\n"
"There are a few common approaches to make the best of it."
msgstr "Quarkus 实时编码(又称开发模式)对于混合前端或服务和数据库访问的应用程序非常有用。有几种常见的方法可以充分利用它。"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"The first choice is to use `quarkus.hibernate-orm.database.generation=drop-and-create` in conjunction with `import.sql`.\n"
"That way for every change to your app and in particular to your entities, the database schema will be properly recreated\n"
"and your data fixture (stored in `import.sql`) will be used to repopulate it from scratch.\n"
"This is best to perfectly control your environment and works magic with Quarkus live coding mode:\n"
"your entity changes or any change to your `import.sql` is immediately picked up and the schema updated without restarting the application!"
msgstr "第一种选择是将 `quarkus.hibernate-orm.database.generation=drop-and-create` 与 `import.sql` 结合使用。这样,您的应用程序,特别是您的实体,每发生一次变化,数据库模式就会正确地重新创建,您的数据夹具(存储在 `import.sql` )就会被用来从头开始重新填充。这是对环境进行完美控制的最佳方式,而且与 Quarkus 实时编码模式配合使用时效果奇佳:您的实体更改或对 `import.sql` 的任何更改都会立即被接收并更新模式,而无需重启应用程序!"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"By default, Hibernate ORM, upon boot, will read and execute the SQL statements in the `/import.sql` file (if present).\n"
"You can change the file name by changing the property `quarkus.hibernate-orm.sql-load-script` in `application.properties`."
msgstr "默认情况下,Hibernate ORM 启动时将读取并执行 `/import.sql` 文件(如果存在)中的 SQL 语句。你可以通过修改 `application.properties` 中的属性 `quarkus.hibernate-orm.sql-load-script` 来更改文件名。"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"The second approach is to use `quarkus.hibernate-orm.database.generation=update`.\n"
"This approach is best when you do many entity changes but\n"
"still need to work on a copy of the production data\n"
"or if you want to reproduce a bug that is based on specific database entries.\n"
"`update` is a best effort from Hibernate ORM and will fail in specific situations\n"
"including altering your database structure which could lead to data loss.\n"
"For example if you change structures related to the foreign key, Hibernate ORM might have to bail out.\n"
"But for development, these limitations are acceptable."
msgstr "第二种方法是使用 `quarkus.hibernate-orm.database.generation=update` 。 `update` 是 Hibernate ORM 做出的最大努力,在特定情况下会失效,包括更改数据库结构可能导致数据丢失。例如,如果你改变了与外键相关的结构,Hibernate ORM 可能不得不退出。但对于开发而言,这些限制是可以接受的。"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"The third approach is to use `quarkus.hibernate-orm.database.generation=none`.\n"
"This approach is best when you are working on a copy of the production data but want to fully control the schema evolution.\n"
"Or if you use a database schema migration tool like https://quarkus.io/guides/flyway[Flyway].\n"
"When you make a change to an entity, make sure to adapt the database schema accordingly."
msgstr "第三种方法是使用 `quarkus.hibernate-orm.database.generation=none` 。如果您正在使用生产数据的副本,但又想完全控制模式的演变,那么这种方法是最好的。或者使用 link:https://quarkus.io/guides/flyway[Flyway] 等数据库模式迁移工具。当您对实体进行更改时,请确保相应地调整数据库模式。"
#. type: Plain text
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid "Do not use `quarkus.hibernate-orm.database.generation` `drop-and-create` and `update` in your production environment. You have been warned :)"
msgstr "不要在你的生产环境中使用 `quarkus.hibernate-orm.database.generation` `drop-and-create` 和 `update` 。你已经被警告了 :)"
#. type: Title ==
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy, no-wrap
msgid "Now with Quarkus profiles"
msgstr "现在有了Quarkus配置文件"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"It becomes really powerful when combined with Quarkus configuration profiles.\n"
"You can define different https://quarkus.io/guides/config#configuration-profiles[configuration profiles]\n"
"to select different behaviors depending on your environment.\n"
"This is great because you can define different combinations of Hibernate ORM properties matching the development style you currently need."
msgstr "当与 Quarkus 配置文件相结合时,它将变得非常强大。你可以定义不同的 link:https://quarkus.io/guides/config#configuration-profiles[配置文件] ,根据你的环境选择不同的行为。这非常好,因为你可以定义不同的 Hibernate ORM 属性组合,以匹配你当前需要的开发风格。"
#. type: Block title
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy, no-wrap
msgid "application.properties"
msgstr "应用程序属性"
#: _posts/2019-08-01-hibernate-orm-config-profiles.adoc
#, fuzzy
msgid ""
"I hope you have found this tip useful.\n"
"Hibernate ORM schema update, data fixture, Quarkus dev mode and its configuration profiles are a powerful combination!"
msgstr "希望本提示对您有所帮助。Hibernate ORM 模式更新、数据夹具、Quarkus 开发模式及其配置文件是一个强大的组合!"