Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #214 from tesler-platform/feature/wf-meta-load-per…
Browse files Browse the repository at this point in the history
…formance

wf meta insert performance fixed
  • Loading branch information
IgorNB authored Sep 5, 2021
2 parents 744f155 + 2118484 commit a7952ef
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,28 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

@Getter
@Setter
@Entity
@Table(name = "TASK_FIELD")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class TaskField extends BaseEntity {

@Column(name = "KEY")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@
import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.entity.Department;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Модель переходов
Expand All @@ -37,6 +41,14 @@
@Setter
@Entity
@Table(name = "WF")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class Workflow extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.entity.Department;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Правило отбора рекомендованных исполнителей
Expand All @@ -38,6 +42,14 @@
@Setter
@Entity
@Table(name = "WF_ASSIGNEE_RECOMMEND")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowAssigneeRecommendation extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,31 @@

import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

@Getter
@Setter
@Entity
@Table(name = "WF_COND")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowCondition extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@

import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Действие при переходе
Expand All @@ -37,6 +41,14 @@
@Setter
@Entity
@Table(name = "WF_POST_FUN")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowPostFunction extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
Expand All @@ -33,6 +34,9 @@
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Formula;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Шаг модели переходов
Expand All @@ -41,6 +45,14 @@
@Setter
@Entity
@Table(name = "WF_STEP")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowStep extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Группа условий шага
Expand All @@ -36,6 +40,14 @@
@Setter
@Entity
@Table(name = "WF_STEP_COND_GROUP")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowStepConditionGroup extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Настройки атрибутов активности для шага модели переходов
Expand All @@ -35,6 +39,14 @@
@Setter
@Entity
@Table(name = "WF_STEP_FIELD")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowStepField extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Переход
Expand All @@ -36,6 +40,14 @@
@Setter
@Entity
@Table(name = "WF_TRANSITION")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowTransition extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@

import io.tesler.api.data.dictionary.LOV;
import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Группа условий перехода
Expand All @@ -37,6 +41,14 @@
@Setter
@Entity
@Table(name = "WF_TRANSITION_COND_GROUP")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowTransitionConditionGroup extends BaseEntity {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
Expand All @@ -32,11 +33,22 @@
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

@Getter
@Setter
@Entity
@Table(name = "WF_TRANSITION_GROUP")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowTransitionGroup extends BaseEntity {

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package io.tesler.model.workflow.entity;

import io.tesler.model.core.entity.BaseEntity;
import io.tesler.model.core.hbn.ExtSequenceGenerator;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
Expand All @@ -31,6 +32,9 @@
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Parameter;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;

/**
* Версия модели переходов
Expand All @@ -39,6 +43,14 @@
@Setter
@Entity
@Table(name = "WF_VERSION")
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "META_SEQ"),
@Parameter(name = SequenceStyleGenerator.INITIAL_PARAM, value = "1"),
@Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "100"),
@Parameter(name = SequenceStyleGenerator.OPT_PARAM, value = OptimizerFactory.POOL_LO)
}
)
public class WorkflowVersion extends BaseEntity {

/**
Expand Down

0 comments on commit a7952ef

Please sign in to comment.