Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updated flag converters for aca and standIn. #51

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.gov.pagopa.apiconfig.starter.entity;

import it.gov.pagopa.apiconfig.starter.util.DummyBooleanConverter;
import it.gov.pagopa.apiconfig.starter.util.YesNoConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
Expand Down Expand Up @@ -78,9 +79,11 @@ public class PaStazionePa {
@Column(name = "PAGAMENTO_SPONTANEO", nullable = false)
private Boolean pagamentoSpontaneo = false;

@Convert(converter = DummyBooleanConverter.class)
@Column(name = "ACA", nullable = false)
private Boolean aca = true;

@Convert(converter = DummyBooleanConverter.class)
@Column(name = "STANDIN", nullable = false)
private Boolean standin = true;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.gov.pagopa.apiconfig.starter.entity;

import it.gov.pagopa.apiconfig.starter.util.DummyBooleanConverter;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -9,6 +10,7 @@
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
Expand Down Expand Up @@ -44,6 +46,7 @@ public class StationMaintenance {
@Column(name = "DATA_ORA_FINE", nullable = false)
private OffsetDateTime endDateTime;

@Convert(converter = DummyBooleanConverter.class)
@Column(name = "STANDIN", nullable = false)
private Boolean standIn;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package it.gov.pagopa.apiconfig.starter.util;

import javax.persistence.AttributeConverter;

/**
* Dummy converter for boolean values, to deprecate once all entities using the numeric converter are
* defined without the use of the auto-apply
*/
public class DummyBooleanConverter implements AttributeConverter<Boolean, Boolean> {

@Override
public Boolean convertToDatabaseColumn(final Boolean value) {
return value;
}

@Override
public Boolean convertToEntityAttribute(final Boolean value) {
return value;
}

}
Loading