Skip to content

Commit 46074a9

Browse files
committed
HHH-16097 Moved chapters envers (to hibernate-envers), events and finished domain (collections, inheritance, immutability and naming)
1 parent eece229 commit 46074a9

File tree

70 files changed

+364
-514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+364
-514
lines changed

documentation/src/main/asciidoc/userguide/chapters/domain/access.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[[access]]
22
=== Access strategies
33
:root-project-dir: ../../../../../../..
4-
:documentation-project-dir: {root-project-dir}/documentation
54
:core-project-dir: {root-project-dir}/hibernate-core
65
:example-dir-access: {core-project-dir}/src/test/java/org/hibernate/orm/test/mapping/access
76
:extrasdir: extras

documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc

+30-32
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
=== Collections
33
:majorMinorVersion: 6.2
44
:root-project-dir: ../../../../../../..
5-
:documentation-project-dir: {root-project-dir}/documentation
6-
:example-dir-collection-doc: {documentation-project-dir}/src/test/java/org/hibernate/userguide/collections
75
:core-project-dir: {root-project-dir}/hibernate-core
86
:core-test-base: {core-project-dir}/src/test/java
97
:example-dir-collection: {core-test-base}/org/hibernate/orm/test/mapping/collections
@@ -484,7 +482,7 @@ Behind the scenes, Hibernate requires an association table to manage the parent-
484482
====
485483
[source,java]
486484
----
487-
include::{example-dir-collection-doc}/UnidirectionalBagTest.java[tags=collections-unidirectional-bag-example,indent=0]
485+
include::{example-dir-collection}/UnidirectionalBagTest.java[tags=collections-unidirectional-bag-example,indent=0]
488486
----
489487
490488
[source,sql]
@@ -507,7 +505,7 @@ By marking the parent side with the `CascadeType.ALL` attribute, the unidirectio
507505
====
508506
[source,java]
509507
----
510-
include::{example-dir-collection-doc}/UnidirectionalBagTest.java[tags=collections-unidirectional-bag-lifecycle-example,indent=0]
508+
include::{example-dir-collection}/UnidirectionalBagTest.java[tags=collections-unidirectional-bag-lifecycle-example,indent=0]
511509
----
512510
513511
[source,sql]
@@ -536,7 +534,7 @@ The `@ManyToOne` side is the owning side of the bidirectional bag association, w
536534
====
537535
[source,java]
538536
----
539-
include::{example-dir-collection-doc}/BidirectionalBagTest.java[tags=collections-bidirectional-bag-example,indent=0]
537+
include::{example-dir-collection}/BidirectionalBagTest.java[tags=collections-bidirectional-bag-example,indent=0]
540538
----
541539
542540
[source,sql]
@@ -550,7 +548,7 @@ include::{extrasdir}/collections-bidirectional-bag-example.sql[]
550548
====
551549
[source,java]
552550
----
553-
include::{example-dir-collection-doc}/BidirectionalBagTest.java[tags=collections-bidirectional-bag-lifecycle-example,indent=0]
551+
include::{example-dir-collection}/BidirectionalBagTest.java[tags=collections-bidirectional-bag-lifecycle-example,indent=0]
554552
----
555553
556554
[source,sql]
@@ -564,7 +562,7 @@ include::{extrasdir}/collections-bidirectional-bag-lifecycle-example.sql[]
564562
====
565563
[source,java]
566564
----
567-
include::{example-dir-collection-doc}/BidirectionalBagOrphanRemovalTest.java[tags=collections-bidirectional-bag-orphan-removal-example,indent=0]
565+
include::{example-dir-collection}/BidirectionalBagOrphanRemovalTest.java[tags=collections-bidirectional-bag-orphan-removal-example,indent=0]
568566
----
569567
570568
[source,sql]
@@ -594,7 +592,7 @@ When using the `@OrderBy` annotation, the mapping looks as follows:
594592
====
595593
[source,java]
596594
----
597-
include::{example-dir-collection-doc}/UnidirectionalOrderedByListTest.java[tags=collections-unidirectional-ordered-list-order-by-example,indent=0]
595+
include::{example-dir-collection}/UnidirectionalOrderedByListTest.java[tags=collections-unidirectional-ordered-list-order-by-example,indent=0]
598596
----
599597
====
600598

