[JAVA-13854] Half list moved (#12598)

* [JAVA-13854] added parent module

* [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent)

* [JAVA-13854] moved bootique(submodule) to web-modules(parent)

* [JAVA-13854] moved dropwizard(submodule) to web-modules(parent)

* [JAVA-13854] moved blade(submodule) to web-modules(parent)

* [JAVA-13854] moved java-lite(submodule) to web-modules(parent)

* [JAVA-13854] moved jooby(submodule) to web-modules(parent)

* [JAVA-13854] moved linkrest(submodule) to web-modules(parent)

* [JAVA-13854] moved ninja(submodule) to web-modules(parent)

* [JAVA-13854] moved ratpack(submodule) to web-modules(parent)

* [JAVA-13854] moved resteasy(submodule) to web-modules(parent)

* [JAVA-13854] moved restx(submodule) to web-modules(parent)

* [JAVA-13854] moved spark-java(submodule) to web-modules(parent)

* [JAVA-13854] moved vraptor(submodule) to web-modules(parent)

* [JAVA-13854] delete modules that were moved

* [JAVA-13854]

* [JAVA-13854]

* [JAVA-13854] delete ninja submodule  + moved raml(submodule) to web-modules(parent)

* [JAVA-13854] moved gwt(submodule) to web-modules(parent)

* [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent)

* [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent)

* [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent)

* [JAVA-13854] moved jee-7(submodule) to web-modules(parent)

* [JAVA-13854] moved play-framework(not a module) to web-modules

* [JAVA-13854] fix failing test

* [JAVA-13854] moved struts-2(submodule) to web-modules(parent)

* [JAVA-13854] moved wicket(submodule) to web-modules(parent)

* [JAVA-13854] deleted modules that were moved to web-modules

* JAVA-13854 Removed moved modules from the main pom.xml

Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com>
Co-authored-by: Dhawal Kapil <dhawalkapil@gmail.com>
This commit is contained in:
panos-kakos
2022-08-21 10:14:00 +01:00
committed by GitHub
parent 842a71ad92
commit 0b9549bd3e
755 changed files with 768 additions and 755 deletions
@@ -0,0 +1,24 @@
package com.baeldung;
import javax.ws.rs.ApplicationPath;
import org.apache.cayenne.configuration.server.ServerRuntime;
import org.glassfish.jersey.server.ResourceConfig;
import com.nhl.link.rest.runtime.LinkRestBuilder;
import com.nhl.link.rest.runtime.LinkRestRuntime;
@ApplicationPath("/linkrest")
public class LinkRestApplication extends ResourceConfig {
public LinkRestApplication() {
ServerRuntime cayenneRuntime = ServerRuntime.builder()
.addConfig("cayenne-linkrest-project.xml")
.build();
LinkRestRuntime lrRuntime = LinkRestBuilder.build(cayenneRuntime);
super.register(lrRuntime);
packages("com.baeldung.linkrest.apis");
}
}
@@ -0,0 +1,9 @@
package com.baeldung.cayenne;
import com.baeldung.cayenne.auto._Department;
public class Department extends _Department {
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,9 @@
package com.baeldung.cayenne;
import com.baeldung.cayenne.auto._Employee;
public class Employee extends _Employee {
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,44 @@
package com.baeldung.cayenne.auto;
import java.util.List;
import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.exp.Property;
import com.baeldung.cayenne.Employee;
/**
* Class _Department was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Department extends CayenneDataObject {
private static final long serialVersionUID = 1L;
public static final String DEP_ID_PK_COLUMN = "dep_id";
public static final Property<String> NAME = Property.create("name", String.class);
public static final Property<List<Employee>> EMPLOYEES = Property.create("employees", List.class);
public void setName(String name) {
writeProperty("name", name);
}
public String getName() {
return (String)readProperty("name");
}
public void addToEmployees(Employee obj) {
addToManyTarget("employees", obj, true);
}
public void removeFromEmployees(Employee obj) {
removeToManyTarget("employees", obj, true);
}
@SuppressWarnings("unchecked")
public List<Employee> getEmployees() {
return (List<Employee>)readProperty("employees");
}
}
@@ -0,0 +1,39 @@
package com.baeldung.cayenne.auto;
import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.exp.Property;
import com.baeldung.cayenne.Department;
/**
* Class _Employee was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Employee extends CayenneDataObject {
private static final long serialVersionUID = 1L;
public static final String EMP_ID_PK_COLUMN = "emp_id";
public static final Property<String> NAME = Property.create("name", String.class);
public static final Property<Department> DEPARTMENT = Property.create("department", Department.class);
public void setName(String name) {
writeProperty("name", name);
}
public String getName() {
return (String)readProperty("name");
}
public void setDepartment(Department department) {
setToOneTarget("department", department, true);
}
public Department getDepartment() {
return (Department)readProperty("department");
}
}
@@ -0,0 +1,58 @@
package com.baeldung.linkrest.apis;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import com.baeldung.cayenne.Department;
import com.nhl.link.rest.DataResponse;
import com.nhl.link.rest.LinkRest;
import com.nhl.link.rest.SimpleResponse;
@Path("department")
@Produces(MediaType.APPLICATION_JSON)
public class DepartmentResource {
@Context
private Configuration config;
@GET
public DataResponse<Department> getAll(@Context UriInfo uriInfo) {
return LinkRest.select(Department.class, config).uri(uriInfo).get();
}
@GET
@Path("{id}")
public DataResponse<Department> getOne(@PathParam("id") int id, @Context UriInfo uriInfo) {
return LinkRest.select(Department.class, config).byId(id).uri(uriInfo).getOne();
}
@POST
public SimpleResponse create(String data) {
return LinkRest.create(Department.class, config).sync(data);
}
@PUT
public SimpleResponse createOrUpdate(String data) {
return LinkRest.createOrUpdate(Department.class, config).sync(data);
}
@Path("{id}/employees")
public EmployeeSubResource getEmployees(@PathParam("id") int id, @Context UriInfo uriInfo) {
return new EmployeeSubResource(id, config);
}
@DELETE
@Path("{id}")
public SimpleResponse delete(@PathParam("id") int id) {
return LinkRest.delete(Department.class, config).id(id).delete();
}
}
@@ -0,0 +1,65 @@
package com.baeldung.linkrest.apis;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import com.baeldung.cayenne.Department;
import com.baeldung.cayenne.Employee;
import com.nhl.link.rest.DataResponse;
import com.nhl.link.rest.LinkRest;
import com.nhl.link.rest.SimpleResponse;
@Produces(MediaType.APPLICATION_JSON)
public class EmployeeSubResource {
private Configuration config;
private int departmentId;
public EmployeeSubResource(int departmentId, Configuration config) {
this.departmentId = departmentId;
this.config = config;
}
public EmployeeSubResource() {
}
@GET
public DataResponse<Employee> getAll(@Context UriInfo uriInfo) {
return LinkRest.select(Employee.class, config).toManyParent(Department.class, departmentId, Department.EMPLOYEES).uri(uriInfo).get();
}
@GET
@Path("{id}")
public DataResponse<Employee> getOne(@PathParam("id") int id, @Context UriInfo uriInfo) {
return LinkRest.select(Employee.class, config).toManyParent(Department.class, departmentId, Department.EMPLOYEES).byId(id).uri(uriInfo).getOne();
}
@POST
public SimpleResponse create(String data) {
return LinkRest.create(Employee.class, config).toManyParent(Department.class, departmentId, Department.EMPLOYEES).sync(data);
}
@PUT
public SimpleResponse createOrUpdate(String data) {
return LinkRest.create(Employee.class, config).toManyParent(Department.class, departmentId, Department.EMPLOYEES).sync(data);
}
@DELETE
@Path("{id}")
public SimpleResponse delete(@PathParam("id") int id) {
return LinkRest.delete(Employee.class, config).toManyParent(Department.class, departmentId, Department.EMPLOYEES).id(id).delete();
}
}