Skip to content

Commit

Permalink
fix(generic bp model): Changes to entity model
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfkaeser committed Sep 13, 2023
1 parent 6740b3f commit 0aabb67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ class BusinessPartner(
var legalForm: String?,

@Column(name = "is_owner")
var isOwner: Boolean?,
var isOwner: Boolean,

@Column(name = "address_bpn")
var bpnA: String?,

@Column(name = "legal_entity_bpn")
@Column(name = "bpnl")
var bpnL: String?,

@Column(name = "site_bpn")
@Column(name = "bpns")
var bpnS: String?,

@Column(name = "bpna")
var bpnA: String?,

@OneToOne(cascade = [CascadeType.ALL], orphanRemoval = true)
@JoinColumn(name = "postal_address_id", unique = true)
var postalAddress: PostalAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PostalAddress(

@Column(name = "address_type")
@Enumerated(EnumType.STRING)
var addressType: AddressType,
var addressType: AddressType?,

@Embedded
var physicalPostalAddress: PhysicalPostalAddress,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Make field mandatory
alter table business_partners
alter column is_owner set not null;

-- Rename columns to bnpl/bpns/bpna for consistency
alter table business_partners
rename column legal_entity_bpn to bpnl;
alter table business_partners
rename column site_bpn to bpns;
alter table business_partners
rename column address_bpn to bpna;

0 comments on commit 0aabb67

Please sign in to comment.