Skip to content

Commit

Permalink
HSEARCH-4805 Remove workarounds related to HHH-15604 from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Jul 3, 2023
1 parent 557843c commit 34ea60c
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,28 +365,26 @@ public static class ContainingEmbeddable {
@JoinColumn(name = "CEmbIdxEmbedded")
@IndexedEmbedded(includePaths = { "indexedField", "indexedElementCollectionField", "containedDerivedField" },
name = "containedIndexedEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedIndexedEmbedded;
private ContainedEntity containedIndexedEmbedded;

@ManyToOne
@JoinColumn(name = "CEmbNonIdxEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedNonIndexedEmbedded;
private ContainedEntity containedNonIndexedEmbedded;

public ContainedEntity getEmbContainedIndexedEmbedded() {
return embContainedIndexedEmbedded;
public ContainedEntity getContainedIndexedEmbedded() {
return containedIndexedEmbedded;
}

public void setEmbContainedIndexedEmbedded(ContainedEntity embContainedIndexedEmbedded) {
this.embContainedIndexedEmbedded = embContainedIndexedEmbedded;
public void setContainedIndexedEmbedded(ContainedEntity containedIndexedEmbedded) {
this.containedIndexedEmbedded = containedIndexedEmbedded;
}

public ContainedEntity getEmbContainedNonIndexedEmbedded() {
return embContainedNonIndexedEmbedded;
public ContainedEntity getContainedNonIndexedEmbedded() {
return containedNonIndexedEmbedded;
}

public void setEmbContainedNonIndexedEmbedded(ContainedEntity embContainedNonIndexedEmbedded) {
this.embContainedNonIndexedEmbedded = embContainedNonIndexedEmbedded;
public void setContainedNonIndexedEmbedded(ContainedEntity containedNonIndexedEmbedded) {
this.containedNonIndexedEmbedded = containedNonIndexedEmbedded;
}

static final ContainingEmbeddablePrimitives<ContainingEmbeddable, ContainedEntity> PRIMITIVES =
Expand All @@ -398,15 +396,15 @@ public ContainingEmbeddable newInstance() {

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedIndexedEmbedded,
ContainingEmbeddable::getEmbContainedIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedIndexedEmbedded,
ContainingEmbeddable::getContainedIndexedEmbedded
);
}

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedNonIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedNonIndexedEmbedded,
ContainingEmbeddable::getEmbContainedNonIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedNonIndexedEmbedded,
ContainingEmbeddable::getContainedNonIndexedEmbedded
);
}
};
Expand Down Expand Up @@ -491,7 +489,7 @@ public static class ContainedEntity {
inverseJoinColumns = @JoinColumn(name = "containing"))
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainedIndexedEmbedded")
@PropertyValue(propertyName = "containedIndexedEmbedded")
}))
private List<ContainingEntity> containingAsElementCollectionAssociationsIndexedEmbedded = new ArrayList<>();

Expand All @@ -506,7 +504,7 @@ public static class ContainedEntity {
inverseJoinColumns = @JoinColumn(name = "containing"))
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainedNonIndexedEmbedded")
@PropertyValue(propertyName = "containedNonIndexedEmbedded")
}))
private List<ContainingEntity> containingAsElementCollectionAssociationsNonIndexedEmbedded = new ArrayList<>();

Expand Down Expand Up @@ -804,11 +802,11 @@ public PropertyAccessor<ContainedEntity, String> fieldUsedInCrossEntityDerivedFi

public static class ContainedEmbeddable {

@OneToMany(mappedBy = "embeddedAssociations.embContainedIndexedEmbedded")
@OneToMany(mappedBy = "embeddedAssociations.containedIndexedEmbedded")
@OrderBy("id asc") // Make sure the iteration order is predictable
private List<ContainingEntity> containingAsIndexedEmbedded = new ArrayList<>();

@OneToMany(mappedBy = "embeddedAssociations.embContainedNonIndexedEmbedded")
@OneToMany(mappedBy = "embeddedAssociations.containedNonIndexedEmbedded")
@OrderBy("id asc") // Make sure the iteration order is predictable
private List<ContainingEntity> containingAsNonIndexedEmbedded = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static class ContainingEntity {
@JoinColumn(name = "CECAssocIdxEmb")
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainingAsIndexedEmbedded")
@PropertyValue(propertyName = "containingAsIndexedEmbedded")
}))
@IndexedEmbedded(includePaths = { "indexedField", "indexedElementCollectionField", "containedDerivedField" })
private ContainedEntity containedElementCollectionAssociationsIndexedEmbedded;
Expand All @@ -177,7 +177,7 @@ public static class ContainingEntity {
@JoinColumn(name = "CECAssocNonIdxEmb")
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainingAsNonIndexedEmbedded")
@PropertyValue(propertyName = "containingAsNonIndexedEmbedded")
}))
private ContainedEntity containedElementCollectionAssociationsNonIndexedEmbedded;