@@ -626,7 +624,7 @@ Another ordering option is to use the `@OrderColumn` annotation:
626624
====
627625
[source,java]
628626
----
629-
include::{example-dir-collection-doc}/UnidirectionalOrderColumnListTest.java[tags=collections-unidirectional-ordered-list-order-column-example,indent=0]
627+
include::{example-dir-collection}/UnidirectionalOrderColumnListTest.java[tags=collections-unidirectional-ordered-list-order-column-example,indent=0]
630628
----
631629
632630
[source,sql]
@@ -659,7 +657,7 @@ The mapping is similar with the <<collections-bidirectional-bag>> example, just
659657
====
660658
[source,java]
661659
----
662-
include::{example-dir-collection-doc}/BidirectionalOrderByListTest.java[tags=collections-bidirectional-ordered-list-order-by-example,indent=0]
660+
include::{example-dir-collection}/BidirectionalOrderByListTest.java[tags=collections-bidirectional-ordered-list-order-by-example,indent=0]
663661
----
664662
====
665663

@@ -672,7 +670,7 @@ When using the `@OrderColumn` annotation, the `order_id` column is going to be e
672670
====
673671
[source,java]
674672
----
675-
include::{example-dir-collection-doc}/BidirectionalOrderColumnListTest.java[tags=collections-bidirectional-ordered-list-order-column-example,indent=0]
673+
include::{example-dir-collection}/BidirectionalOrderColumnListTest.java[tags=collections-bidirectional-ordered-list-order-column-example,indent=0]
676674
----
677675
678676
[source,sql]
@@ -693,7 +691,7 @@ You can customize the ordinal of the underlying ordered list by using the https:
693691
====
694692
[source,java]
695693
----
696-
include::{example-dir-collection-doc}/OrderColumnListIndexBaseTest.java[tags=collections-customizing-ordered-list-ordinal-mapping-example,indent=0]
694+
include::{example-dir-collection}/OrderColumnListIndexBaseTest.java[tags=collections-customizing-ordered-list-ordinal-mapping-example,indent=0]
697695
----
698696
====
699697

@@ -704,7 +702,7 @@ When inserting two `Phone` records, Hibernate is going to start the List index f
704702
====
705703
[source,java]
706704
----
707-
include::{example-dir-collection-doc}/OrderColumnListIndexBaseTest.java[tags=collections-customizing-ordered-list-ordinal-persist-example,indent=0]
705+
include::{example-dir-collection}/OrderColumnListIndexBaseTest.java[tags=collections-customizing-ordered-list-ordinal-persist-example,indent=0]
708706
----
709707
710708
[source,sql]
@@ -729,7 +727,7 @@ by the number of characters of the `name` attribute.
729727
====
730728
[source,java]
731729
----
732-
include::{example-dir-collection-doc}/OrderedBySQLTest.java[tags=collections-customizing-ordered-by-sql-clause-mapping-example,indent=0]
730+
include::{example-dir-collection}/OrderedBySQLTest.java[tags=collections-customizing-ordered-by-sql-clause-mapping-example,indent=0]
733731
----
734732
====
735733

@@ -740,7 +738,7 @@ When fetching the `articles` collection, Hibernate uses the ORDER BY SQL clause
740738
====
741739
[source,java]
742740
----
743-
include::{example-dir-collection-doc}/OrderedBySQLTest.java[tags=collections-customizing-ordered-by-sql-clause-fetching-example,indent=0]
741+
include::{example-dir-collection}/OrderedBySQLTest.java[tags=collections-customizing-ordered-by-sql-clause-fetching-example,indent=0]
744742
----
745743
746744
[source,sql]
@@ -764,7 +762,7 @@ The unidirectional set uses a link table to hold the parent-child associations a
764762
====
765763
[source,java]
766764
----
767-
include::{example-dir-collection-doc}/UnidirectionalSetTest.java[tags=collections-unidirectional-set-example,indent=0]
765+
include::{example-dir-collection}/UnidirectionalSetTest.java[tags=collections-unidirectional-set-example,indent=0]
768766
----
769767
====
770768

@@ -789,7 +787,7 @@ The lifecycle is just like with bidirectional bags except for the duplicates whi
789787
====
790788
[source,java]
791789
----
792-
include::{example-dir-collection-doc}/BidirectionalSetTest.java[tags=collections-bidirectional-set-example,indent=0]
790+
include::{example-dir-collection}/BidirectionalSetTest.java[tags=collections-bidirectional-set-example,indent=0]
793791
----
794792
====
795793

@@ -809,7 +807,7 @@ A `SortedSet` that relies on the natural sorting order given by the child elemen
809807
====
810808
[source,java]
811809
----
812-
include::{example-dir-collection-doc}/UnidirectionalSortedSetTest.java[tags=collections-unidirectional-sorted-set-natural-comparator-example,indent=0]
810+
include::{example-dir-collection}/UnidirectionalSortedSetTest.java[tags=collections-unidirectional-sorted-set-natural-comparator-example,indent=0]
813811
----
814812
====
815813

