Skip to content

Commit

Permalink
Fix problems
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Sep 9, 2024
1 parent 22e280c commit 9b2d613
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public class Batch extends BaseBean {
* Holds the processes that belong to the batch.
*/
@ManyToMany(cascade = CascadeType.PERSIST)
@IndexedEmbedded(includePaths = {"title"})
@JoinTable(name = "batch_x_process", joinColumns = {
@JoinColumn(name = "batch_id", foreignKey = @ForeignKey(name = "FK_batch_x_process_batch_id")) }, inverseJoinColumns = {
@JoinColumn(name = "process_id", foreignKey = @ForeignKey(name = "FK_batch_x_process_process_id")) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public class Process extends BaseTemplateBean {
@Transient
private boolean hasChildren = true;

@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy = "process", cascade = CascadeType.ALL, orphanRemoval = true)
@IndexedEmbedded(includePaths = {"title", "id"})
@OrderBy("ordering")
Expand All @@ -126,6 +127,7 @@ public class Process extends BaseTemplateBean {
@IndexedEmbedded(includePaths = {"message"})
private List<Comment> comments;

@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = CascadeType.ALL)
@IndexedEmbedded(includePaths = {"id", "title", "value"})
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
Expand All @@ -134,6 +136,7 @@ public class Process extends BaseTemplateBean {
@JoinColumn(name = "property_id", foreignKey = @ForeignKey(name = "FK_process_x_property_property_id")) })
private List<Property> properties;

@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = CascadeType.ALL)
@IndexedEmbedded(includePaths = {"id", "title", "value"})
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
Expand All @@ -142,6 +145,7 @@ public class Process extends BaseTemplateBean {
@JoinColumn(name = "property_id", foreignKey = @ForeignKey(name = "FK_template_x_property_property_id")) })
private List<Property> templates;

@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = CascadeType.ALL)
@IndexedEmbedded(includePaths = {"id", "title", "value"})
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
Expand Down Expand Up @@ -173,6 +175,7 @@ public class Task extends BaseBean {
* This field contains information about user's roles, which are allowed to
* work on this task.
*/
@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = CascadeType.PERSIST)
@IndexedEmbedded(includePaths = {"id"})
@JoinTable(name = "task_x_role", joinColumns = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class Template extends BaseTemplateBean {
@IndexedEmbedded(includePaths = {"id", "title"})
private List<Task> tasks;

@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = CascadeType.PERSIST)
@IndexedEmbedded(includePaths = {"id", "active", "title"})
@JoinTable(name = "project_x_template", joinColumns = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public List<Task> getAllTasksInBetween(Integer orderingMax, Integer orderingMin,
parameters.put("orderingMax", orderingMax);
parameters.put("orderingMin", orderingMin);
parameters.put(KEY_PROCESS_ID, processId);
return getByQuery("FROM Task WHERE process_id = :processId AND ordering < :orderingMin"
+ " AND ordering > :orderingMax ORDER BY ordering ASC",
return getByQuery("FROM Task WHERE process_id = :processId AND ordering > :orderingMin"
+ " AND ordering < :orderingMax ORDER BY ordering ASC",
parameters);
}

Expand Down

0 comments on commit 9b2d613

Please sign in to comment.