Expand Down Expand Up @@ -404,30 +404,28 @@ public PropertyAccessor<ContainingEntity, String> nonIndexedField() {

public static class ContainingEmbeddable {

@OneToOne(mappedBy = "embeddedAssociations.embContainingAsIndexedEmbedded")
@OneToOne(mappedBy = "embeddedAssociations.containingAsIndexedEmbedded")
@IndexedEmbedded(includePaths = { "indexedField", "indexedElementCollectionField", "containedDerivedField" },
name = "containedIndexedEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedIndexedEmbedded;
private ContainedEntity containedIndexedEmbedded;

@OneToOne(mappedBy = "embeddedAssociations.embContainingAsNonIndexedEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedNonIndexedEmbedded;
@OneToOne(mappedBy = "embeddedAssociations.containingAsNonIndexedEmbedded")
private ContainedEntity containedNonIndexedEmbedded;

public ContainedEntity getEmbContainedIndexedEmbedded() {
return embContainedIndexedEmbedded;
public ContainedEntity getContainedIndexedEmbedded() {
return containedIndexedEmbedded;
}

public void setEmbContainedIndexedEmbedded(ContainedEntity embContainedIndexedEmbedded) {
this.embContainedIndexedEmbedded = embContainedIndexedEmbedded;
public void setContainedIndexedEmbedded(ContainedEntity containedIndexedEmbedded) {
this.containedIndexedEmbedded = containedIndexedEmbedded;
}

public ContainedEntity getEmbContainedNonIndexedEmbedded() {
return embContainedNonIndexedEmbedded;
public ContainedEntity getContainedNonIndexedEmbedded() {
return containedNonIndexedEmbedded;
}

public void setEmbContainedNonIndexedEmbedded(ContainedEntity embContainedNonIndexedEmbedded) {
this.embContainedNonIndexedEmbedded = embContainedNonIndexedEmbedded;
public void setContainedNonIndexedEmbedded(ContainedEntity containedNonIndexedEmbedded) {
this.containedNonIndexedEmbedded = containedNonIndexedEmbedded;
}

static final ContainingEmbeddablePrimitives<ContainingEmbeddable, ContainedEntity> PRIMITIVES =
Expand All @@ -439,15 +437,15 @@ public ContainingEmbeddable newInstance() {

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedIndexedEmbedded,
ContainingEmbeddable::getEmbContainedIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedIndexedEmbedded,
ContainingEmbeddable::getContainedIndexedEmbedded
);
}

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedNonIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedNonIndexedEmbedded,
ContainingEmbeddable::getEmbContainedNonIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedNonIndexedEmbedded,
ContainingEmbeddable::getContainedNonIndexedEmbedded
);
}
};
Expand Down Expand Up @@ -817,28 +815,26 @@ public static class ContainedEmbeddable {

@OneToOne
@JoinColumn(name = "CEmbIdxEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainingEntity embContainingAsIndexedEmbedded;
private ContainingEntity containingAsIndexedEmbedded;

@OneToOne
@JoinColumn(name = "CEmbNonIdxEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainingEntity embContainingAsNonIndexedEmbedded;
private ContainingEntity containingAsNonIndexedEmbedded;

public ContainingEntity getEmbContainingAsIndexedEmbedded() {
return embContainingAsIndexedEmbedded;
public ContainingEntity getContainingAsIndexedEmbedded() {
return containingAsIndexedEmbedded;
}

public void setEmbContainingAsIndexedEmbedded(ContainingEntity embContainingAsIndexedEmbedded) {
this.embContainingAsIndexedEmbedded = embContainingAsIndexedEmbedded;
public void setContainingAsIndexedEmbedded(ContainingEntity containingAsIndexedEmbedded) {
this.containingAsIndexedEmbedded = containingAsIndexedEmbedded;
}

public ContainingEntity getEmbContainingAsNonIndexedEmbedded() {
return embContainingAsNonIndexedEmbedded;
public ContainingEntity getContainingAsNonIndexedEmbedded() {
return containingAsNonIndexedEmbedded;
}

public void setEmbContainingAsNonIndexedEmbedded(ContainingEntity embContainingAsNonIndexedEmbedded) {
this.embContainingAsNonIndexedEmbedded = embContainingAsNonIndexedEmbedded;
public void setContainingAsNonIndexedEmbedded(ContainingEntity containingAsNonIndexedEmbedded) {
this.containingAsNonIndexedEmbedded = containingAsNonIndexedEmbedded;
}

static ContainedEmbeddablePrimitives<ContainedEmbeddable, ContainingEntity> PRIMITIVES =
Expand All @@ -850,15 +846,15 @@ public ContainedEmbeddable newInstance() {

@Override
public PropertyAccessor<ContainedEmbeddable, ContainingEntity> containingAsIndexedEmbedded() {
return PropertyAccessor.create( ContainedEmbeddable::setEmbContainingAsIndexedEmbedded,
ContainedEmbeddable::getEmbContainingAsIndexedEmbedded
return PropertyAccessor.create( ContainedEmbeddable::setContainingAsIndexedEmbedded,
ContainedEmbeddable::getContainingAsIndexedEmbedded
);
}

@Override
public PropertyAccessor<ContainedEmbeddable, ContainingEntity> containingAsNonIndexedEmbedded() {
return PropertyAccessor.create( ContainedEmbeddable::setEmbContainingAsNonIndexedEmbedded,
ContainedEmbeddable::getEmbContainingAsNonIndexedEmbedded
return PropertyAccessor.create( ContainedEmbeddable::setContainingAsNonIndexedEmbedded,
ContainedEmbeddable::getContainingAsNonIndexedEmbedded
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static class ContainingEntity {
@JoinColumn(name = "CECAssocIdxEmb")
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainingAsIndexedEmbedded")
@PropertyValue(propertyName = "containingAsIndexedEmbedded")
}))
@IndexedEmbedded(includePaths = { "indexedField", "indexedElementCollectionField", "containedDerivedField" })
private ContainedEntity containedElementCollectionAssociationsIndexedEmbedded;
Expand All @@ -200,7 +200,7 @@ public static class ContainingEntity {
@JoinColumn(name = "CECAssocNonIdxEmb")
@AssociationInverseSide(inversePath = @ObjectPath({
@PropertyValue(propertyName = "elementCollectionAssociations"),
@PropertyValue(propertyName = "embContainingAsNonIndexedEmbedded")
@PropertyValue(propertyName = "containingAsNonIndexedEmbedded")
}))
private ContainedEntity containedElementCollectionAssociationsNonIndexedEmbedded;

Expand Down Expand Up @@ -427,30 +427,28 @@ public PropertyAccessor<ContainingEntity, String> nonIndexedField() {

public static class ContainingEmbeddable {

@OneToOne(mappedBy = "embeddedAssociations.embContainingAsIndexedEmbedded")
@OneToOne(mappedBy = "embeddedAssociations.containingAsIndexedEmbedded")
@IndexedEmbedded(includePaths = { "indexedField", "indexedElementCollectionField", "containedDerivedField" },
name = "containedIndexedEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedIndexedEmbedded;
private ContainedEntity containedIndexedEmbedded;

@OneToOne(mappedBy = "embeddedAssociations.embContainingAsNonIndexedEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainedEntity embContainedNonIndexedEmbedded;
@OneToOne(mappedBy = "embeddedAssociations.containingAsNonIndexedEmbedded")
private ContainedEntity containedNonIndexedEmbedded;

public ContainedEntity getEmbContainedIndexedEmbedded() {
return embContainedIndexedEmbedded;
public ContainedEntity getContainedIndexedEmbedded() {
return containedIndexedEmbedded;
}

public void setEmbContainedIndexedEmbedded(ContainedEntity embContainedIndexedEmbedded) {
this.embContainedIndexedEmbedded = embContainedIndexedEmbedded;
public void setContainedIndexedEmbedded(ContainedEntity containedIndexedEmbedded) {
this.containedIndexedEmbedded = containedIndexedEmbedded;
}

public ContainedEntity getEmbContainedNonIndexedEmbedded() {
return embContainedNonIndexedEmbedded;
public ContainedEntity getContainedNonIndexedEmbedded() {
return containedNonIndexedEmbedded;
}

public void setEmbContainedNonIndexedEmbedded(ContainedEntity embContainedNonIndexedEmbedded) {
this.embContainedNonIndexedEmbedded = embContainedNonIndexedEmbedded;
public void setContainedNonIndexedEmbedded(ContainedEntity containedNonIndexedEmbedded) {
this.containedNonIndexedEmbedded = containedNonIndexedEmbedded;
}

static final ContainingEmbeddablePrimitives<ContainingEmbeddable, ContainedEntity> PRIMITIVES =
Expand All @@ -462,15 +460,15 @@ public ContainingEmbeddable newInstance() {

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedIndexedEmbedded,
ContainingEmbeddable::getEmbContainedIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedIndexedEmbedded,
ContainingEmbeddable::getContainedIndexedEmbedded
);
}

@Override
public PropertyAccessor<ContainingEmbeddable, ContainedEntity> containedNonIndexedEmbedded() {
return PropertyAccessor.create( ContainingEmbeddable::setEmbContainedNonIndexedEmbedded,
ContainingEmbeddable::getEmbContainedNonIndexedEmbedded
return PropertyAccessor.create( ContainingEmbeddable::setContainedNonIndexedEmbedded,
ContainingEmbeddable::getContainedNonIndexedEmbedded
);
}
};
Expand Down Expand Up @@ -848,29 +846,27 @@ public static class ContainedEmbeddable {
@OneToOne(fetch = FetchType.LAZY)
@LazyGroup("embeddable_containingAsIndexedEmbedded")
@JoinColumn(name = "CEmbIdxEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainingEntity embContainingAsIndexedEmbedded;
private ContainingEntity containingAsIndexedEmbedded;

@OneToOne(fetch = FetchType.LAZY)
@LazyGroup("embeddable_containingAsNonIndexedEmbedded")
@JoinColumn(name = "CEmbNonIdxEmbedded")
// TODO Remove the "emb" prefix from this field when HHH-15604 gets fixed (it's just a workaround)
private ContainingEntity embContainingAsNonIndexedEmbedded;
private ContainingEntity containingAsNonIndexedEmbedded;

public ContainingEntity getEmbContainingAsIndexedEmbedded() {
return embContainingAsIndexedEmbedded;
public ContainingEntity getContainingAsIndexedEmbedded() {
return containingAsIndexedEmbedded;
}

public void setEmbContainingAsIndexedEmbedded(ContainingEntity embContainingAsIndexedEmbedded) {
this.embContainingAsIndexedEmbedded = embContainingAsIndexedEmbedded;
public void setContainingAsIndexedEmbedded(ContainingEntity containingAsIndexedEmbedded) {
this.containingAsIndexedEmbedded = containingAsIndexedEmbedded;
}

public ContainingEntity getEmbContainingAsNonIndexedEmbedded() {
return embContainingAsNonIndexedEmbedded;
public ContainingEntity getContainingAsNonIndexedEmbedded() {
return containingAsNonIndexedEmbedded;
}

public void setEmbContainingAsNonIndexedEmbedded(ContainingEntity embContainingAsNonIndexedEmbedded) {
this.embContainingAsNonIndexedEmbedded = embContainingAsNonIndexedEmbedded;
public void setContainingAsNonIndexedEmbedded(ContainingEntity containingAsNonIndexedEmbedded) {
this.containingAsNonIndexedEmbedded = containingAsNonIndexedEmbedded;
}

static ContainedEmbeddablePrimitives<ContainedEmbeddable, ContainingEntity> PRIMITIVES =
Expand All @@ -882,15 +878,15 @@ public ContainedEmbeddable newInstance() {

@Override
public PropertyAccessor<ContainedEmbeddable, ContainingEntity> containingAsIndexedEmbedded() {
return PropertyAccessor.create( ContainedEmbeddable::setEmbContainingAsIndexedEmbedded,
ContainedEmbeddable::getEmbContainingAsIndexedEmbedded
return PropertyAccessor.create( ContainedEmbeddable::setContainingAsIndexedEmbedded,
ContainedEmbeddable::getContainingAsIndexedEmbedded
);
}

@Override
public PropertyAccessor<ContainedEmbeddable, ContainingEntity> containingAsNonIndexedEmbedded() {
return PropertyAccessor.create( ContainedEmbeddable::setEmbContainingAsNonIndexedEmbedded,
ContainedEmbeddable::getEmbContainingAsNonIndexedEmbedded
return PropertyAccessor.create( ContainedEmbeddable::setContainingAsNonIndexedEmbedded,
ContainedEmbeddable::getContainingAsNonIndexedEmbedded
);
}
};
Expand Down

0 comments on commit 34ea60c

Please sign in to comment.