@@ -822,7 +820,7 @@ To provide a custom sorting logic, Hibernate also provides a `@SortComparator` a
822820
====
823821
[source,java]
824822
----
825-
include::{example-dir-collection-doc}/UnidirectionalComparatorSortedSetTest.java[tags=collections-unidirectional-sorted-set-custom-comparator-example,indent=0]
823+
include::{example-dir-collection}/UnidirectionalComparatorSortedSetTest.java[tags=collections-unidirectional-sorted-set-custom-comparator-example,indent=0]
826824
----
827825
====
828826

@@ -836,9 +834,9 @@ The `@SortNatural` and `@SortComparator` work the same for bidirectional sorted
836834
====
837835
[source,java]
838836
----
839-
include::{example-dir-collection-doc}/BidirectionalSortedSetTest.java[tags=collections-bidirectional-sorted-set-example,indent=0]
837+
include::{example-dir-collection}/BidirectionalSortedSetTest.java[tags=collections-bidirectional-sorted-set-example,indent=0]
840838
841-
include::{example-dir-collection-doc}/UnidirectionalComparatorSortedSetTest.java[lines=75..77,indent=0]
839+
include::{example-dir-collection}/UnidirectionalComparatorSortedSetTest.java[lines=75..77,indent=0]
842840
----
843841
====
844842

@@ -871,7 +869,7 @@ A map of value type must use the `@ElementCollection` annotation, just like valu
871869
====
872870
[source,java]
873871
----
874-
include::{example-dir-collection-doc}/ElementCollectionMapTest.java[tags=collections-map-value-type-entity-key-example,indent=0]
872+
include::{example-dir-collection}/ElementCollectionMapTest.java[tags=collections-map-value-type-entity-key-example,indent=0]
875873
----
876874
877875
[source,sql]
@@ -887,7 +885,7 @@ Adding entries to the map generates the following SQL statements:
887885
====
888886
[source,java]
889887
----
890-
include::{example-dir-collection-doc}/ElementCollectionMapTest.java[tags=collections-map-value-type-entity-key-add-example,indent=0]
888+
include::{example-dir-collection}/ElementCollectionMapTest.java[tags=collections-map-value-type-entity-key-add-example,indent=0]
891889
----
892890
893891
[source,sql]
@@ -925,7 +923,7 @@ Since we want to map all the calls by their associated `java.util.Date`, not by
925923
====
926924
[source,java]
927925
----
928-
include::{example-dir-collection-doc}/MapKeyTypeTest.java[tags=collections-map-custom-key-type-mapping-example,indent=0]
926+
include::{example-dir-collection}/MapKeyTypeTest.java[tags=collections-map-custom-key-type-mapping-example,indent=0]
929927
----
930928
====
931929

@@ -940,7 +938,7 @@ Considering you have the following `PhoneNumber` interface with an implementatio
940938
====
941939
[source,java]
942940
----
943-
include::{example-dir-collection-doc}/MapKeyClassTest.java[tags=collections-map-key-class-type-mapping-example,indent=0]
941+
include::{example-dir-collection}/MapKeyClassTest.java[tags=collections-map-key-class-type-mapping-example,indent=0]
944942
----
945943
====
946944

@@ -952,7 +950,7 @@ If you want to use the `PhoneNumber` interface as a `java.util.Map` key, then yo
952950
====
953951
[source,java]
954952
----
955-
include::{example-dir-collection-doc}/MapKeyClassTest.java[tags=collections-map-key-class-mapping-example,indent=0]
953+
include::{example-dir-collection}/MapKeyClassTest.java[tags=collections-map-key-class-mapping-example,indent=0]
956954
----
957955
958956
[source,sql]
@@ -969,7 +967,7 @@ Hibernate generates the following SQL statements:
969967
====
970968
[source,java]
971969
----
972-
include::{example-dir-collection-doc}/MapKeyClassTest.java[tags=collections-map-key-class-persist-example,indent=0]
970+
include::{example-dir-collection}/MapKeyClassTest.java[tags=collections-map-key-class-persist-example,indent=0]
973971
----
974972
975973
[source,sql]
@@ -986,7 +984,7 @@ Hibernate generates the following SQL statements:
986984
====
987985
[source,java]
988986
----
989-
include::{example-dir-collection-doc}/MapKeyClassTest.java[tags=collections-map-key-class-fetch-example,indent=0]
987+
include::{example-dir-collection}/MapKeyClassTest.java[tags=collections-map-key-class-fetch-example,indent=0]
990988
----
991989
992990
[source,sql]
@@ -1013,7 +1011,7 @@ The `@MapKey` annotation is used to define the entity attribute used as a key of
10131011
====
10141012
[source,java]
10151013
----
1016-
include::{example-dir-collection-doc}/UnidirectionalMapTest.java[tags=collections-map-unidirectional-example,indent=0]
1014+
include::{example-dir-collection}/UnidirectionalMapTest.java[tags=collections-map-unidirectional-example,indent=0]
10171015
----
10181016
10191017
[source,sql]
@@ -1034,7 +1032,7 @@ In the following example, you can see that `@MapKeyEnumerated` was used so that
10341032
====
10351033
[source,java]
10361034
----
1037-
include::{example-dir-collection-doc}/BidirectionalMapTest.java[tags=collections-map-bidirectional-example,indent=0]
1035+
include::{example-dir-collection}/BidirectionalMapTest.java[tags=collections-map-bidirectional-example,indent=0]
10381036
----
10391037
10401038
[source,sql]
@@ -1068,7 +1066,7 @@ but now, Hibernate will leverage the native array data types if possible.
10681066
====
10691067
[source,java]
10701068
----
1071-
include::{example-dir-collection-doc}/ArrayTest.java[tags=collections-array-as-basic-example,indent=0]
1069+
include::{example-dir-collection}/ArrayTest.java[tags=collections-array-as-basic-example,indent=0]
10721070
----
10731071
10741072
[source,sql]
@@ -1091,7 +1089,7 @@ default mapped like basic arrays as depicted in the <<collections-array-as-basic
10911089
====
10921090
[source,java]
10931091
----
1094-
include::{example-dir-collection-doc}/CollectionTest.java[tags=collections-as-basic-example,indent=0]
1092+
include::{example-dir-collection}/CollectionTest.java[tags=collections-as-basic-example,indent=0]
10951093
----
10961094
10971095
[source,sql]

