How can i get the other fields without creating a new table?

Viewed 25

I want to get all the employer fields but I am not sure how. the Employer field is like this:

id
userId
List<Skills>
List<Behavier>

this is my current code:

public Employer findEmployerById(Integer id) {
        String sql = "SELECT * FROM employer WHERE id = ?";
        try {
Employer employer = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Employer.class),id);
     return order;
        } catch (EmptyResultDataAccessException emptyResultDataAccessException) {
            throw new ResponseStatusException(HttpStatus.NOT_FOUND);
        }
    }

postman:

{
id: 38,
customerId: 24,
skills: null,
behaviors: null
}

How can I get the list of skills and behavior? because i don't think i need to create a whole table for this. if you have a suggestion please tell and I will give it a try

0 Answers
Related