-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support correlations for data entries in JPA view (#1006)
* feat(#1001): add correlations to jpa and build base for dataentry with correlation queries * feat(1001): support flag for including correlations * feat(1001): document new view * feat(#1001): add tests and documentation for data entry correlation - closes #1001 * chore: make view great again in test migration * fix(#1001): Fixed test after converting table to view * open java modules for urefire and failsafe * made fields immutable, combined SQL scripts --------- Co-authored-by: Michael von Bargen <[email protected]> Co-authored-by: Tim Holzke <[email protected]> Co-authored-by: Simon Zambrovski <[email protected]>
- Loading branch information
1 parent
f007e8e
commit 9769d03
Showing
17 changed files
with
346 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryPayloadAttributeEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.holunda.polyflow.view.jpa.data | ||
|
||
import jakarta.persistence.EmbeddedId | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Table | ||
import org.hibernate.annotations.Immutable | ||
|
||
/** | ||
* Entity that holds the combined payload attributes of the correlated DataEntries. | ||
*/ | ||
@Entity | ||
@Immutable | ||
@Table(name = "PLF_VIEW_DATA_ENTRY_PAYLOAD") | ||
class DataEntryPayloadAttributeEntity( | ||
@EmbeddedId | ||
var id: DataEntryPayloadAttributeEntityId, | ||
) { | ||
constructor(entryType: String, entryId: String, path: String, value: String) : this( | ||
DataEntryPayloadAttributeEntityId( | ||
entryType = entryType, | ||
entryId = entryId, | ||
path = path, | ||
value = value | ||
) | ||
) | ||
|
||
override fun toString(): String = "DataEntryPayloadAttributeEntity(id=$id)" | ||
} | ||
|
49 changes: 49 additions & 0 deletions
49
...pa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryPayloadAttributeEntityId.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.holunda.polyflow.view.jpa.data | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Embeddable | ||
import org.hibernate.annotations.Immutable | ||
import java.io.Serializable | ||
|
||
/** | ||
* Id class that holds the combined payload attributes of the correlated DataEntries. | ||
*/ | ||
@Embeddable | ||
@Immutable | ||
class DataEntryPayloadAttributeEntityId( | ||
@Column(name = "ENTRY_TYPE", length = 64, nullable = false, updatable = false, insertable = false) | ||
var entryType: String, | ||
@Column(name = "ENTRY_ID", length = 64, nullable = false, updatable = false, insertable = false) | ||
var entryId: String, | ||
@Column(name = "PATH", nullable = false, updatable = false, insertable = false) | ||
var path: String, | ||
@Column(name = "VALUE", nullable = false, updatable = false, insertable = false) | ||
var value: String | ||
) : Serializable { | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (javaClass != other?.javaClass) return false | ||
|
||
other as DataEntryPayloadAttributeEntityId | ||
|
||
if (entryType != other.entryType) return false | ||
if (entryId != other.entryId) return false | ||
if (path != other.path) return false | ||
if (value != other.value) return false | ||
|
||
return true | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = entryType.hashCode() | ||
result = 31 * result + entryId.hashCode() | ||
result = 31 * result + path.hashCode() | ||
result = 31 * result + value.hashCode() | ||
return result | ||
} | ||
|
||
override fun toString(): String { | ||
return "DataEntryPayloadAttributeEntityId(entryType='$entryType', entryId='$entryId', path='$path', value='$value')" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.