tiny fix to code example

This commit is contained in:
Gavin King 2023-09-04 11:04:31 +02:00
parent 70626c1e44
commit 6e4b4ace03
2 changed files with 2 additions and 2 deletions

View File

@ -658,7 +658,7 @@ List<String> tags;
----
@ElementCollection
@CollectionTable(name = "author_bios", // table name
joinColumns = @JoinColumn(name = "book_ssn")) // column holding foreign key of owner
joinColumns = @JoinColumn(name = "book_isbn")) // column holding foreign key of owner
@Column(name="bio") // column holding map values
@MapKeyJoinColumn(name="author_ssn") // column holding map keys
Map<Author,String> biographies;

View File

@ -1041,7 +1041,7 @@ Note that SQL expressions like `lower(title)` must be enclosed in parentheses in
====
It's not clear that information about indexes belongs in annotations of Java code.
Indexes are usually maintained and modified by a database administrator, ideally by an expert in tuning the performance of one particular RDBMS.
So it might be better to keep the definition of indexes a SQL DDL script that your DBA can easily read and modify.
So it might be better to keep the definition of indexes in a SQL DDL script that your DBA can easily read and modify.
<<automatic-schema-export,Remember>>, we can ask Hibernate to execute a DDL script using the property `javax.persistence.schema-generation.create-script-source`.
====