Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAll() in JdbcTodoService class returning raw resultset instead of mapped entity #7

Open
nezam05 opened this issue Jan 20, 2020 · 0 comments

Comments

@nezam05
Copy link

nezam05 commented Jan 20, 2020

I was trying to make this a maven project using vertx 4 Milestone 4 and modified the entity a bit. I didn't use codegen to generate the converter, instead i used Json.mapTo() to convert the resultset to list of entity. Other than these changes, the getAll() method is all the same as yours.

However, the endpoint is returning raw json, instead of list of entities. The map(Todo::new) is happening, but is not being returned.

I appreciate if you can guide me to some direction to resolve this.

edit: adding the entity

`
public class Task {

@JsonProperty("task_id")
private int taskId;

@JsonProperty("created_at")
private LocalDate createdAt;

@JsonProperty("start_date")
private LocalDate startDate;

@JsonProperty("due_date")
private LocalDate dueDate;

private String title;

private String description;

private int status;

private int priority;


public Task(int taskId, String title, String description, LocalDate createdAt, LocalDate startDate, int status, LocalDate dueDate, int priority) {
    this.taskId = taskId;
    this.title = title;
    this.description = description;
    this.createdAt = createdAt;
    this.startDate = startDate;
    this.status = status;
    this.priority = priority;
    this.dueDate = dueDate;
}

public Task(Task other) {
    this.taskId = other.taskId;
    this.description = other.description;
    this.createdAt = other.createdAt;
    this.title = other.title;
    this.startDate = other.startDate;
    this.status = other.status;
    this.priority = other.priority;
    this.dueDate = other.dueDate;
}

public Task() {
}

public static Task converter(JsonObject object) {
    return object.mapTo(Task.class);
}

//getters and setters
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant