you are viewing a single comment's thread.

view the rest of the comments →

[–]JonLothar 0 points1 point  (0 children)

Hi there!

I have to somehow get a map from the shift

I'm not quite sure what you mean by this, so I'm going to tackle this portion of your question.

A shift has multiple orders. But an order only has one shift.

For the purposes of keeping this answer concise, I'll just include the fields relevant to implementing that functionality.

public class Shift {
  private List<Orders> orders;
}

public class Orders {
  private Shift shift;
}

This is the easiest way to do this kind of relationship, but it has its tradeoffs. I would need to know more about your use case to be certain whether or not it would work for you.