Hi
I create temporary column in entity and get method like bellow
public BigDecimal getGrossPrice() {
if (PersistenceHelper.isLoaded(this, "priceitem")) {
Pricelist price = priceitem.stream().filter(pricelist -> Boolean.TRUE.equals(pricelist.getIsdefault()))
.findFirst().orElse(null);
if (price == null)
return BigDecimal.ZERO;
else
return price.getGrossprice();
} else
return BigDecimal.ZERO;
}
I add column to browse and all is ok. Now I want to get entity from code. I create simple method like this
@SuppressWarnings("rawtypes")
public Entity<T> getRowEntitesById(Class copyEntites, Integer id, DataSupplier dataSupplier) {
@SuppressWarnings("unchecked")
LoadContext<?> lc = new LoadContext(copyEntites);
MetadataTools mdt = new MetadataTools();
String entity_name = mdt.getEntityName(copyEntites);
lc.setQueryString("select r from " + entity_name + " r where r.id = :id").setParameter("id", id);
lc.setView(View.BASE);
@SuppressWarnings("unchecked")
Entity<T> result = dataSupplier.load(lc);
return result;
}
This method returns right entity, but column grossprice is empty. Why this column does’t load ?