Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into CDE-195-creer-cons…
Browse files Browse the repository at this point in the history
…umer-pour-generer-les-2-fichiers-de-log

# Conflicts:
#	src/main/java/fr/abes/logskbart/service/KbartToBddService.java
  • Loading branch information
SamuelQuetin committed Oct 26, 2023
2 parents 44e6d64 + 37648a3 commit 83b721c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 61 deletions.
18 changes: 10 additions & 8 deletions src/main/java/fr/abes/logskbart/entity/bacon/LigneKbart.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Date;

@Entity
@Table(name = "LIGNE_KBART_CONVERGENCE")
@Table(name = "LIGNE_KBART")
@Setter @Getter
public class LigneKbart implements Serializable {
@Id
Expand Down Expand Up @@ -65,13 +65,15 @@ public class LigneKbart implements Serializable {
private String precedeingPublicationTitleId;
@Column(name = "ACCESS_TYPE")
private String accessType;
@ManyToOne(targetEntity = ProviderPackage.class, cascade = CascadeType.REMOVE, optional = false)
@JoinColumns({
@JoinColumn(name = "PROVIDER_PACKAGE_PACKAGE", referencedColumnName = "PACKAGE"),
@JoinColumn(name = "PROVIDER_PACKAGE_DATE_P", referencedColumnName = "DATE_P"),
@JoinColumn(name = "PROVIDER_PACKAGE_IDT_PROVIDER", referencedColumnName = "PROVIDER_IDT_PROVIDER"
)})
private ProviderPackage providerPackage;
@Column(name = "PACKAGE")
private String packageName;
@Column(name = "DATE_P")
private Date dateP;
@Column(name = "PROVIDER_IDT_PROVIDER")
private Integer providerIdtProvider;
@Column(name = "BEST_PPN")
private String bestPpn;
@ManyToOne(targetEntity = ProviderPackage.class, cascade = CascadeType.REMOVE, optional = false)
@JoinColumn(name = "ID_PROVIDER_PACKAGE", referencedColumnName = "ID_PROVIDER_PACKAGE")
private ProviderPackage providerPackage;
}
19 changes: 15 additions & 4 deletions src/main/java/fr/abes/logskbart/entity/bacon/ProviderPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "PROVIDER_PACKAGE")
@Getter @Setter
@AllArgsConstructor
@NoArgsConstructor
public class ProviderPackage implements Serializable {
@EmbeddedId
private ProviderPackageId providerPackageId;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_PROVIDER_PACKAGE")
private Integer providerPackageId;
@Column(name = "PACKAGE")
private String packageName;
@Column(name = "DATE_P")
private Date dateP;
@Column(name = "PROVIDER_IDT_PROVIDER")
private Integer providerIdtProvider;

@Column(name = "LABEL_ABES")
private char labelAbes;
Expand All @@ -24,8 +33,10 @@ public class ProviderPackage implements Serializable {
@JoinColumn(referencedColumnName = "IDT_PROVIDER", insertable = false, updatable = false)
private Provider provider;

public ProviderPackage(ProviderPackageId providerPackageId, char labelAbes) {
this.providerPackageId = providerPackageId;
public ProviderPackage(String packageName, Date dateP, Integer providerIdtProvider, char labelAbes) {
this.packageName = packageName;
this.dateP = dateP;
this.providerIdtProvider = providerIdtProvider;
this.labelAbes = labelAbes;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import fr.abes.logskbart.configuration.BaconDbConfiguration;
import fr.abes.logskbart.entity.bacon.ProviderPackage;
import fr.abes.logskbart.entity.bacon.ProviderPackageId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand All @@ -11,6 +10,6 @@

@Repository
@BaconDbConfiguration
public interface ProviderPackageRepository extends JpaRepository<ProviderPackage, ProviderPackageId> {
Optional<ProviderPackage> findByProviderPackageId(ProviderPackageId providerPackageId);
public interface ProviderPackageRepository extends JpaRepository<ProviderPackage, Integer> {
Optional<ProviderPackage> findByPackageNameAndDatePAndProviderIdtProvider(String packageName, Date dateP, Integer providerIdtProvider);
}
Empty file.

0 comments on commit 83b721c

Please sign in to comment.