Skip to content

Commit

Permalink
HSEARCH-4001 Use ReindexOnUpdate.SHALLOW instead of ReindexOnUpdate.N…
Browse files Browse the repository at this point in the history
…O in migration helper tests where relevant

That's closer to how Search 5 used to behave.
  • Loading branch information
yrodiere committed Sep 28, 2020
1 parent 2463195 commit aca7f54
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 17 deletions.
Expand Up @@ -54,7 +54,7 @@ public void setTitle(String title) {
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@Fetch(FetchMode.SELECT)
@IndexedEmbedded(depth = 3)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Nation getFirstPublishedIn() {
return firstPublishedIn;
}
Expand Down
Expand Up @@ -28,12 +28,12 @@ public class IndexedEmbeddedProxyRootEntity {

@OneToOne(optional = false, fetch = FetchType.LAZY)
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private IndexedEmbeddedProxyLazyEntity lazyEntity;

@OneToOne(optional = false, fetch = FetchType.LAZY)
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private IndexedEmbeddedProxyLazyEntity lazyEntity2;

public Integer getId() {
Expand Down
Expand Up @@ -52,7 +52,7 @@ public void setName(String name) {
}

@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
@ManyToOne
@JoinColumn(name = "CAR_ID", insertable = false, updatable = false)
public LegacyCar getCar() {
Expand Down
Expand Up @@ -51,7 +51,7 @@ public class Address {

@ManyToOne(cascade = CascadeType.ALL)
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private Country country;

public Long getId() {
Expand Down
Expand Up @@ -41,7 +41,7 @@ public class Country {
//FIXME with JPA 2, move to @OrderColumn
@IndexColumn(name = "list_position")
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private List<State> states = new ArrayList<State>();

public Integer getId() {
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class Product {
@ManyToMany(cascade = CascadeType.REMOVE) //just to make the test easier, cascade doesn't really make any business sense
@MapKeyColumn(name = "CUST_NAME", nullable = false)
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private Map<String, Order> orders = new HashMap<String, Order>();

public Integer getId() {
Expand Down
Expand Up @@ -14,6 +14,8 @@

import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency;

/**
* @author zkurey
Expand All @@ -28,6 +30,7 @@ public class DepthExceedsPathTestCase {

@ManyToOne
@IndexedEmbedded(depth = 6, includePaths = { "a.b.c.indexed" })
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public ReferencesIndexedEmbeddedA e;

}
Expand Up @@ -31,7 +31,7 @@ public class DepthMatchesPathDepthCase {

@ManyToOne
@IndexedEmbedded(depth = 4, includePaths = { "a.b.c.indexed" })
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public ReferencesIndexedEmbeddedA e;

}
Expand Up @@ -30,7 +30,7 @@ public class ReferencesIndexedEmbeddedA {

@ManyToOne
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public A a;

}
Expand Up @@ -162,7 +162,7 @@ public Driver() {

@IndexedEmbedded(includeEmbeddedObjectId = true)
@OneToOne(cascade = CascadeType.ALL)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Truck getTruck() { return truck; }
public void setTruck(Truck truck) { this.truck = truck; }
private Truck truck;
Expand Down Expand Up @@ -192,7 +192,7 @@ public Truck() {
private String numberPlate;

@IndexedEmbedded @OneToMany(cascade = CascadeType.ALL)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Set<Item> getItems() { return items; }
public void setItems(Set<Item> items) { this.items = items; }
private Set<Item> items;
Expand Down
Expand Up @@ -42,7 +42,7 @@ public class Book {

@IndexedEmbedded
@ManyToOne
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Author getMainAuthor() {
return mainAuthor;
}
Expand Down
Expand Up @@ -49,7 +49,7 @@ public class Book {

@IndexedEmbedded
@ManyToOne
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Author getMainAuthor() {
return mainAuthor;
}
Expand Down
Expand Up @@ -49,7 +49,7 @@ public void setId(Long id) {
fetch = FetchType.EAGER,
targetEntity = Author.class)
@IndexedEmbedded(depth = 1)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Set<Author> getAuthors() {
return authors;
}
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class Book {

@ManyToMany
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private Set<Author> authors = new HashSet<>();

public String getName() {
Expand Down
Expand Up @@ -38,7 +38,7 @@ public class Email {

@IndexedEmbedded
@ManyToOne(fetch = FetchType.LAZY)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private Domain domain;

public Domain getDomain() {
Expand Down
Expand Up @@ -36,7 +36,7 @@ public class Entite {

@IndexedEmbedded
@ManyToOne(fetch = FetchType.LAZY)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
private Categorie categorie;

public Entite() {
Expand Down

0 comments on commit aca7f54

Please sign in to comment.