generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #11 from pagopa/NOD-822_viste
Nod 822 viste
- Loading branch information
Showing
33 changed files
with
954 additions
and
16 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
56 changes: 56 additions & 0 deletions
56
src/main/java/it/gov/pagopa/node/cfgsync/config/ViewNamingStrategy.java
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,56 @@ | ||
package it.gov.pagopa.node.cfgsync.config; | ||
|
||
import org.hibernate.boot.model.naming.Identifier; | ||
import org.hibernate.boot.model.naming.PhysicalNamingStrategy; | ||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ViewNamingStrategy implements PhysicalNamingStrategy { | ||
|
||
@Override | ||
public Identifier toPhysicalCatalogName(final Identifier identifier, final JdbcEnvironment jdbcEnv) { | ||
return identifier; | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalColumnName(final Identifier identifier, final JdbcEnvironment jdbcEnv) { | ||
return identifier; | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalSchemaName(final Identifier identifier, final JdbcEnvironment jdbcEnv) { | ||
return identifier; | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalSequenceName(final Identifier identifier, final JdbcEnvironment jdbcEnv) { | ||
return identifier; | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalTableName(final Identifier identifier, final JdbcEnvironment jdbcEnv) { | ||
return convertToSnakeCase(identifier); | ||
} | ||
|
||
private Identifier convertToSnakeCase(final Identifier identifier) { | ||
if(identifier.getText().equals("{cdi_preferences_target}")){ | ||
String cdiPreferencesTable = System.getenv("CDI_PREFERENCES_TABLE"); | ||
return Identifier.toIdentifier(cdiPreferencesTable); | ||
} | ||
if(identifier.getText().equals("{elenco_servizi_target}")){ | ||
String elencoServiziTable = System.getenv("ELENCO_SERVIZI_TABLE"); | ||
return Identifier.toIdentifier(elencoServiziTable); | ||
} | ||
if(identifier.getText().equals("{cdi_preferences_source}")){ | ||
String cdiPreferencesTable = System.getenv("CDI_PREFERENCES_VIEW"); | ||
return Identifier.toIdentifier(cdiPreferencesTable); | ||
} | ||
if(identifier.getText().equals("{elenco_servizi_source}")){ | ||
String elencoServiziTable = System.getenv("ELENCO_SERVIZI_VIEW"); | ||
return Identifier.toIdentifier(elencoServiziTable); | ||
} | ||
return identifier; | ||
} | ||
} | ||
|
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
32 changes: 32 additions & 0 deletions
32
src/main/java/it/gov/pagopa/node/cfgsync/repository/model/CDIPreferences.java
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,32 @@ | ||
package it.gov.pagopa.node.cfgsync.repository.model; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.math.BigDecimal; | ||
|
||
|
||
@NoArgsConstructor | ||
@Entity | ||
@Table(name = "{cdi_preferences_target}") | ||
@Setter | ||
@Getter | ||
public class CDIPreferences { | ||
|
||
@Column(name="OBJ_ID") | ||
@Id | ||
private Long objid; | ||
@Column(name="SELLER") | ||
private String seller; | ||
@Column(name="BUYER") | ||
private String buyer; | ||
@Column(name="COSTO_CONVENZIONE") | ||
private BigDecimal costoconvenzione; | ||
@Column(name="ID_CDI_MASTER") | ||
private Long idcdimaster; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/it/gov/pagopa/node/cfgsync/repository/model/CDIPreferencesView.java
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,34 @@ | ||
package it.gov.pagopa.node.cfgsync.repository.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.math.BigDecimal; | ||
|
||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Entity | ||
@Table(name = "{cdi_preferences_source}") | ||
@Setter | ||
@Getter | ||
public class CDIPreferencesView { | ||
|
||
@Column(name="`OBJ_ID`") | ||
@Id | ||
private Long objid; | ||
@Column(name="`SELLER`") | ||
private String seller; | ||
@Column(name="`BUYER`") | ||
private String buyer; | ||
@Column(name="`COSTO_CONVENZIONE`") | ||
private BigDecimal costoconvenzione; | ||
@Column(name="`ID_CDI_MASTER`") | ||
private Long idcdimaster; | ||
} |
89 changes: 89 additions & 0 deletions
89
src/main/java/it/gov/pagopa/node/cfgsync/repository/model/ElencoServizi.java
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,89 @@ | ||
package it.gov.pagopa.node.cfgsync.repository.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.math.BigDecimal; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
|
||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Entity | ||
@Table(name = "{elenco_servizi_target}") | ||
@Setter | ||
@Getter | ||
public class ElencoServizi { | ||
|
||
@Column(name="OBJ_ID") | ||
@Id | ||
private Long objid; | ||
@Column(name="PSP_ID") | ||
private String pspid; | ||
@Column(name="PSP_RAG_SOC") | ||
private String pspragsoc; | ||
@Column(name="PSP_FLAG_STORNO") | ||
private String pspflagstorno; | ||
@Column(name="PSP_FLAG_BOLLO") | ||
private String pspflagbollo; | ||
@Column(name="LOGO_PSP") | ||
private byte[] logopsp; | ||
@Column(name="FLUSSO_ID") | ||
private String flussoid; | ||
@Column(name="INTM_ID") | ||
private String intmid; | ||
@Column(name="CANALE_ID") | ||
private String canaleid; | ||
@Column(name="NOME_SERVIZIO") | ||
private String nomeservizio; | ||
@Column(name="CANALE_MOD_PAG") | ||
private Long canalemodpag; | ||
@Column(name="TIPO_VERS_COD") | ||
private String tipoverscod; | ||
@Column(name="CODICE_LINGUA") | ||
private String codicelingua; | ||
@Column(name="INF_COND_EC_MAX") | ||
private String infcondecmax; | ||
@Column(name="INF_DESC_SERV") | ||
private String infdescserv; | ||
@Column(name="INF_DISP_SERV") | ||
private String infdispserv; | ||
@Column(name="INF_URL_CANALE") | ||
private String infurlcanale; | ||
@Column(name="TIMESTAMP_INS") | ||
private LocalDate timestampins; | ||
@Column(name="DATA_VALIDITA") | ||
private LocalDateTime datavalidita; | ||
@Column(name="IMPORTO_MINIMO") | ||
private BigDecimal importominimo; | ||
@Column(name="IMPORTO_MASSIMO") | ||
private BigDecimal importomassimo; | ||
@Column(name="COSTO_FISSO") | ||
private BigDecimal costofisso; | ||
@Column(name="TAGS") | ||
private String tags; | ||
@Column(name="LOGO_SERVIZIO") | ||
private byte[] logoservizio; | ||
@Column(name="CANALE_APP") | ||
private String canaleapp; | ||
@Column(name="ON_US") | ||
private String onus; | ||
@Column(name="CARRELLO_CARTE") | ||
private String carrellocarte; | ||
@Column(name="CODICE_ABI") | ||
private String codiceabi; | ||
@Column(name="CODICE_MYBANK") | ||
private String codicemybank; | ||
@Column(name="CODICE_CONVENZIONE") | ||
private String codiceconvenzione; | ||
@Column(name="FLAG_IO") | ||
private String flagio; | ||
|
||
} |
Oops, something went wrong.