documentation/src/main/asciidoc/userguide/chapters/domain/dynamic_model.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
=== Dynamic Model
33
:root-project-dir: ../../../../../../..
44
:core-project-dir: {root-project-dir}/hibernate-core
5-
:documentation-project-dir: {root-project-dir}/documentation
65
:example-dir-dynamic: {core-project-dir}/src/test/java/org/hibernate/orm/test/mapping/dynamic
76
:example-dir-resources: {core-project-dir}/src/test/resources/org/hibernate/orm/test/mapping/dynamic
87
:extrasdir: extras

documentation/src/main/asciidoc/userguide/chapters/domain/inheritance.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[entity-inheritance]]
22
=== Inheritance
33
:root-project-dir: ../../../../../../..
4-
:documentation-project-dir: {root-project-dir}/documentation
5-
:example-dir-inheritance: {documentation-project-dir}/src/test/java/org/hibernate/userguide/inheritance
4+
:core-project-dir: {root-project-dir}/hibernate-core
5+
:example-dir-inheritance: {core-project-dir}/src/test/java/org/hibernate/orm/test/inheritance
66
:extrasdir: extras/inheritance
77

88
Although relational database systems don't provide support for inheritance, Hibernate provides several strategies to leverage this object-oriented trait onto domain model entities:

documentation/src/main/asciidoc/userguide/chapters/domain/naming.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[naming]]
22
=== Naming strategies
33
:root-project-dir: ../../../../../../..
4-
:documentation-project-dir: {root-project-dir}/documentation
5-
:example-dir-naming: {documentation-project-dir}/src/test/java/org/hibernate/userguide/naming
4+
:core-project-dir: {root-project-dir}/hibernate-core
5+
:example-dir-naming: {core-project-dir}/src/test/java/org/hibernate/orm/test/naming
66

77
Part of the mapping of an object model to the relational database is
88
mapping names from the object model to the corresponding database names.

documentation/src/main/asciidoc/userguide/chapters/envers/Envers.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[envers]]
22
== Envers
33
:root-project-dir: ../../../../../../..
4-
:documentation-project-dir: {root-project-dir}/documentation
5-
:example-dir-envers: {documentation-project-dir}/src/test/java/org/hibernate/userguide/envers
4+
:envers-project-dir: {root-project-dir}/hibernate-envers
5+
:example-dir-envers: {envers-project-dir}/src/test/java/org/hibernate/orm/test/envers
66
:extrasdir: extras
77

88
[[envers-basics]]

documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[events]]
22
== Interceptors and events
33
:root-project-dir: ../../../../../../..
4-
:documentation-project-dir: {root-project-dir}/documentation
5-
:example-dir-event: {documentation-project-dir}/src/test/java/org/hibernate/userguide/events
4+
:core-project-dir: {root-project-dir}/hibernate-core
5+
:example-dir-event: {core-project-dir}/src/test/java/org/hibernate/orm/test/events
66
:extrasdir: extras
77

88
It is useful for the application to react to certain events that occur inside Hibernate.

documentation/src/test/java/org/hibernate/userguide/osgi/_native/HibernateUtil.java

-35
This file was deleted.

0 commit comments

Comments
 (0)