Added support for different version schemes depending on the provider (#2124)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-12-06 14:40:13 +02:00
committed by GitHub
parent 2a476d1268
commit be6a58a38a
19 changed files with 106 additions and 73 deletions

View File

@@ -0,0 +1,20 @@
/**
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.hawkbit.repository.jpa;
public class JpaConstants {
public enum JpaVendor {
ECLIPSELINK,
HIBERNATE // NOT SUPPORTED!
}
public static final JpaVendor JPA_VENDOR = JpaVendor.ECLIPSELINK;
}

View File

@@ -615,9 +615,7 @@ public class JpaDistributionSetManagement implements DistributionSetManagement {
@Override
public List<Statistic> countRolloutsByStatusForDistributionSet(final Long id) {
assertDistributionSetExists(id);
return distributionSetRepository.countRolloutsByStatusForDistributionSet(id).stream()
.map(Statistic.class::cast).toList();
return distributionSetRepository.countRolloutsByStatusForDistributionSet(id).stream().map(Statistic.class::cast).toList();
}
@Override

View File

@@ -28,7 +28,6 @@ import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
import org.eclipse.persistence.annotations.Multitenant;
import org.eclipse.persistence.annotations.MultitenantType;
import org.eclipse.persistence.annotations.TenantDiscriminatorColumn;
import org.hibernate.annotations.TenantId;
/**
* Holder of the base attributes common to all tenant aware entities.
@@ -45,11 +44,9 @@ public abstract class AbstractJpaTenantAwareBaseEntity extends AbstractJpaBaseEn
@Serial
private static final long serialVersionUID = 1L;
@Column(name = "tenant", nullable = false, insertable = false, updatable = false, length = 40) // eclipselink
// @Column(name = "tenant", nullable = false, updatable = false, length = 40) // hibernate
@Column(name = "tenant", nullable = false, insertable = false, updatable = false, length = 40)
@Size(min = 1, max = 40)
@NotNull
@TenantId // Hibernate MultiTenant support
private String tenant;
/**