public Warehouse getWarehouse() { // In this way because the columns for warehouse can contain // 0 for no value try { if (warehouse != null) warehouse.toString(); // to force load return warehouse; } catch (EntityNotFoundException ex) { return null; } }