I am not 100% sure this is just a Hibernate problem as this can be a far more abstract decision but I'll try it out.
Because the problem description is a little extended I'll first condition that what Let me do is find out if I'm able to alter the implementation to a thing that more resembles a Best practice implementation than the.

I've 3 organizations, highly relevant to this problem: Workstation (ws), Worker and Organization-unit(org-unit).
An Worker can fit in with one org-unit.
An Org-unit holds many employees.
A Workstation can be used to show data of the Org-unit(generally), Of the Org-unit along with a specific worker inside it as well as an worker which doesn't fit in with an org-unit.

Presently, for a number of reasons which were from my control, we don't use any associations between your organizations in Hibernate or via DB-Constraints but we simply use Posts which realistically function as Foreign-Secrets.
We presently come with an additional table that has 4 posts:Id,WSId,EmployeeId,OrgUnitId.
This enables a WS to consult an orgunit (where employeeId is null),for an worker with no org-unit (orgunitId is null) in order to an worker and org-unit (where they are not null).

Let me have the ability to know:
1.Given a WS, which employees could it be following and which org-models and just how (i.e., alone, by having an worker? which?)
2.Given an worker, which WS are monitoring it.
3.Given an org-unit, which WS are monitoring it and just how (i.e., alone, by having an worker? which?)
This issues pertains to the Presentation layer because it dictates the vista is going to be produced But it's an element of the domain model like a user, uses, an interface to control these monitoring mappings and thus these mappings are an element of the domain model.

I am unsure if things i have isn't the least evil among options, and that i would greatly appreciate comments and suggestions.

EDIT From among the solutions It isn't obvious enough that the WS can show data for a lot of such mappings simultaneously, in a combination of the above mentioned sorts (org-unit, worker etc.)

Seems like all you actually need is really a nullable FK on Worker to OrgUnit, and 2 nullable FKs on WS to both Worker and OrgUnit. To determine what WS are monitoring an worker, just get all of the WS with matching emp_id posts. Same goes with the WS monitoring an OrgUnit, possibly using the additional agreement of emp_id being null or otherwise (based on if you want to handle individuals situations individually). No clue where "patients" matches, you did not give any particulars about this.

OK, I'm not sure how you can implement this around the database side, but here's an Entity Model which should cover the connection you're speaking about.

Edit: This can be a latest version in reaction for your comments. Now every WorkStation has n bindings as both versions might have worker or orgunit or both (use DB constraints to make sure they do not have neither).

You may also access the bindings per orgunit and per worker, that ought to result in the above queries much simpler:

public class OrgUnit{

    private Set<Binding> bindings;


public class Employee{

    private Set<Binding> bindings;


public class Binding{

    @ManyToOne(optional = true)
    private Employee employee;

    private OrgUnit orgUnit;

    private WorkStation owner;


public class WorkStation{

    private Set<Binding> bindings;


Sample Client code:

public Set<WorkStation> getWorkstationsPerEmployee(final Employee employee){
    final Set<WorkStation> workStations = new HashSet<WorkStation>();
    for(final Binding binding : employee.getBindings()){
        WorkStation workStation = binding.getOwner();
    return workStations;