-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1033 from eclipse-tractusx/fix/pool-gr-task-resol…
…ution fix(Pool): Fix not resolving golden record tasks on exceptions
- Loading branch information
Showing
8 changed files
with
194 additions
and
46 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
40 changes: 40 additions & 0 deletions
40
bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/GoldenRecordTaskDb.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.pool.entity | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Table | ||
import org.eclipse.tractusx.bpdm.common.model.BaseEntity | ||
import java.time.Instant | ||
|
||
|
||
@Entity | ||
@Table( | ||
name = "golden_record_tasks" | ||
) | ||
class GoldenRecordTaskDb( | ||
@Column(name = "task_id", nullable = false, updatable = false) | ||
val taskId: String, | ||
@Column(name = "is_resolved", nullable = false) | ||
var isResolved: Boolean, | ||
@Column(name = "last_checked", nullable = false) | ||
var lastChecked: Instant | ||
): BaseEntity() |
31 changes: 31 additions & 0 deletions
31
...l/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/repository/GoldenRecordTaskRepository.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,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.pool.repository | ||
|
||
import org.eclipse.tractusx.bpdm.pool.entity.GoldenRecordTaskDb | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import java.time.Instant | ||
|
||
interface GoldenRecordTaskRepository: JpaRepository<GoldenRecordTaskDb, Long> { | ||
|
||
fun findFirstByLastCheckedBefore(checkedBefore: Instant): GoldenRecordTaskDb? | ||
|
||
fun findFirstByIsResolved(isResolved: Boolean): GoldenRecordTaskDb? | ||
} |
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
11 changes: 11 additions & 0 deletions
11
bpdm-pool/src/main/resources/db/migration/V6_2_0_0__add_golden_record_tasks.sql
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,11 @@ | ||
create table golden_record_tasks | ||
( | ||
id bigint not null, | ||
uuid UUID not null, | ||
created_at timestamp without time zone not null, | ||
updated_at timestamp without time zone not null, | ||
task_id varchar(255) not null, | ||
is_resolved boolean not null, | ||
last_checked timestamp without time zone not null, | ||
primary key (id) | ||
); |
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