Тип паттерна IGNORE
This commit is contained in:
@@ -3,9 +3,7 @@ package ru.serega6531.packmate.model;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@GenericGenerator(
|
||||
@@ -22,13 +20,18 @@ import javax.persistence.Id;
|
||||
@Builder
|
||||
@Getter
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(exclude = "packet")
|
||||
public class FoundPattern {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "found_pattern_generator")
|
||||
private int id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "packet_id", nullable = false)
|
||||
@Setter
|
||||
private Packet packet;
|
||||
|
||||
private int patternId;
|
||||
|
||||
private int startPosition;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package ru.serega6531.packmate.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -24,6 +21,7 @@ import java.util.Set;
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Table(indexes = { @Index(name = "stream_id_index", columnList = "stream_id") })
|
||||
@EqualsAndHashCode(exclude = "stream")
|
||||
public class Packet {
|
||||
|
||||
@Id
|
||||
@@ -40,7 +38,7 @@ public class Packet {
|
||||
@JoinColumn(name = "stream_id", nullable = false)
|
||||
private Stream stream;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@OneToMany(mappedBy = "packet", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
private Set<FoundPattern> matches;
|
||||
|
||||
private long timestamp;
|
||||
|
||||
@@ -3,6 +3,7 @@ package ru.serega6531.packmate.model;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import ru.serega6531.packmate.model.enums.PatternActionType;
|
||||
import ru.serega6531.packmate.model.enums.PatternDirectionType;
|
||||
import ru.serega6531.packmate.model.enums.PatternSearchType;
|
||||
|
||||
@@ -39,6 +40,8 @@ public class Pattern {
|
||||
|
||||
private PatternDirectionType directionType;
|
||||
|
||||
private PatternActionType actionType;
|
||||
|
||||
@ManyToMany(mappedBy = "foundPatterns", fetch = FetchType.LAZY)
|
||||
private List<Stream> matchedStreams;
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package ru.serega6531.packmate.model.enums;
|
||||
|
||||
public enum PatternActionType {
|
||||
FIND, IGNORE
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import ru.serega6531.packmate.model.enums.PatternActionType;
|
||||
import ru.serega6531.packmate.model.enums.PatternDirectionType;
|
||||
import ru.serega6531.packmate.model.enums.PatternSearchType;
|
||||
|
||||
@@ -11,8 +12,9 @@ public class PatternDto {
|
||||
private boolean enabled;
|
||||
private String name;
|
||||
private String value;
|
||||
private String color; // для вставки в css
|
||||
private String color;
|
||||
private PatternSearchType searchType;
|
||||
private PatternDirectionType directionType;
|
||||
private PatternActionType actionType;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user