The database I'm talking about Hello, I want to create a GET endpoint that returns for example every item's route_short_name ONLY which route_long_name = Autobuz. My entity file looks like this and I'm using Jpa repo, and I dont know what should I do, I also have a service and a controller class where I'm trying to implement all this.
package stpt.entities;
import javax.persistence.*;
@Entity
@Table(name = "routes")
public class Routes {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "route_id")
private String routeId;
@Column(name = "route_short_name")
private String routeShortName;
@Column(name = "route_long_name")
private String routeLongName;
public Routes() {
}
public String getRouteId() {
return this.routeId;
}
public String getRouteShortName() {
return this.routeShortName;
}
public String getRouteLongName() {
return this.routeLongName;
}
public void setRouteId(String routeId) {
this.routeId = routeId;
}
public void setRouteShortName(String routeShortName) {
this.routeShortName = routeShortName;
}
public void setRouteLongName(String routeLongName) {
this.routeLongName = routeLongName;
}
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof Routes)) return false;
final Routes other = (Routes) o;
if (!other.canEqual((Object) this)) return false;
final Object this$routeId = this.getRouteId();
final Object other$routeId = other.getRouteId();
if (this$routeId == null ? other$routeId != null : !this$routeId.equals(other$routeId)) return false;
final Object this$routeShortName = this.getRouteShortName();
final Object other$routeShortName = other.getRouteShortName();
if (this$routeShortName == null ? other$routeShortName != null : !this$routeShortName.equals(other$routeShortName))
return false;
final Object this$routeLongName = this.getRouteLongName();
final Object other$routeLongName = other.getRouteLongName();
if (this$routeLongName == null ? other$routeLongName != null : !this$routeLongName.equals(other$routeLongName))
return false;
return true;
}
protected boolean canEqual(final Object other) {
return other instanceof Routes;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $routeId = this.getRouteId();
result = result * PRIME + ($routeId == null ? 43 : $routeId.hashCode());
final Object $routeShortName = this.getRouteShortName();
result = result * PRIME + ($routeShortName == null ? 43 : $routeShortName.hashCode());
final Object $routeLongName = this.getRouteLongName();
result = result * PRIME + ($routeLongName == null ? 43 : $routeLongName.hashCode());
return result;
}
public String toString() {
return "Routes(routeId=" + this.getRouteId() + ", routeShortName=" + this.getRouteShortName() + ", routeLongName=" + this.getRouteLongName() + ")";
}
}