Skip to content

Commit fb22faf

Browse files
jrenaatsebersole
authored andcommitted
HHH-19660 - Clean up uses of 'bi-directional'
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 5140ea7 commit fb22faf

File tree

20 files changed

+27
-27
lines changed

20 files changed

+27
-27
lines changed

design/fk.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ key-side:: `orders.customer_fk`
2424
target-side:: `customers.id`
2525

2626

27-
Assuming bi-directionality, we have 2 `Association` refs:
27+
Assuming bidirectionality, we have 2 `Association` refs:
2828

2929
* `Order#customer` which models the key-side of the FK,
3030
* `Customer#orders` which models the target-side

documentation/src/main/asciidoc/userguide/chapters/pc/BytecodeEnhancement.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ include::{example-dir-enhancement}/BytecodeEnhancementTest.java[tags=BytecodeEnh
9797
----
9898
====
9999

100-
Bytecode-enhanced bi-directional association management makes that first example work by managing the "other side" of a bi-directional association whenever one side is manipulated.
100+
Bytecode-enhanced bidirectional association management makes that first example work by managing the "other side" of a bidirectional association whenever one side is manipulated.
101101

102102
[IMPORTANT]
103103
Hibernate's bidirectional association management bytecode enhancement feature has been deprecated. Users should instead manage both sides of such associations directly.

hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static Implementation wrap(
6666
if ( bidirectionalAttributeName == null || bidirectionalAttributeName.isEmpty() ) {
6767
if ( log.isInfoEnabled() ) {
6868
log.infof(
69-
"Bi-directional association not managed for field [%s#%s]: Could not find target field in [%s]",
69+
"Bidirectional association not managed for field [%s#%s]: Could not find target field in [%s]",
7070
managedCtClass.getName(),
7171
persistentField.getName(),
7272
targetEntity.getCanonicalName()
@@ -122,7 +122,7 @@ static Implementation wrap(
122122
if ( persistentField.getType().asErasure().isAssignableTo( Map.class ) || targetType.isAssignableTo( Map.class ) ) {
123123
if ( log.isInfoEnabled() ) {
124124
log.infof(
125-
"Bi-directional association not managed for field [%s#%s]: @ManyToMany in java.util.Map attribute not supported ",
125+
"Bidirectional association not managed for field [%s#%s]: @ManyToMany in java.util.Map attribute not supported ",
126126
managedCtClass.getName(),
127127
persistentField.getName()
128128
);
@@ -169,7 +169,7 @@ public static TypeDescription getTargetEntityClass(TypeDescription managedCtClas
169169
if ( targetClass == null ) {
170170
if ( log.isInfoEnabled() ) {
171171
log.infof(
172-
"Bi-directional association not managed for field [%s#%s]: Could not find target type",
172+
"Bidirectional association not managed for field [%s#%s]: Could not find target type",
173173
managedCtClass.getName(),
174174
persistentField.getName()
175175
);
@@ -208,7 +208,7 @@ private static String getMappedBy(AnnotatedFieldDescription target, TypeDescript
208208
return null;
209209
}
210210
else {
211-
// HHH-13446 - mappedBy from annotation may not be a valid bi-directional association, verify by calling isValidMappedBy()
211+
// HHH-13446 - mappedBy from annotation may not be a valid bidirectional association, verify by calling isValidMappedBy()
212212
return isValidMappedBy( target, targetEntity, mappedBy, context ) ? mappedBy : null;
213213
}
214214
}

hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancementContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public interface EnhancementContext {
6161
boolean isMappedSuperclassClass(UnloadedClass classDescriptor);
6262

6363
/**
64-
* Should we manage association of bi-directional persistent attributes for this field?
64+
* Should we manage association of bidirectional persistent attributes for this field?
6565
*
6666
* @param field The field to check.
6767
*
68-
* @return {@code true} indicates that the field is enhanced so that for bi-directional persistent fields
68+
* @return {@code true} indicates that the field is enhanced so that for bidirectional persistent fields
6969
* the association is managed, i.e. the associations are automatically set; {@code false} indicates that
7070
* the management is handled by the user.
7171
* @deprecated Will be removed without replacement. See HHH-19660

hibernate-core/src/main/java/org/hibernate/sql/results/graph/BiDirectionalFetch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* ```
4141
*
4242
*
43-
* Here we have one root result and 3 fetches. 2 of the fetches are bi-directional:
43+
* Here we have one root result and 3 fetches. 2 of the fetches are bidirectional:
4444
*
4545
* `o`:: The paths `p` and `p.address.owner` (aliased as `o`) are the same table reference in SQL terms
4646
* `oa`:: The paths `p.address` and `p.address.owner.address` (aliased as `oa`) are again the same table reference

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/list/ListMappingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void accept(String action) {
104104
}
105105

106106
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107-
// Bi-directional model
107+
// Bidirectional model
108108

109109
@Entity( name = "Order" )
110110
@Table( name = "t_order" )

hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/enhancement/association/OneToManyAssociationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static class Customer {
7474

7575
String name;
7676

77-
// HHH-13446 - Type not validated in bi-directional association mapping
77+
// HHH-13446 - Type not validated in bidirectional association mapping
7878
@OneToMany(cascade = CascadeType.ALL, mappedBy = "custId", fetch = FetchType.EAGER)
7979
List<CustomerInventory> inventoryIdList = new ArrayList<>();
8080

hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/enhancement/association/OneToOneAssociationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void test() {
3333

3434
assertEquals( customer, user.getCustomer() );
3535

36-
// check dirty tracking is set automatically with bi-directional association management
36+
// check dirty tracking is set automatically with bidirectional association management
3737
EnhancerTestUtils.checkDirtyTracking( user, "login", "customer" );
3838

3939
User anotherUser = new User();
@@ -59,7 +59,7 @@ public void testSetNull() {
5959

6060
assertEquals( customer, user.getCustomer() );
6161

62-
// check dirty tracking is set automatically with bi-directional association management
62+
// check dirty tracking is set automatically with bidirectional association management
6363
EnhancerTestUtils.checkDirtyTracking( user, "login", "customer" );
6464

6565
user.setCustomer( null );

hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/enhancement/basic/ExtendedAssociationManagementTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void test() {
3535

3636
assertEquals( customer, getFieldByReflection( user, "customer" ) );
3737

38-
// check dirty tracking is set automatically with bi-directional association management
38+
// check dirty tracking is set automatically with bidirectional association management
3939
EnhancerTestUtils.checkDirtyTracking( user, "login", "customer" );
4040

4141
User anotherUser = new User();

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/graphs/EntityGraphTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void loadInverseCollection() {
171171
assertTrue( Hibernate.isInitialized( result.bar ) );
172172
assertTrue( Hibernate.isInitialized( result.bar.getFoos()) );
173173
assertTrue( Hibernate.isInitialized( result.baz ) );
174-
// sanity check -- ensure the only bi-directional fetch was the one identified by the graph
174+
// sanity check -- ensure the only bidirectional fetch was the one identified by the graph
175175
assertFalse( Hibernate.isInitialized( result.baz.getFoos()) );
176176

177177
em.getTransaction().commit();

0 commit comments

Comments
 (0)