-
Notifications
You must be signed in to change notification settings - Fork 0
/
Company_Segment.java
49 lines (40 loc) · 1.49 KB
/
Company_Segment.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
public class Company_Segment {
// Atributos da classe Company_Segment
private int id; // Chave primária (PK)
private int segment_id; // Chave estrangeira (FK)
private int company_id; // Outra chave estrangeira (FK)
// Construtor da classe Company_Segment
public Company_Segment(int id, int segment_id, int company_id) {
this.id = id;
this.segment_id = segment_id;
this.company_id = company_id;
}
// Métodos getters e setters para acessar e modificar os atributos
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getSegmentId() {
return segment_id;
}
public void setSegmentId(int segment_id) {
this.segment_id = segment_id;
}
public int getCompanyId() {
return company_id;
}
public void setCompanyId(int company_id) {
this.company_id = company_id;
}
// Método principal para testar a classe
public static void main(String[] args) {
// Criando um objeto Company_Segment
Company_Segment companySegment1 = new Company_Segment(1, 101, 2001);
// Exibindo informações do relacionamento segmento-empresa
System.out.println("CompanySegment ID: " + companySegment1.getId());
System.out.println("Segment ID: " + companySegment1.getSegmentId());
System.out.println("Company ID: " + companySegment1.getCompanyId());
}
}