Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sheryllresulta authored May 27, 2019
2 parents 02c3405 + c3ec2ab commit 4554bb8
Show file tree
Hide file tree
Showing 72 changed files with 781 additions and 1,729 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ In additional to Spring, the following technologies are in focus: `core Java`, `

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


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


Running a Spring Boot module
====================
To run a Spring Boot module run the command: `mvn spring-boot:run -Dgib.enabled=false` in the module directory
To run a Spring Boot module run the command: `mvn spring-boot:run` in the module directory

#Running Tests

The command `mvn clean install` will run the unit tests in a module.
To run the integration tests, use the command `mvn clean install -Pintegration-lite-first`



Expand Down
15 changes: 0 additions & 15 deletions apache-olingo/olingo2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -68,16 +63,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-api</artifactId>
<version>${olingo2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-jpa-processor-api</artifactId>
<version>${olingo2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-jpa-processor-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,104 @@
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import lombok.Data;

@Entity
@Data
@Table(name="car_maker")
@Table(name = "car_maker")
public class CarMaker {

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

@NotNull
@Column(name="name")
@Column(name = "name")
private String name;

@OneToMany(mappedBy="maker",
orphanRemoval = true,
cascade=CascadeType.ALL)

@OneToMany(mappedBy = "maker", orphanRemoval = true, cascade = CascadeType.ALL)
private List<CarModel> models;


/**
* @return the id
*/
public Long getId() {
return id;
}

/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}

/**
* @return the name
*/
public String getName() {
return name;
}

/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}

/**
* @return the models
*/
public List<CarModel> getModels() {
return models;
}

/**
* @param models the models to set
*/
public void setModels(List<CarModel> models) {
this.models = models;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((models == null) ? 0 : models.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}

/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CarMaker other = (CarMaker) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (models == null) {
if (other.models != null)
return false;
} else if (!models.equals(other.models))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.baeldung.examples.olingo2.domain;


import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
Expand All @@ -11,28 +10,150 @@
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import lombok.Data;

@Entity
@Data
@Table(name="car_model")
@Table(name = "car_model")
public class CarModel {

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotNull
private String name;

@NotNull
private Integer year;

@NotNull
private String sku;
@ManyToOne(optional=false, fetch= FetchType.LAZY)
@JoinColumn(name="maker_fk")

@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "maker_fk")
private CarMaker maker;

/**
* @return the id
*/
public Long getId() {
return id;
}

/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}

/**
* @return the name
*/
public String getName() {
return name;
}

/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}

/**
* @return the year
*/
public Integer getYear() {
return year;
}

/**
* @param year the year to set
*/
public void setYear(Integer year) {
this.year = year;
}

/**
* @return the sku
*/
public String getSku() {
return sku;
}

/**
* @param sku the sku to set
*/
public void setSku(String sku) {
this.sku = sku;
}

/**
* @return the maker
*/
public CarMaker getMaker() {
return maker;
}

/**
* @param maker the maker to set
*/
public void setMaker(CarMaker maker) {
this.maker = maker;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((maker == null) ? 0 : maker.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((sku == null) ? 0 : sku.hashCode());
result = prime * result + ((year == null) ? 0 : year.hashCode());
return result;
}

/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CarModel other = (CarModel) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (maker == null) {
if (other.maker != null)
return false;
} else if (!maker.equals(other.maker))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (sku == null) {
if (other.sku != null)
return false;
} else if (!sku.equals(other.sku))
return false;
if (year == null) {
if (other.year != null)
return false;
} else if (!year.equals(other.year))
return false;
return true;
}

}
2 changes: 1 addition & 1 deletion apache-olingo/olingo2/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: 8180
port: 8080

spring:
jersey:
Expand Down
29 changes: 0 additions & 29 deletions apache-olingo/olingo4/.gitignore

This file was deleted.

Loading

0 comments on commit 4554bb8

Please sign in to comment.