Skip to content

Commit 7117d94

Browse files
committed
Merge remote-tracking branch 'eugenp/master'
2 parents 5464a79 + ea4c34b commit 7117d94

File tree

170 files changed

+3193
-2044
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+3193
-2044
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@ In additional to Spring, the following technologies are in focus: `core Java`, `
2020

2121
Building the project
2222
====================
23-
To do the full build, do: `mvn install -Pdefault -Dgib.enabled=false`
23+
To do the full build, do: `mvn clean install`
2424

2525

2626
Building a single module
2727
====================
28-
To build a specific module run the command: `mvn clean install -Dgib.enabled=false` in the module directory
28+
To build a specific module run the command: `mvn clean install` in the module directory
2929

3030

3131
Running a Spring Boot module
3232
====================
33-
To run a Spring Boot module run the command: `mvn spring-boot:run -Dgib.enabled=false` in the module directory
33+
To run a Spring Boot module run the command: `mvn spring-boot:run` in the module directory
34+
35+
#Running Tests
36+
37+
The command `mvn clean install` will run the unit tests in a module.
38+
To run the integration tests, use the command `mvn clean install -Pintegration-lite-first`
3439

3540

3641

apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java renamed to apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesLiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import static org.junit.Assert.assertEquals;
2323

24-
public class GeodeSamplesIntegrationTest {
24+
public class GeodeSamplesLiveTest {
2525

2626
ClientCache cache = null;
2727
Region<String, String> region = null;

apache-olingo/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Relevant articles:
2+
3+
- [OData Protocol Guide](https://www.baeldung.com/odata)

apache-olingo/olingo2/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
<artifactId>spring-boot-configuration-processor</artifactId>
4545
<optional>true</optional>
4646
</dependency>
47-
<dependency>
48-
<groupId>org.projectlombok</groupId>
49-
<artifactId>lombok</artifactId>
50-
<optional>true</optional>
51-
</dependency>
5247
<dependency>
5348
<groupId>org.springframework.boot</groupId>
5449
<artifactId>spring-boot-starter-test</artifactId>
@@ -68,16 +63,6 @@
6863
</exclusion>
6964
</exclusions>
7065
</dependency>
71-
<dependency>
72-
<groupId>org.apache.olingo</groupId>
73-
<artifactId>olingo-odata2-api</artifactId>
74-
<version>${olingo2.version}</version>
75-
</dependency>
76-
<dependency>
77-
<groupId>org.apache.olingo</groupId>
78-
<artifactId>olingo-odata2-jpa-processor-api</artifactId>
79-
<version>${olingo2.version}</version>
80-
</dependency>
8166
<dependency>
8267
<groupId>org.apache.olingo</groupId>
8368
<artifactId>olingo-odata2-jpa-processor-core</artifactId>

apache-olingo/olingo2/src/main/java/org/baeldung/examples/olingo2/domain/CarMaker.java

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,104 @@
1212
import javax.persistence.Table;
1313
import javax.validation.constraints.NotNull;
1414

15-
import lombok.Data;
16-
1715
@Entity
18-
@Data
19-
@Table(name="car_maker")
16+
@Table(name = "car_maker")
2017
public class CarMaker {
21-
18+
2219
@Id
23-
@GeneratedValue(strategy=GenerationType.IDENTITY)
20+
@GeneratedValue(strategy = GenerationType.IDENTITY)
2421
private Long id;
25-
22+
2623
@NotNull
27-
@Column(name="name")
24+
@Column(name = "name")
2825
private String name;
29-
30-
@OneToMany(mappedBy="maker",
31-
orphanRemoval = true,
32-
cascade=CascadeType.ALL)
26+
27+
@OneToMany(mappedBy = "maker", orphanRemoval = true, cascade = CascadeType.ALL)
3328
private List<CarModel> models;
34-
29+
30+
/**
31+
* @return the id
32+
*/
33+
public Long getId() {
34+
return id;
35+
}
36+
37+
/**
38+
* @param id the id to set
39+
*/
40+
public void setId(Long id) {
41+
this.id = id;
42+
}
43+
44+
/**
45+
* @return the name
46+
*/
47+
public String getName() {
48+
return name;
49+
}
50+
51+
/**
52+
* @param name the name to set
53+
*/
54+
public void setName(String name) {
55+
this.name = name;
56+
}
57+
58+
/**
59+
* @return the models
60+
*/
61+
public List<CarModel> getModels() {
62+
return models;
63+
}
64+
65+
/**
66+
* @param models the models to set
67+
*/
68+
public void setModels(List<CarModel> models) {
69+
this.models = models;
70+
}
71+
72+
/* (non-Javadoc)
73+
* @see java.lang.Object#hashCode()
74+
*/
75+
@Override
76+
public int hashCode() {
77+
final int prime = 31;
78+
int result = 1;
79+
result = prime * result + ((id == null) ? 0 : id.hashCode());
80+
result = prime * result + ((models == null) ? 0 : models.hashCode());
81+
result = prime * result + ((name == null) ? 0 : name.hashCode());
82+
return result;
83+
}
84+
85+
/* (non-Javadoc)
86+
* @see java.lang.Object#equals(java.lang.Object)
87+
*/
88+
@Override
89+
public boolean equals(Object obj) {
90+
if (this == obj)
91+
return true;
92+
if (obj == null)
93+
return false;
94+
if (getClass() != obj.getClass())
95+
return false;
96+
CarMaker other = (CarMaker) obj;
97+
if (id == null) {
98+
if (other.id != null)
99+
return false;
100+
} else if (!id.equals(other.id))
101+
return false;
102+
if (models == null) {
103+
if (other.models != null)
104+
return false;
105+
} else if (!models.equals(other.models))
106+
return false;
107+
if (name == null) {
108+
if (other.name != null)
109+
return false;
110+
} else if (!name.equals(other.name))
111+
return false;
112+
return true;
113+
}
35114

36115
}
Lines changed: 133 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.baeldung.examples.olingo2.domain;
22

3-
43
import javax.persistence.Entity;
54
import javax.persistence.FetchType;
65
import javax.persistence.GeneratedValue;
@@ -11,28 +10,150 @@
1110
import javax.persistence.Table;
1211
import javax.validation.constraints.NotNull;
1312

14-
import lombok.Data;
15-
1613
@Entity
17-
@Data
18-
@Table(name="car_model")
14+
@Table(name = "car_model")
1915
public class CarModel {
2016

2117
@Id
22-
@GeneratedValue(strategy=GenerationType.AUTO)
18+
@GeneratedValue(strategy = GenerationType.AUTO)
2319
private Long id;
24-
20+
2521
@NotNull
2622
private String name;
27-
23+
2824
@NotNull
2925
private Integer year;
30-
26+
3127
@NotNull
3228
private String sku;
33-
34-
@ManyToOne(optional=false, fetch= FetchType.LAZY)
35-
@JoinColumn(name="maker_fk")
29+
30+
@ManyToOne(optional = false, fetch = FetchType.LAZY)
31+
@JoinColumn(name = "maker_fk")
3632
private CarMaker maker;
3733

34+
/**
35+
* @return the id
36+
*/
37+
public Long getId() {
38+
return id;
39+
}
40+
41+
/**
42+
* @param id the id to set
43+
*/
44+
public void setId(Long id) {
45+
this.id = id;
46+
}
47+
48+
/**
49+
* @return the name
50+
*/
51+
public String getName() {
52+
return name;
53+
}
54+
55+
/**
56+
* @param name the name to set
57+
*/
58+
public void setName(String name) {
59+
this.name = name;
60+
}
61+
62+
/**
63+
* @return the year
64+
*/
65+
public Integer getYear() {
66+
return year;
67+
}
68+
69+
/**
70+
* @param year the year to set
71+
*/
72+
public void setYear(Integer year) {
73+
this.year = year;
74+
}
75+
76+
/**
77+
* @return the sku
78+
*/
79+
public String getSku() {
80+
return sku;
81+
}
82+
83+
/**
84+
* @param sku the sku to set
85+
*/
86+
public void setSku(String sku) {
87+
this.sku = sku;
88+
}
89+
90+
/**
91+
* @return the maker
92+
*/
93+
public CarMaker getMaker() {
94+
return maker;
95+
}
96+
97+
/**
98+
* @param maker the maker to set
99+
*/
100+
public void setMaker(CarMaker maker) {
101+
this.maker = maker;
102+
}
103+
104+
/* (non-Javadoc)
105+
* @see java.lang.Object#hashCode()
106+
*/
107+
@Override
108+
public int hashCode() {
109+
final int prime = 31;
110+
int result = 1;
111+
result = prime * result + ((id == null) ? 0 : id.hashCode());
112+
result = prime * result + ((maker == null) ? 0 : maker.hashCode());
113+
result = prime * result + ((name == null) ? 0 : name.hashCode());
114+
result = prime * result + ((sku == null) ? 0 : sku.hashCode());
115+
result = prime * result + ((year == null) ? 0 : year.hashCode());
116+
return result;
117+
}
118+
119+
/* (non-Javadoc)
120+
* @see java.lang.Object#equals(java.lang.Object)
121+
*/
122+
@Override
123+
public boolean equals(Object obj) {
124+
if (this == obj)
125+
return true;
126+
if (obj == null)
127+
return false;
128+
if (getClass() != obj.getClass())
129+
return false;
130+
CarModel other = (CarModel) obj;
131+
if (id == null) {
132+
if (other.id != null)
133+
return false;
134+
} else if (!id.equals(other.id))
135+
return false;
136+
if (maker == null) {
137+
if (other.maker != null)
138+
return false;
139+
} else if (!maker.equals(other.maker))
140+
return false;
141+
if (name == null) {
142+
if (other.name != null)
143+
return false;
144+
} else if (!name.equals(other.name))
145+
return false;
146+
if (sku == null) {
147+
if (other.sku != null)
148+
return false;
149+
} else if (!sku.equals(other.sku))
150+
return false;
151+
if (year == null) {
152+
if (other.year != null)
153+
return false;
154+
} else if (!year.equals(other.year))
155+
return false;
156+
return true;
157+
}
158+
38159
}

apache-olingo/olingo2/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server:
2-
port: 8180
2+
port: 8080
33

44
spring:
55
jersey:

apache-olingo/olingo4/.gitignore

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)