@Test void getDoubleNotInFetch() { partialEntity.getDouble("label"); verify(entityManager, times(1)).getReference(meta, "id"); }
@Override public Double getDouble(String attributeName) { if (fetch.hasField(attributeName)) { return decoratedEntity.getDouble(attributeName); } else { return entityManager.getReference(getEntityType(), getIdValue()).getDouble(attributeName); } }
PartialEntity implements Entity { @Override public Double getDouble(String attributeName) { if (fetch.hasField(attributeName)) { return decoratedEntity.getDouble(attributeName); } else { return entityManager.getReference(getEntityType(), getIdValue()).getDouble(attributeName); } } }
PartialEntity implements Entity { @Override public Double getDouble(String attributeName) { if (fetch.hasField(attributeName)) { return decoratedEntity.getDouble(attributeName); } else { return entityManager.getReference(getEntityType(), getIdValue()).getDouble(attributeName); } } PartialEntity(Entity decoratedEntity, Fetch fetch, EntityManager entityManager); }
PartialEntity implements Entity { @Override public Double getDouble(String attributeName) { if (fetch.hasField(attributeName)) { return decoratedEntity.getDouble(attributeName); } else { return entityManager.getReference(getEntityType(), getIdValue()).getDouble(attributeName); } } PartialEntity(Entity decoratedEntity, Fetch fetch, EntityManager entityManager); EntityType getEntityType(); @Override Iterable<String> getAttributeNames(); @Override Object getIdValue(); @Override void setIdValue(Object id); @Override Object getLabelValue(); @Override Object get(String attributeName); @Override String getString(String attributeName); @Override Integer getInt(String attributeName); @Override Long getLong(String attributeName); @Override Boolean getBoolean(String attributeName); @Override Double getDouble(String attributeName); @Override Instant getInstant(String attributeName); @Override LocalDate getLocalDate(String attributeName); @Override Entity getEntity(String attributeName); @Override E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override Iterable<E> getEntities(String attributeName, Class<E> clazz); @Override void set(String attributeName, Object value); @Override void set(Entity values); }
PartialEntity implements Entity { @Override public Double getDouble(String attributeName) { if (fetch.hasField(attributeName)) { return decoratedEntity.getDouble(attributeName); } else { return entityManager.getReference(getEntityType(), getIdValue()).getDouble(attributeName); } } PartialEntity(Entity decoratedEntity, Fetch fetch, EntityManager entityManager); EntityType getEntityType(); @Override Iterable<String> getAttributeNames(); @Override Object getIdValue(); @Override void setIdValue(Object id); @Override Object getLabelValue(); @Override Object get(String attributeName); @Override String getString(String attributeName); @Override Integer getInt(String attributeName); @Override Long getLong(String attributeName); @Override Boolean getBoolean(String attributeName); @Override Double getDouble(String attributeName); @Override Instant getInstant(String attributeName); @Override LocalDate getLocalDate(String attributeName); @Override Entity getEntity(String attributeName); @Override E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override Iterable<E> getEntities(String attributeName, Class<E> clazz); @Override void set(String attributeName, Object value); @Override void set(Entity values);  }