Skip to content
Open
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
@@ -0,0 +1,66 @@
package com.eshop.modernized.model;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.util.Objects;

@Entity
@Table(name = "CatalogBrand")
public class CatalogBrand {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;

@NotNull
@Size(max = 100)
@Column(nullable = false, length = 100)
private String brand;

protected CatalogBrand() {
}

public CatalogBrand(String brand) {
this.brand = brand;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getBrand() {
return brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CatalogBrand other)) return false;
return Objects.equals(brand, other.brand);
}

@Override
public int hashCode() {
return Objects.hash(brand);
}

@Override
public String toString() {
return brand;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.eshop.modernized.model;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.util.Objects;

@Entity
@Table(name = "CatalogType")
public class CatalogType {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;

@NotNull
@Size(max = 100)
@Column(nullable = false, length = 100)
private String type;

protected CatalogType() {
}

public CatalogType(String type) {
this.type = type;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CatalogType other)) return false;
return Objects.equals(type, other.type);
}

@Override
public int hashCode() {
return Objects.hash(type);
}

@Override
public String toString() {
return type;
}
}