* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021,2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.Index;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import org.apache.commons.lang3.builder.CompareToBuilder;
-import org.eclipse.persistence.annotations.Index;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.common.parameters.annotations.Pattern;
*
*/
@Entity
-@Table(name = "PdpStatistics")
-@Index(name = "IDXTSIDX1", columnNames = {
- "timeStamp", "name", "version"
-})
+@Table(
+ name = "PdpStatistics",
+ indexes = {
+ @Index(
+ name = "IDXTSIDX1",
+ columnList = "timeStamp,name,version",
+ unique = true
+ )
+ }
+)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Data
@AllArgsConstructor
@GeneratedValue(strategy = GenerationType.TABLE, generator = "statisticsIdGen")
@TableGenerator(
name = "statisticsIdGen",
- table = "sequence",
+ table = "statistics_sequence",
pkColumnName = "SEQ_NAME",
valueColumnName = "SEQ_COUNT",
pkColumnValue = "SEQ_GEN")