Full Object-Relational Mapping

Daobab provides unique technic to asosiate java entities throught interfaces. Thanks that, work trully on entities instead of their fields, is possible.

Example: We have a customer and we want to find all delivery dates.

SQL: Select op.deliver_date from orderpizza op where op.customer_id = customerid;

Having customer...

Customer cust=Select.entityWhere(daoCustomer.colName(), "John Smith");

Surelly, we can do this:

Select.fieldList(daoOrderPizza.colDeliverDate()
	.where(daoOrderPizza.colCustomerId(), cust.getCustomerId())
	.result();

However, with Daobab id is unnecessary:

Select.fieldList(daoOrderPizza.colDeliverDate())
	.where(daoOrderPizza.relCustomer(), cust)
	.result();

You don't need to know, which the common column is. Just get an object. Daobab already know enought, and won't let you make a mistake.

Select throught 3 tables. Both produces the same JPQL:

Select.entityList(daoPizza).whereSelect(daoPizza.colPizzaId(),Operator.IN,
	Select.fieldList(daoPI.colPizzaId()).whereSelect(daoPI.colIngredientId(),Operator.EQUAL, 
		Select.field(daoI.colIngredientId()).where(daoI.colName(), "mozarella")
	)
).result();

Object relational, no-id version:

Select.entityList(daoPizza).whereSelect(daoPizza.relPizza(),Operator.IN,
	Select.entityList(daoPI).where(daoPI.relIngredient(),Operator.EQUAL, 
		Select.entity(daoI).where(daoI.colName(), "mozarella")
	)
).result();