use simple @GeneratedValue and some code cleanup
| | |
| | | Optional.ofNullable(response.getBody()).map(Object::toString).orElse(firstMessageLine(exc))); |
| | | } |
| | | |
| | | //@ExceptionHandler({ MethodArgumentNotValidException.class }) |
| | | @Override |
| | | @SuppressWarnings("unchecked,rawtypes") |
| | | protected ResponseEntity handleMethodArgumentNotValid( |
| | | MethodArgumentNotValidException exc, |
| | |
| | | .withProp(Fields.bic, HsOfficeBankAccountEntity::getBic); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | private String holder; |
| | | |
| | |
| | | |
| | | import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; |
| | | import lombok.*; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.hibernate.annotations.Type; |
| | | import org.hibernate.annotations.TypeDef; |
| | | |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @ManyToOne |
| | |
| | | |
| | | @Column(name = "transactiontype") |
| | | @Enumerated(EnumType.STRING) |
| | | @Type( type = "pgsql_enum" ) |
| | | @Type(type = "pgsql_enum") |
| | | private HsOfficeCoopSharesTransactionType transactionType; |
| | | |
| | | @Column(name = "valuedate") |
| | |
| | | |
| | | import lombok.*; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; |
| | | import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; |
| | | import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | |
| | | import javax.persistence.*; |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GeneratedValue |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | private UUID uuid; |
| | | |
| | |
| | | import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.hibernate.annotations.*; |
| | | import org.hibernate.annotations.Fetch; |
| | | import org.hibernate.annotations.FetchMode; |
| | | import org.hibernate.annotations.Type; |
| | | import org.hibernate.annotations.TypeDef; |
| | | |
| | | import javax.persistence.*; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Table; |
| | | import java.time.LocalDate; |
| | | import java.util.UUID; |
| | | |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @ManyToOne |
| | |
| | | } |
| | | |
| | | public Range<LocalDate> getValidity() { |
| | | if ( validity == null ) { |
| | | validity = Range.infinite(LocalDate.class); |
| | | }; |
| | | if (validity == null) { |
| | | validity = Range.infinite(LocalDate.class); |
| | | } |
| | | ; |
| | | return validity; |
| | | } |
| | | |
| | |
| | | package net.hostsharing.hsadminng.hs.office.partner; |
| | | |
| | | import lombok.*; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | |
| | | import javax.persistence.*; |
| | | import java.time.LocalDate; |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | private @Column(name = "registrationoffice") String registrationOffice; |
| | |
| | | |
| | | import lombok.*; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; |
| | | import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.hibernate.annotations.NotFound; |
| | | import org.hibernate.annotations.NotFoundAction; |
| | | |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @ManyToOne |
| | |
| | | @JoinColumn(name = "contactuuid", nullable = false) |
| | | private HsOfficeContactEntity contact; |
| | | |
| | | @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH}, optional = true) |
| | | @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH }, optional = true) |
| | | @JoinColumn(name = "detailsuuid", nullable = true) |
| | | @NotFound(action= NotFoundAction.IGNORE) |
| | | @NotFound(action = NotFoundAction.IGNORE) |
| | | private HsOfficePartnerDetailsEntity details; |
| | | |
| | | @Override |
| | |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | import org.hibernate.annotations.Type; |
| | | import org.hibernate.annotations.TypeDef; |
| | | |
| | |
| | | .withProp(Fields.givenName, HsOfficePersonEntity::getGivenName); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @Column(name = "persontype") |
| | | @Enumerated(EnumType.STRING) |
| | | @Type( type = "pgsql_enum" ) |
| | | @Type(type = "pgsql_enum") |
| | | private HsOfficePersonType personType; |
| | | |
| | | @Column(name = "tradename") |
| | |
| | | import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; |
| | | import lombok.*; |
| | | import lombok.experimental.FieldNameConstants; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; |
| | | import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import org.hibernate.annotations.Type; |
| | | import org.hibernate.annotations.TypeDef; |
| | | |
| | |
| | | .withProp(Fields.contact, HsOfficeRelationshipEntity::getContact); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @ManyToOne |
| | |
| | | |
| | | @Column(name = "reltype") |
| | | @Enumerated(EnumType.STRING) |
| | | @Type( type = "pgsql_enum" ) |
| | | @Type(type = "pgsql_enum") |
| | | private HsOfficeRelationshipType relType; |
| | | |
| | | @Override |
| | |
| | | import com.vladmihalcea.hibernate.type.range.Range; |
| | | import lombok.*; |
| | | import net.hostsharing.hsadminng.errors.DisplayName; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; |
| | | import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntity; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | import net.hostsharing.hsadminng.stringify.Stringify; |
| | | import net.hostsharing.hsadminng.stringify.Stringifyable; |
| | | import org.hibernate.annotations.TypeDef; |
| | | |
| | | import javax.persistence.*; |
| | |
| | | .quotedValues(false); |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @ManyToOne |
| | |
| | | |
| | | private @Column(name = "reference") String reference; |
| | | |
| | | @Column(name="validity", columnDefinition = "daterange") |
| | | @Column(name = "validity", columnDefinition = "daterange") |
| | | private Range<LocalDate> validity; |
| | | |
| | | @Override |
| | |
| | | import lombok.Getter; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.Setter; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | |
| | | import javax.persistence.*; |
| | | import java.util.UUID; |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class TestCustomerEntity { |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | private String prefix; |
| | | private int reference; |
| | | |
| | | @Column(name="adminusername") |
| | | @Column(name = "adminusername") |
| | | private String adminUserName; |
| | | } |
| | |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.Setter; |
| | | import net.hostsharing.hsadminng.test.cust.TestCustomerEntity; |
| | | import org.hibernate.annotations.GenericGenerator; |
| | | |
| | | import javax.persistence.*; |
| | | import java.util.UUID; |
| | |
| | | public class TestPackageEntity { |
| | | |
| | | @Id |
| | | @GeneratedValue(generator = "UUID") |
| | | @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator") |
| | | @GeneratedValue |
| | | private UUID uuid; |
| | | |
| | | @Version |