Projection

Collect projection from one or multiple tables...

Projection row=Select.projection(db,tabPizza.colName(),tabPizzaPrice.colPrice())
	.where(AND()
		.and(tabPizza.relPizza(),pizza)
		.and(tabPizzaSize.relPizzaSize(),bigSize)
		.and(tabPizzaPrice.relPizza(),tabPizza.relPizza())
		.and(tabPizzaPrice.relPizzaSize(),tabPizzaSize.relPizzaSize())
	).result();

Get the data:

	String pizzaname=row.getField(db,tabPizza.colName());
	Double pizzaprice=row.getField(tabPizzaPrice.colPrice());

Projection is always ready to convert to JSON.

No need to make a dedicated entity for it.

However, to simplify the data, call flat() method. This is enought in case of unique fields.

Projection row=Select.projection(db,tabPizza.colName(),tabPizzaPrice.colPrice())
	.where(AND()
		.and(tabPizza.colPizza(),pizza)
		.and(tabPizzaSize.colPizzaSize(),bigSize)
		.and(tabPizzaPrice.colPizza(),tabPizza.colPizza())
		.and(tabPizzaPrice.colPizzaSize(),tabPizzaSize.colPizzaSize())
	).flat().result();

In additional cases, map projection to another object:

NameAndPrice np=Select.projection(db,tabPizza.colName(),tabPizzaPrice.colPrice())
	.where(AND()
		.and(tabPizza.colPizza(),pizza)
		.and(tabPizzaSize.colPizzaSize(),bigSize)
		.and(tabPizzaPrice.colPizza(),tabPizza.colPizza())
		.and(tabPizzaPrice.colPizzaSize(),tabPizzaSize.colPizzaSize())
	).map(Mapper::toNameAndPrice);

ProjectionBox contains projections collection

ProjectionBox box=Select.projectionList(db,tabPizza.colName(),tabPizzaPrice.colPrice())
	.where(AND()
		.and(tabPizzaSize.colPizzaSizeId(),bigSize)
		.and(tabPizzaPrice.colPizzaId(),tabPizza.colPizzaId())
		.and(tabPizzaPrice.colPizzaSizeId(),tabPizzaSize.colPizzaSizeId())
	).result();